schrodinger.structutils.ccd module¶
This module contains API for assigning bond orders and formal charges to structures based on the CCD database. Residues and atoms are identified by their PDB residue names and PDB atom names, or by SMILES.
- class schrodinger.structutils.ccd.CCDAtomMapper(use_chirality: bool)¶
Bases:
schrodinger.comparison.atom_mapper.ConnectivityAtomMapper
Class for determining most ideal mapping of a CCD SMILES structure to a 3D ligand conformation.
- score_mapping(ccd_st, st, atset)¶
This method is called to “score” a given mapping. Here, both input structures have been re-ordered to have the same atom ordering, and <atset> is a set of atoms that are “shared” between the 2 structures.
- ATOM_TYPE = 's_m_custom_atom_type'¶
- MAPPER_INDEX = 'i_m_atom_mapper_index'¶
- __init__(use_chirality: bool)¶
- Parameters
use_chirality – if True, in addition to element type use chirality (where defined) to equate atoms.
- are_conformers(st1: schrodinger.structure._structure.Structure, atlist1: List[int], st2: schrodinger.structure._structure.Structure, atlist2: List[int]) bool ¶
Determine if the two substructures, as defined by the atom lists, are conformers but do not explore isomorphisms.
- Parameters
st1 – the first structure
atlist1 – list of atom indexes defining the first substructure
st2 – the second structure
atlist2 – list of atom indexes defining the second substructure
- Returns
boolean indicating whether or not the two structures are conformers
- are_consistently_ordered_conformers(st1: schrodinger.structure._structure.Structure, st2: schrodinger.structure._structure.Structure, atlist: List[int]) bool ¶
Determine if two substructures are consistently ordered conformers. That is, they have the same atom numbering and bonding
- Parameters
st1 – the first structure
st2 – the second structure
atlist – list of atom indexes defining the substructure
- Returns
boolean indicating whether or not the two structures are ordered conformers
- are_enantiomers(st1: schrodinger.structure._structure.Structure, atlist1: List[int], st2: schrodinger.structure._structure.Structure, atlist2: List[int]) bool ¶
Determine if the two substructures, as defined by the atom lists, are enantiomers but do not explore isomorphisms.
- Parameters
st1 – the first structure
atlist1 – list of atom indexes defining the first substructure
st2 – the second structure
atlist2 – list of atom indexes defining the second substructure
- Returns
boolean indicating whether or not the two structures are conformers
- comparator(d1: Dict, d2: Dict) bool ¶
Comparison function to be used to determine if two nodes on graph are equivalent.
If this method is not used when constructing a GraphMatcher, node attributes will not be considered for the purpose of determining isomorphism.
- Parameters
d1 (dict) – key=value dictionary from graph returned from st_to_graph which represents node 1
d1 – key=value dictionary from graph returned from st_to_graph which represents node 2
- Returns
boolean indicating equilvalence
- early_stop(score: float) bool ¶
Check if score is such that we should abort the atom_mapper early.
- Parameters
score – score to check for early stopping condition
- Returns
If True, AtomMapper should stop early. By default, we will not have an early stopping condition
- get_atom_type(at: schrodinger.structure._structure._StructureAtom) str ¶
This value is used as an atom property
- Parameters
at – atom we wish to obtain a type for
- Returns
string which identifies atom type
- initialize_atom_types(st: schrodinger.structure._structure.Structure, invert_stereocenters: bool = False)¶
Initialize the atom types
- Parameters
st – structure containing atoms
invert_stereocenters – whether or not R/S labels should be flipped
- invert_chirality(ch_list: List[str])¶
Invert the chirality (R/S) of an input list of chiralities.
- Parameters
ch_list – list of chirality labels for a structure
- isomeric_atom_sets(st1: schrodinger.structure._structure.Structure, atset1: Set[int], st2: schrodinger.structure._structure.Structure, atset2: Set[int]) bool ¶
Check that the atom types in atset1 are the same as those in atset2. If not, the two structures cannot be conformers.
- Parameters
st1 – the first structure
atset1 – set of atom indexes defining the first substructure
st2 – the second structure
atset2 – set of atom indexes defining the second substructure
- Returns
a boolean indicating if these atom lists are isomeric
- reorder_structures(st1: schrodinger.structure._structure.Structure, atlist1: List[int], st2: schrodinger.structure._structure.Structure, atlist2: List[int], invert_stereocenters: bool = False) Tuple[schrodinger.structure._structure.Structure, schrodinger.structure._structure.Structure] ¶
Reorder the atoms in the two structures.
- Parameters
st1 – the first structure
atlist1 – list of atom indexes defining the first substructure
st2 – the second structure
atlist2 – list of atom indexes defining the second substructure
invert_stereocenters – If True, flip all R<->S, used for are_enantiomers
- Returns
the two structures with structure 2 having had atoms reordered
- score_is_equivalent(score1: float, score2: float) bool ¶
determines if score should be considered equivalent
- Parameters
score1 – the first score
score2 – the second score
- set_atom_type(at: schrodinger.structure._structure._StructureAtom, value: str)¶
Set the value of the atom type
- Parameters
at – atom we wish to set type for
value – set the type of atom to this
- st_to_graph(st: schrodinger.structure._structure.Structure, atset: Set[int]) networkx.classes.graph.Graph ¶
Convert Structure instance to a networkx Graph using _StructureAtom instances as nodes and adding an atom type property
- Parameters
st – the structure to convert
atset – a set of atoms to use to create the graph
- Returns
networkx Graph
- unique_job_name(base_name: str) str ¶
Add an integer to the end of the base_name to get a unique name.
- Parameters
base_name – base job name
- Returns
unique name
- exception schrodinger.structutils.ccd.CCDStructureMismatchError¶
Bases:
RuntimeError
raise this error when structure in CCD template doesn’t match HET
- __init__(*args, **kwargs)¶
- args¶
- with_traceback()¶
Exception.with_traceback(tb) – set self.__traceback__ to tb and return self.
- exception schrodinger.structutils.ccd.SmilesGenerateError¶
Bases:
RuntimeError
raise this error when RDKit fails to generate SMILES
- __init__(*args, **kwargs)¶
- args¶
- with_traceback()¶
Exception.with_traceback(tb) – set self.__traceback__ to tb and return self.
- schrodinger.structutils.ccd.read_ccd_structures(pdbres_iter: Iterable[str]) Dict[str, List[schrodinger.structure._structure.Structure]] ¶
Read in CCD entries as structures.
- Returns
Dictionary that maps a pdbres to reference CCD structures
- schrodinger.structutils.ccd.build_ref_charges_and_bonds_cache(st: schrodinger.structure._structure.Structure)¶
Given a structure extract all CCD reference charges and bonds for each unique residue.
Populates the module level CCD_CHARGES_AND_BONDS_CACHE dict.
- schrodinger.structutils.ccd.determine_ccd_pdbres(res: schrodinger.structure._structure._Residue) str ¶
Determine the CCD state that is consistent with the information present in the residue. For now only histidine is checked.
- schrodinger.structutils.ccd.determine_his_ccd_pdbres(his: schrodinger.structure._structure._Residue) str ¶
Given a HIS residue, determine its protonation state based on PDB names and bond orders, and return the PDB residue name for the state.
- schrodinger.structutils.ccd.ccd_assign_by_names_and_bonds(res: schrodinger.structure._structure._Residue) Tuple[List[Tuple[int, int]], List[Tuple[int, int, int]]] ¶
Assign bond orders and charges to residue based on CCD entry. A target residue matches with the reference if the atom names and all intra-residue bonds are a subset of the reference atom names and intra-residue bonds.
The CCD typically contains the most protonated form, which is not desirable for residues that are not handled by Epik, typically standard residues, e.g. it contains the neutral form of GLU. In that case the CCD is overwritten.
- Returns
Tuple with list of atom indices and assigned charges, and list of assigned bond orders.
- schrodinger.structutils.ccd.attempt_ccd_assignment(res: schrodinger.structure._structure._Residue, res_assign_atoms: Optional[List[int]] = None, _logger: Optional[logging.Logger] = None) Tuple[List[Tuple[int, int]], List[Tuple[int, int, int]]] ¶
Attempt to use the CCD record to assign the bond orders. Returns list of bonds that were assigned. Returns empty list if assignment was not successful.
- Parameters
res – Residue for the het to assign orders to.
res_assign_atoms – List of atoms (substructure from the residue) to assign bond orders to. By default all residue atoms are assigned.
_logger – Logger
- Returns
List of assigned charges and bonds