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

Class PredefinedCriterion

Criterion --+
            |
           PredefinedCriterion


A structure matching criterion that acts on the value of a predefined
function applied to the structure.

Currently available functions are:
    Num_rings
    Num_aromatic_rings
    Num_aliphatic_rings
    Num_heteroaromatic_rings
    Num_rotatable_bonds
    Num_atoms
    Molecular_weight
    Num_chiral_centers
    Total_charge
    Num_positive_atoms
    Num_negative_atoms

For example, one definition parseable from the external file is:
    Num_rings == 0

Instance Methods [hide private]
 
__init__(self, name=None, compstr=None)
Parameters
 
matches(self, st, addprops=False)
Return True if structure 'st' matches this criterion, False if not.
 
getvalue(self, st)
Return the value of the predefined function applied to 'st'.

Inherited from Criterion: __str__, match_compstr, parseLine, setCompStr

Method Details [hide private]

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

 

Parameters

    name - the name of the function to use. Allowed values are those
        in ligfilter.PREDEFINED_KEYS.

    compstr - the comparison string to evaluate the result of the
        predefined function against

Overrides: Criterion.__init__

matches(self, st, addprops=False)

 

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

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

Overrides: Criterion.matches

getvalue(self, st)

 

Return the value of the predefined function applied to 'st'.

For example, return the number of rings, or number of rotatable bonds.

Overrides: Criterion.getvalue