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

Module PolymerScreen



Given a file of molecules, screen them to pick out which ones might 
form polymers.  Simple method presently, relying on combination reactions
specified in another reactions (SMIRKS) file.  Molecules pass screen if
(1) They can fit / match all of the reactant positions for a reaction, and
(2) The resulting product of such a reaction, satisfies (1) as well.
If both of the above are satisfied, it should be straight-forward to see
that the products from the reaction could repeatedly feed back into
the reaction, generating an extended polymer of the original monomer molecule.

Input: 
- Molecule file
    Can be any format understandable by oemolistream, assuming a properly 
    named extension.  For example, "molecules.smi" for SMILES format.
    
- SMIRKS reaction file
    File containing one SMIRKS reaction string per line that will 
    be used to screen the molecules

Either of the above can take stdin as their source by specifying the 
filename "-" or ".smi" or something similar.  See documentation of 
oemolistream for more information

Output:
- Screened molecule file
    Outputs all of the molecules from the source file
    that passed the screening criteria.



Functions [hide private]
 
main(argv)
Command-line main method
 
screenMoleculesByFilename(moleculeFilename, smirksFilename, screenFilename)
Opens files with respective names and delegates most work to next method
 
screenMolecules(moleculeOEIS, smirksFile, screenOEOS)
Primary method, reads the source files to screen.
 
readSMIRKSFile(smirksFile)
Read the contents of the file as a list of SMIRKS strings.
 
checkReactionFit(mol, libgen)
Tries to fit the molecule (mol) into every reactant position of libgen.
Function Details [hide private]

screenMolecules(moleculeOEIS, smirksFile, screenOEOS)

 

Primary method, reads the source files to screen. See module documentation for more information.

Note: This method takes actual File objects, oemolistreams and oemolostreams, not filenames, to allow the caller to pass "virtual Files" for the purpose of testing and interfacing. Use the "main" method to have the module take care of opening files from filenames.

readSMIRKSFile(smirksFile)

 
Read the contents of the file as a list of SMIRKS strings.
Comment lines prefixed with "#" will be ignored.  
Expects one SMIRKS string per line of the file.  Each SMIRKS string can be followed
    by any title / comment, etc. separated by whitespace.  These will be ignored.

checkReactionFit(mol, libgen)

 
Tries to fit the molecule (mol) into every reactant position of libgen. If all successful, then returns True, otherwise False. Clears out any StartingMaterials in the libgen before beginning.