Package schrodinger :: Package utils :: Module ligfilter :: Class Definition
[hide private]
[frames] | no frames]

Class Definition

A class that defines a collection of SMARTS patterns for matching against. The includes() method returns a list of those patterns that should be matched, and the excludes() method returns those that shouldn't.

Instance Methods [hide private]
 
__init__(self, name, includes=[], excludes=[], group=None)
Parameters
 
addKey(self, key, positive=True)
Add the SMARTS pattern 'key' to the list of desired matches (includes) if 'positive' is True, and to the list of unwanted matches (excludes) if 'positive' is False.
 
removeKey(self, key)
Remove the SMARTS pattern 'key' from the wanted or unwanted matches list.
 
includes(self)
Return a list of wanted matches.
 
excludes(self)
Return a list of unwanted matches.
 
_expandIncludes(self, inclist, definitions, masterlist)
For the provided list of Definitions 'inclist', expand any composite definitions, using the contents of the 'definitions' list of Definitions.
 
_expandExcludes(self, exclist, definitions, masterlist)
For the provided list of Definions 'exclist', expand any composite definitions, using the contents of the 'definitions' list of Definitions.
 
expand(self, definitions)
Generate a new Definition from the current one in which the includes and excludes are expanded from the provided 'definitions' dictionary.
 
__str__(self)
Return a standard string form of the Definition suitable for filter/keys files.
Method Details [hide private]

__init__(self, name, includes=[], excludes=[], group=None)
(Constructor)

 

Parameters

    includes - a list of SMARTS patterns to count

    excludes - a list of SMARTS patterns that can be used to exclude
        matches in the includes list
    group - name of the group that this definition is part of 
        (optional). See Ev:50599

_expandIncludes(self, inclist, definitions, masterlist)

 

For the provided list of Definitions 'inclist', expand any composite definitions, using the contents of the 'definitions' list of Definitions.

Return the expanded definitions via the parameter 'masterlist'.

For example, if a Definition TwoCarbons in 'definitions' is made up of the "includes" [C][C] and [c][c], and 'inclist' includes TwoCarbons, then [C][C] and [c][c] will be added to 'masterlist'.

_expandExcludes(self, exclist, definitions, masterlist)

 

For the provided list of Definions 'exclist', expand any composite definitions, using the contents of the 'definitions' list of Definitions.

Return the expanded definitions via the parameter 'masterlist'.

Note that the expansion uses the "includes" of the 'definitions' list to generate the masterlist. For example, if a Definition TwoCarbons in 'definitions' is made up of the "includes" [C][C] and [c][c], and 'exclist' includes TwoCarbons, then [C][C] and [c][c] will be added to 'masterlist'.