Package schrodinger :: Package application :: Package combiglide :: Package packages :: Module chutils :: Class ApplyJoiningRules
[hide private]
[frames] | no frames]

Class ApplyJoiningRules

APIs to determine what adduct rule matches are required for each substrate attachment point and what rule matches are exhibited for each adduct attachment point. An instance involves specification of a JoiningRules object, a Structure object, and a set of attachment points (heavy atoms in the structure). The calling code uses the APIs to determine the required information.

Instance Methods [hide private]
 
__init__(self, rules, st, attachments, chmmol=None, parent_rowid=None, db_name=None)
rules is a JoiningRules object.
 
writeDb(self, conn, cur)
Write entries into the specified Db encoding attachment rules for the current structure (i.e., the one used to create the current ApplyJoiningRules instance).
 
getAtomOkPatterns(self, atom_indx)
Return set of patterns matching this atom
 
getAtomOkmPatterns(self, atom_indx)
Return set of okm patterns matching this atom
 
getAtomOkRules(self, atom_indx)
Return SMARTS rules that must all be matched by an adduct attachment point in order for a join to be allowed to the specified substrate attachment.
 
getAtomOkmRules(self, atom_indx)
Return SMARTS rules that denote that an attachment as disfavored.
 
getAtomOblig(self, atom_indx)
Return True if atom has an obligate attachment, False if not
 
getAtomMatchRules(self, atom_indx)
Return the set of rules that this atom matches.
Static Methods [hide private]
 
_getAllowedAtoms(matched_patterns_atom_d, getRule, attachments)
Dictonary from iatom in attachments to set of SMARTS that an adduct is required to match for the attachment to be allowed.
 
_cullMatchesAtoms2(ok_matched_patterns_atom_d, okm_matched_patterns_atom_d)
For each atom, remove from the second dictionary any SMARTS patterns...
 
_cullMatchesAtoms(matched_patterns_atom_d)
See docstring of _getMatchesAtoms for format of the input.
 
_getMatchesAtoms(chmmol, smartses, attachments)
Return a dict of atom_index to dict of smarts to a set of matches, for each atom_index in attachments and for each smarts in smartses.
 
_getChmmol(st)
 
getCreateAttachmentsTableSql(dbname)
Return the sql for creating an attachments table in the named db.
Class Variables [hide private]
  __encountered_conns = set([])
Method Details [hide private]

__init__(self, rules, st, attachments, chmmol=None, parent_rowid=None, db_name=None)
(Constructor)

 

rules is a JoiningRules object. st is a Structure object. attachments is an iterable of attachment points (Maestro heavy-atom indices) that it is desired to determine rules for. chmmol must correspond to st, if specified. parent_rowid must be specified if writeDb() is to be called.

_cullMatchesAtoms2(ok_matched_patterns_atom_d, okm_matched_patterns_atom_d)
Static Method

 

For each atom, remove from the second dictionary any SMARTS patterns
 and matches that are not present in the first dictonary:

_cullMatchesAtoms(matched_patterns_atom_d)
Static Method

 

See docstring of _getMatchesAtoms for format of the input.
This method removes matches that are proper subsets of other
 matches for the same atom. If all matches are culled for some
 SMARTS, then the SMARTS entry itself is removed.

_getMatchesAtoms(chmmol, smartses, attachments)
Static Method

 

Return a dict of atom_index to dict of smarts to a set of
 matches, for each atom_index in attachments and for each smarts
 in smartses. A match is a tuple of atom indices that matched the
 smarts, with the leading atom index matching the top-level key.
 The matches given for each atom, for each smarts, each contain
 a unique atom list.
Semantically, a given smarts in smartses will be the pattern 
 on the left in an OK or OK- line in the joining-rules file.
 So the returned data structures gives SMARTS matches to
 substructures in the substrate whose leading atoms match
 substrate attachment atoms.

getCreateAttachmentsTableSql(dbname)
Static Method

 

Return the sql for creating an attachments table in the named db. This is put into a static method because the information it returns has to be accessed from places where no JoiningRules object exists.

writeDb(self, conn, cur)

 

Write entries into the specified Db encoding attachment rules for the current structure (i.e., the one used to create the current ApplyJoiningRules instance). If create_tables is True, the tables will first be created.

getAtomOkmRules(self, atom_indx)

 

Return SMARTS rules that denote that an attachment as disfavored. In order for an adduct attachment to the specified substrate atom to be allowed but disfavored, all the OkRules have to be matched on the adduct and at least one OkmRule has to be matched.

getAtomMatchRules(self, atom_indx)

 

Return the set of rules that this atom matches. This would be used on an adduct attachment point to see if it matches a substrate attachment's allowed rules.