Package CHEM :: Package Web :: Package cgibin :: Module MSFragmentUtil
[hide private]
[frames] | no frames]

Module MSFragmentUtil



Functions [hide private]
 
flagFragBonds(mol, smartsPatterns)
Sets bond types to "frag" in the input mol if it is matched by an input smarts pattern.
 
fragmentLinker(smiles, frag_patterns)
Given an input smiles string, the associated molecule is fragmented into all possible fragment combinations defined by the input frag_patterns.
 
getMass(smiles)
Returns the mass of molecule defined by the input SMILES.
 
determineFragType(smiles)
Returns the type of fragment given in the input SMILES.
 
main()
Variables [hide private]
  massDict = {"+": 1.00728, "H": 1.0078250321, "1H": 1.007825032...
Function Details [hide private]

flagFragBonds(mol, smartsPatterns)

 
Sets bond types to "frag" in the input mol if it is matched by an input smarts pattern.
   
Inputs:
    mol: an OEGraphMol object
    smartsPatterns: a list of smarts patterns that indicate a particular bond to look for;
        must use atom map index values of 1 and 2 to indicate the particular bond in the
        pattern to flag.      
Outputs:
    integer number of bonds flagged
    
Bond types are set using bond.SetType("frag"), so be careful if you use the bondType field for
another purpose.  Also, the input mol is directly modified with the flagged bond types.

fragmentLinker(smiles, frag_patterns)

 
Given an input smiles string, the associated molecule is fragmented into all possible fragment 
combinations defined by the input frag_patterns.

Inputs
    smiles: a SMILES string
    frag_patterns: a list of fragmentation patterns, specified as SMARTS strings
Outputs
    a list of fragment SMILES strings
    
This function does not fragment a molecule into all of its pieces.  Rather it fragments a molecule at
each bond matched in frag_patterns, in all possible combinations.  The function then returns each
unique fragment (if a molecule contains two of the same fragment, this fragment is only returned
once)

getMass(smiles)

 
Returns the mass of molecule defined by the input SMILES.

Input
    smiles: a SMILES string
Output
    the total molecular mass of the SMILES string
    
This function uses the globablly defined massDict to get accurate mass values taken from NIST.
The look up in the dictionary is done by atomic symbol.  If no value is found for a particular
atomic symbol, then OEChem default average weight is used instead.

determineFragType(smiles)

 
Returns the type of fragment given in the input SMILES.

Input:
    smiles: a SMILES string
Output:
    a string indicating the fragment type, named according to conventions defined by collaborators
    
This function defines fragment types by looking at the atom valencies in the input SMILES, compared
to the standard values.  This allows one to find lone electrons that indicate potential reaction sites
which define the fragment type.


Variables Details [hide private]

massDict

Value:
{"+": 1.00728, "H": 1.0078250321, "1H": 1.0078250321, "D": 2.014101778\
0, "2H": 2.0141017780, "He": 3.0160293097, "4He": 4.00260234, "3He": 3\
.01608, "Li": 7.0160030, "7Li": 7.0160030, "6Li": 6.015121, "Be": 9.01\
21822, "9Be": 9.0121822, "B": 11.0093054, "11B": 11.0093054, "10B": 10\
.012937, "C": 12.0000000, "12C": 12.0000000, "13C": 13.0033548378, "N"\
: 14.0030740052, "14N": 14.0030740052, "15N": 15.0001088984, "O": 15.9\
949146221, "16O": 15.99491463, "17O": 16.99913150, "18O": 17.9991604, \
"F": 18.99840322, "19F": 18.99840322, "Ne": 19.9924356, "20Ne": 20.992\
...