Package schrodinger :: Package application :: Package combiglide :: Package packages :: Module core_classifier :: Class CoreClassifier
[hide private]
[frames] | no frames]

Class CoreClassifier

Class to generate structural classes for a structure containing a single ring system. Beyond the lowest nodes, the classification only applies to the ring-system portion of the input structure.

Instance Methods [hide private]
 
__init__(self, st_orig, smiles_stereo=None, smiles_nostereo=None)
Create classes for a single input structure.
String
getRep(self, node)
Return the class name (representation) of the structure at the specified node.
List
getReps(self)
Return a list containing the class names (representations) of the structure at all nodes.
Dictionary
getFullReps(self)
Return dictionary of data associated with the representation at every node.
 
_setIatomIsAromatic(self)
Create and store a list giving aromatic status (True or False) for each atom, indexed by atom number (index origin 1):
 
_setSelfStInfo(self, st=None)
Isolate ring structure in self.st into self.ring_st and set self data structures to values consistent with self.st and self.ring_st.
 
_setFullReps(self, node, sm, rep, st)
Set results in the top-level data structure for the specified node:
 
_genReps(self)
Generate the representations at all nodes.
Bool
_isEligibleToDisconnect(self, ring_bonded_atoms)
Determine whether the atoms in ring_bonded atoms have characteristics that allow their intervening atom to be excised and these two atoms joined.
Bool
_disconnectIfEligible(self, iatom)
Disconnect iatom from its ring neighbors and join the ring neighbors to each other (contracting the ring), unless the conditions tested in _isEligibleToDisconnect are met.
 
_removeEligibleRingAtoms(self)
Remove ring atoms that can be removed, contracting rings to minimum size.
String
_genRep4(self)
Generate the node='4' SMILES.
String
_getAromaticFromStarRep(self, star_rep)
Convert a "star" representation like '[*]1[*][*]1' to an aromatic/aliphatic representation, like '[a]1[a][a]1' or '[A]1[A][A]1', by matching against the current structure, then (for each match) replacing '*' by the aromatic designation of the matching atom in the original st, then picking the lowest-sorting match.
String
_aromatizeStarRep(self, match, star_rep)
Given a star rep and a match to it, replace each '*' with 'a' or 'A', depending on whether the corresponding matching atom was aromatic or not in the original st.
tuple
_isolateRingSystem(self, iatom_in_ring)
Given a structure with a ring system to which iatom_in_ring belongs, return a structure that is a copy of the ring system, only.
 
_genRep3a(self)
Return the node-'3a' representation.
 
