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

Class SmartsCriterion

Criterion --+
            |
           SmartsCriterion


A structure matching criterion that looks for a match to a Definition
instance, which is comprised of a collection of SMARTS patterns.

For example, for the Definition 'TwoCarbons' that matches against the
SMARTS patterns [#6][#6], the comparison string

    TwoCarbons < 40

will match if there are less than 40 carbon-carbon bonds in the
structure.

Instance Methods [hide private]
 
__init__(self, definition, compstr=None)
Parameters
 
_count_occurances(self, st)
Retrieve a count of 'includes' matches in the structure, but do not count any matches that have atoms that are also present in any 'excludes' matches.
 
matches(self, st, addprops=False)
Return True if structure 'st' matches this criterion, False if not.
 
getvalue(self, st)
Return the number of times that definition.includes() patterns match the structure but do not overlap with any definition.excludes() patterns.
 
expand(self, definitions)
Generate a new SmartsCriterion from the current one in which the definition.includes() and definition.excludes() are expanded from the definitions list.

Inherited from Criterion: __str__, match_compstr, parseLine, setCompStr

Method Details [hide private]

__init__(self, definition, compstr=None)
(Constructor)

 

Parameters

    definition - a Definition instance, specifying the SMARTS
        pattern(s) to be included and excluded

    compstr - the comparison string to be used.
              Currently equal to "<operator> <value>"
              Used by the expand() method
                
If compstr are not specified, parseLine() method should be used

Overrides: Criterion.__init__

matches(self, st, addprops=False)

 

Return True if structure 'st' matches this criterion, False if not.

Current matching behavior is to count the number of matches in the definition.includes() list, that do not have any overlapping atoms with matches in the definition.excludes() list.

st (Structure) - Structure object addprops (bool) - whether to add properties for each description

Overrides: Criterion.matches

getvalue(self, st)

 

Return the number of times that definition.includes() patterns match the structure but do not overlap with any definition.excludes() patterns.

Overrides: Criterion.getvalue