Package CHEM :: Package CombiCDB :: Module PatternCountScreen :: Class PatternCountScreen
[hide private]
[frames] | no frames]

Class PatternCountScreen



BaseScreen.BaseScreen --+
                        |
                       PatternCountScreen

Expects as input (besides the oemolistream to screen and 
the oemolostream to output to) a SMARTS file describing the
patterns to screen by.  One SMARTS pattern string is expected
for each line of the file.  Furthermore, each SMARTS line should
end with an additional token (whitespace separated) representing
an integer "count."  If not present (or the last token is not 
parsable as an integer), then a default value of ">=1" is assumed.

A molecule passes this screen iff
for each SMARTS pattern listed, 
    the molecule contains exactly "count" instances of that pattern
    
For example, a SMARTS file like the following:

    O=C[OH] CarboxylicAcid  2
    [NH2]   0
    [Sn]    Tin
    
Will screen for all molecules that contain exactly 2 carboxylic 
acids, 0 primary amines and at least 1 tin atom.  Note that the 
pattern label is not actually important (none specified for 
primary amine) and that if the count is ommitted (as in for Tin 
above), this is treated as a special case of "at least" rather
than "exactly" 1.



Instance Methods [hide private]
 
__init__(self, smartsFile)
Constructor.
 
screenMolecule(self, mol)
Primary functional method.
 
prepareParameters(self)
Parse out the SMARTS pattern file and instantiate search objects once here so it doesn't have to be done every time by the screenMolecule(...) method.

Inherited from BaseScreen.BaseScreen: clearParameters, getParameter, runScreen, runScreenByFilename, screenSmiles, setOEIS, setOEOS, setParameter

Class Variables [hide private]
  SMARTS_FILE_KEY = 0
  SMARTS_LIST_KEY = 1
  COUNT_LIST_KEY = 2
Default minimum value for pattern count if none specified
  DEFAULT_MIN_COUNT = 1

Inherited from BaseScreen.BaseScreen: mOEIS, mOEOS, mParameters

Method Details [hide private]

__init__(self, smartsFile)
(Constructor)

 
Constructor. Just expects the smartsFile to read the screening patterns and counts from. See class documentation for more information. Before executing runScreen(...), the caller should setOEIS(...) and setOEOS(...) for the input and output streams.

screenMolecule(self, mol)

 
Primary functional method. See class documentation for screening criteria.
Overrides: BaseScreen.BaseScreen.screenMolecule

prepareParameters(self)

 
Parse out the SMARTS pattern file and instantiate search objects once here so it doesn't have to be done every time by the screenMolecule(...) method.
Overrides: BaseScreen.BaseScreen.prepareParameters