_reBond(self)
Break bonds between ring and non-ring atoms in self.st
Class Methods [hide private]
List
getNodeNamesAtLevels(cls)
Return a list of lists of node names that classification_scheme.Scheme can be initialized with for this particular classification scheme.
Static Methods [hide private]
String
_stripBrackets(sm)
Create a more compact representation of a SMARTS-like string by stripping brackets.
String
_subStar(sm)
Subsititute an asterisk ( '*' ) for each atomic symbol in the input SMILES, giving a new SMILES all of whose atoms are wildcards.
Class Variables [hide private]
  node_names_at_levels = [['Stereo_SMILES'], ['SMILES'], ['Arom_...
Method Details [hide private]

getNodeNamesAtLevels(cls)
Class Method

 

Return a list of lists of node names that classification_scheme.Scheme can be initialized with for this particular classification scheme.

Returns: List
List of node names

__init__(self, st_orig, smiles_stereo=None, smiles_nostereo=None)
(Constructor)

 

Create classes for a single input structure.

Parameters:
  • st_orig (A structure.Structure object) - The structure whose representations will be generated
  • smiles_stereo (A schrodinger.structutils.smiles.SmilesGenerator object) - A generator for stereo SMILES; created if not passed
  • smiles_nostereo (A schrodinger.structutils.smiles.SmilesGenerator object) - A generator for non-stereo SMILES; created if not passed

getRep(self, node)

 

Return the class name (representation) of the structure at the specified node.

Returns: String
Node name

getReps(self)

 

Return a list containing the class names (representations) of the structure at all nodes.

Returns: List
List of class names, one per node

getFullReps(self)

 

Return dictionary of data associated with the representation at every node. Mainly for debugging.

Returns: Dictionary
Dictionary of structural data for each node.

_setSelfStInfo(self, st=None)

 

Isolate ring structure in self.st into self.ring_st and set self data structures to values consistent with self.st and self.ring_st.

Parameters:
  • st (A structure.Structure object) - A structure; if not specified, act on self.st. If specified, set self.st to this parameter.

_stripBrackets(sm)
Static Method

 

Create a more compact representation of a SMARTS-like string by stripping brackets. So '[*][*][*]' becomes '***'.

Parameters:
  • sm (String) - A SMILES string (will be None for some nodes)
Returns: String
The string with brackets deleted

_setFullReps(self, node, sm, rep, st)

 

Set results in the top-level data structure for the specified node:

Parameters:
  • node (String) - The node to which this representation pertains.
  • sm (String) - SMILES-style representation of this class (None for some nodes)
  • rep (String) - Compact representation for this class
  • st (structure.Structure object) - Structure object that is the basis for this class (None for some nodes)

_isEligibleToDisconnect(self, ring_bonded_atoms)

 

Determine whether the atoms in ring_bonded atoms have characteristics that allow their intervening atom to be excised and these two atoms joined. Called only for atom pairs that are bonded within a ring to another atom.

Parameters:
  • ring_bonded_atoms (List) - Exactly two ring neighbors of some ring atom that is in only a single sssr ring.
Returns: Bool
True if the central atom should be excised from the ring (and the neighbors attached to each other) and False otherwise. This is the case unless either (1) both atoms are in multiple rings with identical ring membership, or (2) the two atoms are bonded to each other.

_disconnectIfEligible(self, iatom)

 

Disconnect iatom from its ring neighbors and join the ring neighbors to each other (contracting the ring), unless the conditions tested in _isEligibleToDisconnect are met.

Parameters:
  • iatom (Integer) - An atom in self.st that is in only one ring.
Returns: Bool
True if the atom was excised; False otherwise

_genRep4(self)

 

Generate the node='4' SMILES.

Returns: String
The node-4 SMILES representation

_getAromaticFromStarRep(self, star_rep)

 

Convert a "star" representation like '[*]1[*][*]1' to an aromatic/aliphatic representation, like '[a]1[a][a]1' or '[A]1[A][A]1', by matching against the current structure, then (for each match) replacing '*' by the aromatic designation of the matching atom in the original st, then picking the lowest-sorting match. Uses _aromatizeStarRep() to convert each match from star to aromatic form.

Parameters:
  • star_rep (String) - A SMILES-like structure in the "star" representation
Returns: String
String in which '*' in the star_rep has been replaced by 'A' for aliphatics and 'a' for aromatic atoms.

_aromatizeStarRep(self, match, star_rep)

 

Given a star rep and a match to it, replace each '*' with 'a' or 'A', depending on whether the corresponding matching atom was aromatic or not in the original st.

Parameters:
  • match (List) - Atom numbers in self.ct that match the star_rep SMILES
  • star_rep - A SMILES whose atoms consist solely of '[*]' types
Returns: String
String in which '*' in the star_rep has been replaced by 'A' for aliphatics and 'a' for aromatic atoms.

_isolateRingSystem(self, iatom_in_ring)

 

Given a structure with a ring system to which iatom_in_ring belongs, return a structure that is a copy of the ring system, only.

Parameters:
  • iatom_in_ring (Integer) - An arbitrary index to an atom in a ring in self.st
Returns: tuple
The isolated ring structure, a map of the self.st atom numbers to to the new atom numbers, and a map of the new atom numbers to the atom numbers in self.st

_genRep3a(self)

 

Return the node-'3a' representation. return: The node-'3a' representation rtype: String

_subStar(sm)
Static Method

 

Subsititute an asterisk ( '*' ) for each atomic symbol in the input SMILES, giving a new SMILES all of whose atoms are wildcards. Note that in the expected use case, there are no bond indications.

Parameters:
  • sm (String) - A SMILES string
Returns: String
A SMILES string with atom types replaced with '[*]'

Class Variable Details [hide private]

node_names_at_levels

Value:
[['Stereo_SMILES'],
 ['SMILES'],
 ['Arom_framework'],
 ['Framework', 'Arom_topology'],
 ['Topology'],
 ['sssr'],
 ['root']]