Package schrodinger :: Package structutils :: Module analyze
[hide private]
[frames] | no frames]

Module analyze

Functions for analyzing Structure objects.

AslLigandSearcher is a class that identifies putative ligands in a structure. Each putative found ligand is contained in a Ligand instance.

There are also a number of functions for using SMARTS, ASL, and SMILES (e.g. evaluate_smarts or generate_smiles). Other functions return information about a structure (i.e. get_chiral_atoms or hydrogens_present). There are also several SASA (Solvent Accessible Surface Area) functions (i.e. calculate_sasa_by_atom and calculate_sasa).

See also the discussion in the Python API overview.


Copyright: Schrodinger, LLC. All rights reserved.

Classes [hide private]
  AslLigandSearcher
Search a Structure instance for putative ligands with an Atom Selection Language expression.
  Ligand
A putative AslLigandSearcher ligand structure with read-only data and convenience methods.
Functions [hide private]
dict
get_chiral_atoms(structure)
Return a dictionary of chiral atoms, for which the key is the atom index and the value is one of the following strings: "R", "S", "ANR", "ANS", "undef".
list
evaluate_smarts(structure, smarts_expression, verbose=False, first_match_only=False, unique_sets=False)
Search for substructures in Structure structure matching the SMARTS pattern smarts_expression.
 
validate_smarts(smarts)
 
lazy_canvas_import()
Initialize _canvas and smiles variables.
(bool, str)
validate_smarts_canvas(smarts)
Check whether a SMARTS pattern is valid or not.
list
evaluate_smarts_canvas(structure, smarts, stereo='annotation_and_geom', start_index=1, uniqueFilter=True, allowRelativeStereo=False, rigorousValidationOfSource=False, hydrogensInterchangeable=False)
Evaluate SMARTS patterns using the Canvas libraries.
list
evaluate_multiple_smarts(structure, smarts_list, verbose=False, first_match_only=False, unique_sets=False)
Search for multiple SMARTS substructures in Structure structure.
list
evaluate_substructure(st, subs_expression, first_match_only=False)
Search for the MacroModel-style substructure expression in Structure st and return the atoms that match.
str
generate_asl(st, atom_list)
Generate and return an atom expression for the atoms in Structure st which are listed in atom_list.
bool
validate_asl(asl)
Validate the given ASL expression.
list
evaluate_asl(st, asl_expr)
Search for substructures matching the ASL (Atom Specification Language) string asl_expr in Structure st.
generator
get_atoms_from_asl(st, asl_expr)
Return atoms matching the ASL string asl_expr in Structure st.
list
find_rings(st, sort=False)
Return the smallest set of smallest rings (SSSR) in st.
bool
hydrogens_present(st)
Return True if all hydrogens are present in Structure st, False otherwise.
 
generate_tautomer_code(st, considerEZStereo=True, considerRSStereo=True, stereo='annotation_and_geom', strip=False)
str
generate_smiles(st, unique=True, stereo='annotation_and_geom')
Return a SMILES string for st.
 
generate_smarts(st, atom_subset=None, check_connectivity=True)
str
generate_smarts_canvas(st, atom_subset=None, check_connectivity=True, include_hydrogens=False, honor_maestro_prefs=False)
Return a SMARTS pattern for atoms atom_subset in Structure st.
bool
match_hbond(atom1, atom2, distance_max=2.5, donor_angle=120.0, acceptor_angle=90.0, distance=None, measure=None)
Return True if atom1-atom2 represents an H-bond where either atom1 or atom2 is the acceptor heavy atom, and the other atom is the donor hydrogen.
list
generate_crystal_mates(st, radius=10.0, space_group=None, a=None, b=None, c=None, alpha=None, beta=None, gamma=None, group_radius=14.0)
Generate crystal mates for the input Structure st.
list
find_overlapping_atoms(st, ignore_hydrogens=True, ignore_waters=True, dist_threshold=0.8)
Search the specified structure for overlapping atoms.
str
generate_molecular_formula(st)
Return a string for the molecular formula in Hill notation for the st.
bool
_may_atom_be_part_of_rotatable_bond(atom)
Determine whether an atom might be in a rotatable bond.
bool
_is_bond_ring_edge(bond, rings)
Determine whether a bond is a ring edge.
bool
is_bond_rotatable(bond, rings=None)
Return True if specified bond is rotatable, False otherwise.
iterator of tuples
rotatable_bonds_iterator(st, rings=None)
Return an iterator for rotatable bonds (atomnum1, atomnum2) in the structure.
int
get_num_rotatable_bonds(st, rings=None)
Return the number of rotatable bonds in the Structure st.
list of (int, int)
hbond_iterator(st, atoms=None)
Iterate over hydrogen bond between the atoms specified by the atom_set and the other atoms in st.
int
get_num_hbonds(st, atoms=None)
Calculate the the number of hydrogen bonds in st.
list
find_equivalent_atoms(st, span_molecules=True)
Find atoms in the structure that are equivalent.
 
get_approximate_sasa(st, atom_indexes=None, cutoff=7.0)
list
calculate_sasa_by_residue(st, atoms=None, cutoff=8.0, probe_radius=1.4, resolution=0.2, exclude_water=False)
Calculate the solvent-accessible surface area (SASA) for the whole structure, or an atom subset, and then group them by residue.
float
calculate_sasa(st, atoms=None, cutoff=8.0, probe_radius=1.4, resolution=0.2, exclude_water=False, exclude_atoms=None)
Calculate the solvent-accessible surface area (SASA) for the whole structure, or an atom subset.
list
calculate_sasa_by_atom(st, cutoff=8.0, probe_radius=1.4, resolution=0.2)
Calculate the solvent-accessible surface area (SASA) for each atom in the given structure, and returns a list of floats.
 
get_approximate_atomic_sasa(st, iat, cutoff=7.0, sasa_probe_radius=1.4, hard_sphere_s=2.5, scale_factor=2.32)
list
find_ligands(st, **kwargs)
Simple function interface for AslLigandSearcher class.
numpy array
center_of_mass(st, atom_indices=None)
Get the x, y, z coordinates for the center of mass.
tuple
calculate_principle_moments(struct=None, atoms=None, massless=False)
Calculate the principal moments of inertia for a list of atoms.
list
find_shortest_bond_path(struct, index1, index2)
Find the shortest path of bonded atoms that connects atom1 to atom2
structure.Structure
get_average_structure(sts)
Calculate the average structure between the given conformers.
List of int lists
find_common_substructure(sts, atomTyping=11)
Find the maximum substructure that is common between all specified CTs.
List of int lists
find_common_substructures(sts, atomTyping=11)
Find the maximum common substructures for each pair of the given CTs.
Variables [hide private]
  smiles = None
hash(x)
  _canvas_license = None
hash(x)
  _canvas = None
hash(x)
  logger = log.get_logger("schrodinger.structutils.analyze")
  _initializer = mminit.Initializer([mm.mmstereo_initialize, mm....
  __package__ = 'schrodinger.structutils'
Function Details [hide private]

get_chiral_atoms(structure)

 

Return a dictionary of chiral atoms, for which the key is the atom index and the value is one of the following strings: "R", "S", "ANR", "ANS", "undef".

ANR and ANS designate "chiralities" of non-chiral atoms that are important for determining the structure of the molecule (ex: cis/trans rings).

Parameters:
  • structure (Structure) - Chirality of atoms within this structure will be determined.
Returns: dict
Dictionary of chiralities keyed off atom index.

evaluate_smarts(structure, smarts_expression, verbose=False, first_match_only=False, unique_sets=False)

 

Search for substructures in Structure structure matching the SMARTS pattern smarts_expression.

This function uses the mmlib implementation (mmpatty) of SMARTS matching.

See also evaluate_smarts_canvas, which uses the Canvas libraries to evaluate SMARTS patterns. This function may be deprecated in favor of the evaluate_smarts_canvas function at some point. For now, you should prefer the Canvas version when you are starting with a Canvas ChmMol object or to guarantee consistency with the generate_smiles function.

Returns a list of lists of ints. Each list of ints is a list of atom indices matching the SMARTS pattern.

Parameters:
  • structure (Structure) - Structure to search for matching substructures.
  • smarts_expression (str) - SMARTS string used to match substructures.
  • verbose (bool) - If True, print additional progress reports from the C implementation.
  • first_match_only (bool) - If False, return all matches for a given starting atom - e.g. [1, 2, 3, 4, 5, 6] and [1, 6, 5, 4, 3, 2] from atom 1 of benzene with the smarts_expression 'c1ccccc1'. If True, return only the first match found for a given starting atom. Note that setting first_match_only to True does not affect matches with different starting atoms - i.e. benzene will still return six lists of ints for 'c1ccccc1', one for each starting atom. To match only once per set of atoms, use unique_sets=True. Note also that setting first_match_only to True does not guarantee that all matching atoms will be found.
  • unique_sets (bool) - If True, the returned list of matches will contain a single (arbitrary) match for any given set of atoms. If False, return the uniquely ordered matches, subject to the behavior specified by the first_match_only parameter.
Returns: list
Each value is a list of atom indices matching the SMARTS pattern.

lazy_canvas_import()

 

Initialize _canvas and smiles variables. Since the canvas modules may take some time to import, before it an function loading time.

validate_smarts_canvas(smarts)

 

Check whether a SMARTS pattern is valid or not.

Returns: (bool, str)
The bool indicates whether the SMARTS pattern is valid, the string gives the error message if bool is False Note: the return value of this function always evaluates to True since it is a non-empty tuple.

evaluate_smarts_canvas(structure, smarts, stereo='annotation_and_geom', start_index=1, uniqueFilter=True, allowRelativeStereo=False, rigorousValidationOfSource=False, hydrogensInterchangeable=False)

 

Evaluate SMARTS patterns using the Canvas libraries.

Returns a list of lists of ints. Each list of ints is a list of atom indices matching the SMARTS pattern.

Parameters:
  • structure (Structure or schrodinger.application.canvas.base.ChmMol) - Structure to search for matching substructures.
  • smarts (str) - SMARTS string used to match substructures.
  • stereo (enum) - Specify how to determine the stereochemistry of a ChmMol from a Structure. Can be STEREO_FROM_GEOMETRY, STEREO_FROM_ANNOTATION, STEREO_FROM_ANNOTATION_AND_GEOM, or NO_STEREO. See schrodinger.structutils.smiles.SmilesGenerator.__init__ for descriptions of these options.
  • start_index (int) - Specify the start index of the atom indices returned. Defaults to Structure mode, which is 1-based. Pass in 0 for 0-based indices.
  • uniqueFilter (bool) - Returns only unique sets of matching atoms, and eliminates matching the same atoms in a different order.
  • allowRelativeStereo (bool) - Allows a given configuration of chirality specified to match a structure with all the chiralities flipped.
  • rigourousValidationOfSource (bool) - This option validates that the stereochemical labels are correct for the structure before evaluating the SMARTS pattern containing stereo information.
  • hydrogensInterchangeable (bool) - If true, given only 1 atom mapping for a structure that differs only in hydrogens.
Returns: list
Each value is a list of atom indices matching the SMARTS pattern.

evaluate_multiple_smarts(structure, smarts_list, verbose=False, first_match_only=False, unique_sets=False)

 

Search for multiple SMARTS substructures in Structure structure.

Return a list of lists of ints. Each list of ints is a list of atom indices matching a SMARTS pattern. The multiple SMARTS patterns are combined into one list.

Parameters:
  • structure (Structure) - Structure to search for matching substructures.
  • smarts_list (list) - List of SMARTS patterns to look for.
  • verbose (bool) - If True, print additional progress reports from the C implementation.
  • first_match_only (bool) - If False, return all matches for a given starting atom - e.g. [1, 2, 3, 4, 5, 6] and [1, 6, 5, 4, 3, 2] from atom 1 of benzene with the smarts_expression 'c1ccccc1'. If True, return only the first match found for a given starting atom. Note that setting first_match_only to True does not affect matches with different starting atoms - i.e. benzene will still return six lists of ints for 'c1ccccc1', one for each starting atom. To match only once per set of atoms, use unique_sets=True. Note also that setting first_match_only to True does not guarantee that all matching atoms will be found.
  • unique_sets (bool) - If True, the returned list of matches will contain a single (arbitrary) match for any given set of atoms. If False, return the uniquely ordered matches, subject to the behavior specified by the first_match_only parameter.
Returns: list
Each value is a list of atom indices matching the SMARTS patterns.

evaluate_substructure(st, subs_expression, first_match_only=False)

 

Search for the MacroModel-style substructure expression in Structure st and return the atoms that match. For each match a list of atom indices is returned.

Parameters:
  • st (Structure) - Structure to search for matching substructures.
  • subs_expression (str) - MacroModel-style substructure expression to use for the search.
  • first_match_only (bool) - If True, return only the first match found.
Returns: list
List of atom indices match the substructure expression.

generate_asl(st, atom_list)

 

Generate and return an atom expression for the atoms in Structure st which are listed in atom_list. The ASL expression will be as compact as possible using mol, res and atom expressions where appropriate.

Parameters:
  • st (Structure) - Structure holding the ASL atoms.
  • atom_list (list) - List of indices of atoms for which ASL is desired.
Returns: str
ASL compactly describing the atoms in atom_list.

validate_asl(asl)

 

Validate the given ASL expression. This is useful for validating an ASL when a structure object is not available - for example when validating a command line option. NOTE: A warning is also printed to stdout if the ASL is not valid.

Parameters:
  • asl (str) - ASL expression.
Returns: bool
True if ASL is valid, False otherwise.

evaluate_asl(st, asl_expr)

 

Search for substructures matching the ASL (Atom Specification Language) string asl_expr in Structure st.

Parameters:
  • st (Structure) - Structure to search for matching substructures.
  • asl_expr (str) - ASL search string.
Returns: list
List containing indices of matching atoms.
Raises:

get_atoms_from_asl(st, asl_expr)

 

Return atoms matching the ASL string asl_expr in Structure st.

Parameters:
  • st (Structure) - Structure to search for matching substructures.
  • asl_expr (str) - ASL search string.
Returns: generator
Generator of matching StructureAtom objects.
Raises:

find_rings(st, sort=False)

 

Return the smallest set of smallest rings (SSSR) in st.

See also the schrodinger.structure.Structure.find_rings method and the schrodinger.structure.Structure.ring iterator. This method may be deprecated at some point in favor of those methods.

The return value is a list of lists of ints. Each list of ints corresponds to a ring, and the integer values are the atom indices.

Parameters:
  • st (Structure) - Structure holding rings.
  • sort (bool) - If True, sort the atoms in each ring by connectivity so that the atoms that are bonded appear next to each other in the list.
Returns: list
Each value is a list corresponding to the atom indices of a ring.

hydrogens_present(st)

 

Return True if all hydrogens are present in Structure st, False otherwise.

Since all modern force fields require hydrogens, this is a good check to make sure that a structure is ready for force field calculations. This function is implemented by checking to see if the structure can be used as-is in a calculation with OPLS2003.

Parameters:
Returns: bool
Are all hydrogens are present?

Warning: Requires atom types to be correct. Consider calling {Structure.retype} first.

generate_smiles(st, unique=True, stereo='annotation_and_geom')

 

Return a SMILES string for st.

For more options, see the schrodinger.structutils.smiles.SmilesGenerator class.

Parameters:
  • st (Structure) - Structure for which SMILES string is desired.
  • unique (bool) - If True, generate unique (canonical) SMILES.
  • stereo (str constant) - Specify the source of stereochemical information. The value should be one of the following module level constants:
    • STEREO_FROM_ANNOTATION_AND_GEOM - Derive stereochemistry from pre-existing mmstereo properties, but use the 3D coordinates when no annotation is present.
    • STEREO_FROM_ANNOTATION - Derive stereochemistry from pre-existing mmstereo properties. (This is faster than using geometry, and is useful when structures are known to be 2D).
    • STEREO_FROM_GEOMETRY - Derive stereochemistry from the 3D geometry only. (Slower, but robust to structural changes in the molecule.)
    • NO_STEREO - Don't include stereochemistry.

    (default: STEREO_FROM_ANNOTATION_AND_GEOM)

Returns: str
SMILES string representing st.

generate_smarts(st, atom_subset=None, check_connectivity=True)

 

Deprecated: Use generate_smarts_canvas instead.

generate_smarts_canvas(st, atom_subset=None, check_connectivity=True, include_hydrogens=False, honor_maestro_prefs=False)

 

Return a SMARTS pattern for atoms atom_subset in Structure st. If no atom subset list is given then all atoms in st will be used. This function uses Canvas library to generate smarts.

Parameters:
  • st (Structure) - Structure containing atom_subset.
  • atom_subset (list) - A list of atom indices (or _StructureAtom objects) to generate the SMARTS pattern for. (default: all atoms)
  • check_connectivity (bool) - If True, check for whether the atoms given are connected and raise a ValueError if they are not. SMARTS generation will give bogus results for unconnected atoms.
  • include_hydrogens (bool) - Whether to always include hydrogens in the generated SMARTS pattern. By default, SMARTS patterns do not contain hydrogens, except for cases where they are needed to avoid ambiguity.
  • honor_maestro_prefs (bool) - Whether to honor the Maestro's SMARTS prefs. Valid only when running inside Maestro.
Returns: str
SMARTS string representing atom_subset.

match_hbond(atom1, atom2, distance_max=2.5, donor_angle=120.0, acceptor_angle=90.0, distance=None, measure=None)

 

Return True if atom1-atom2 represents an H-bond where either atom1 or atom2 is the acceptor heavy atom, and the other atom is the donor hydrogen.

To match as hydrogen bond,

  1. the atom1-atom2 distance must be less than or equal to 'distance_max',
  2. the N-H..X angle must be at least 'donor_angle', and
  3. the H..X-Y angle must be at least 'acceptor_angle'.

If the atom1-atom2 distance is already known it can be specified as 'distance', otherwise it will be calculated by this function.

Parameters:
  • atom1 (_StructureAtom) - First atom.
  • atom2 (_StructureAtom) - Second atom (either from the same or a different Structure.
  • distance_max (float) - Maximum accepted atom1-atom2 H-bond distance. (default: 2.5A)
  • donor_angle (float) - Minimum accepted N-H..X angle. (default: 120 degrees)
  • acceptor_angle (float) - Minimum accepted H..X-Y angle. (default: 90 degrees)
  • distance (float) - Distance between atom1 and atom2 (if known). If provided, match_bond forgoes calculating the distance.
  • measure (callable) - This should be a callable function or object that follows the same API as the measure function in this module. The purpose for allowing this is to deal with things like periodic boundary conditions.
Returns: bool
Does atom1-atom2 count as an H-bond under the criteria provided?

generate_crystal_mates(st, radius=10.0, space_group=None, a=None, b=None, c=None, alpha=None, beta=None, gamma=None, group_radius=14.0)

 

Generate crystal mates for the input Structure st.

Return a list of structures that represent the crystal mates. (Note that the first item in the list represents the identity transformation and as such will be identical to the input structure.)

All crystal mates within radius of the input structure are generated.

The crystal parameters can be specified as parameters to this function or can be standard PDB properties of the input structure. If the structure was read from a PDB file then these crystal properties will usually be present.

The group_radius is used in the crystal mates calculation to determine whether a symmetric element is in contact with the ASU. There should be little reason to change the default value of 14.0.

Parameters:
  • st (Structure) - Structure for which crystal mates will be generated.
  • radius (float) - Distance within which to generate crystal mates.
  • space_group (str) - Space group of the crystal. If None, uses st's s_pdb_PDB_CRYST1_Space_Group.
  • a (float) - Crystal 'a' length. If None, uses st's s_pdb_PDB_CRYST1_a.
  • b (float) - Crystal 'b' length. If None, uses st's s_pdb_PDB_CRYST1_b.
  • c (float) - Crystal 'c' length. If None, uses st's s_pdb_PDB_CRYST1_c.
  • alpha (float) - Crystal 'alpha' angle. If None, uses st's s_pdb_PDB_CRYST1_alpha.
  • beta (float) - Crystal 'beta' angle. If None, uses st's s_pdb_PDB_CRYST1_beta.
  • gamma (float) - Crystal 'gamma' angle. If None, uses st's s_pdb_PDB_CRYST1_gamma.
  • group_radius (float) - Used to determine whether a symmetric element is in contact with the ASU. There should be little reason to change the default value of 14.0.
Returns: list
list of Structure objects that represent the crystal mates. (Note that the first item in the list represents the identity transformation and as such will be identical to the input structure.)

find_overlapping_atoms(st, ignore_hydrogens=True, ignore_waters=True, dist_threshold=0.8)

 

Search the specified structure for overlapping atoms. Returns a list of (atom1index, atom2index) tuples.

Parameters:
  • st (Structure) - Structure to search for overlapping atoms
  • ignore_hydrogens - Whether to ignore hydrogens.
  • ignore_waters - Whether to ignore waters.
  • dist_threshold - Atoms are considered overlapping if their centers are within this distance of each other.
Returns: list
Each value is a tuple containing the indices of overlapping atoms.

generate_molecular_formula(st)

 

Return a string for the molecular formula in Hill notation for the st. The structure must contain only one molecule.

Parameters:
  • st (Structure) - Find the molecular formula for this structure. Must contain only one molecule.
Returns: str
The molecular formula for st.

_may_atom_be_part_of_rotatable_bond(atom)

 

Determine whether an atom might be in a rotatable bond.

Parameters:
  • atom (_StructureAtom) - Atom to test for presence of rotatable bond.
Returns: bool
Might the atom be in a rotatable bond?

_is_bond_ring_edge(bond, rings)

 

Determine whether a bond is a ring edge.

Parameters:
  • bond (_StructureBond) - Bond to test for presence at ring edges.
  • rings (list) - list of ring atom index lists.
Returns: bool
Is the bond a ring edge?

is_bond_rotatable(bond, rings=None)

 

Return True if specified bond is rotatable, False otherwise.

A bond is considered rotatable if all of the following are true...

  1. It is a single bond.
  2. It is not adjacent to a triple bond.
  3. It is not in a ring.
  4. Neither atom is a hydrogen or other terminal atom.
  5. Neither atom is a carbon or nitrogen with three hydrogens attached.
Parameters:
  • bond (structure.StructureBond) - bond to test for rotatability.
  • rings (list) - List of ring atom index lists. As an optimization, provide the (sorted) rings list from the find_rings function if you already have it. Otherwise, an SSSR calculation will be done.
Returns: bool
Is the bond rotatable?

rotatable_bonds_iterator(st, rings=None)

 

Return an iterator for rotatable bonds (atomnum1, atomnum2) in the structure.

See the is_bond_rotatable function description for which bonds are considered rotatable.

Parameters:
  • st (Structure) - The structure to search for rotatable bonds.
  • rings (list) - List of ring atom index lists. As an optimization, provide the (sorted) rings list from the find_rings function if you already have it. Otherwise, an SSSR calculation will be done.
Returns: iterator of tuples
yields tuples of atom index pairs describing a rotatable bond in st.

get_num_rotatable_bonds(st, rings=None)

 

Return the number of rotatable bonds in the Structure st. The count does not include trivial rotors such as terminal methyls, or rotors within rings.

Parameters:
  • st (Structure) - The structure to search for rotatable bonds.
  • rings (list of lists of ints) - As an optimization, provide the (sorted) rings list from the find_rings function if you already have it. Otherwise, an SSSR calculation will be done.
Returns: int
The number of rotatable bonds in st.

hbond_iterator(st, atoms=None)

 

Iterate over hydrogen bond between the atoms specified by the atom_set and the other atoms in st. Each yielded item is a tuple of (atom-index-1, atom-index-2).

NOTE: This function has been updated to simply act as a wrapper to hbond.get_hydrogen_bonds to ensure that hbonds are determined consistently.

Parameters:
  • st (Structure) - The structure to search for H-bonds.
  • atoms (list of int or None) - A list of atom indices (or _StructureAtom objects) to analyze. If not specified, then all H-bonds present in the structure are returned.
Returns: list of (int, int)
list of (donor atom index, acceptor atom index) for each hydrogen bond identified.

get_num_hbonds(st, atoms=None)

 

Calculate the the number of hydrogen bonds in st.

If atoms is specified, only consider interactions between atoms indexes in the list and atoms outside the list.

NOTE: This function is now simply a wrapper to the more flexible schrodinger.structutils.interactions.hbond.get_num_hbonds.

Parameters:
Returns: int
Number of H-bonds between atoms and other atoms in st.

find_equivalent_atoms(st, span_molecules=True)

 

Find atoms in the structure that are equivalent. For example, all three hydrogens on a methyl group are equivalent.

Returns a list, each value of which is a list of atoms that are equivalent.

Parameters:
  • st (Structure) - The structure to search for equivalent atoms.
  • span_molecules (bool) - If True, don't consider molecules to be separate entities. If False, constructs global equivalence classes for all atoms in a ct, but will never return an equivalence class across molecules.
Returns: list
Each value is a list of indices of equivalent atoms.

get_approximate_sasa(st, atom_indexes=None, cutoff=7.0)

 

Deprecated: This function only returns a rough approximation to the solvent accessible surface area. Please use the calculate_sasa function instead.

calculate_sasa_by_residue(st, atoms=None, cutoff=8.0, probe_radius=1.4, resolution=0.2, exclude_water=False)

 

Calculate the solvent-accessible surface area (SASA) for the whole structure, or an atom subset, and then group them by residue.

Parameters:
  • st (Structure) - Structure for which SASA is desired.
  • atoms (list) - List of atom indices or of _StructureAtom objects for the atoms to count. If None, calculates SASA for all atoms. (default: None)
  • cutoff (float) - Atoms within this distance of atoms will be considered for occlusion. Requires atoms to be specified. (default: 5.0A)
  • probe_radius (float) - Probe radius, in units of angstroms, of the solvent molecule. (default: 1.4A)
  • resolution (float) - Resolution to use. Decreasing this number will yield better results, increasing it will speed up the calculation. NOTE: This is NOT the same option as Maestro's surface resolution, which uses a different algorithm to calculate the surface area. (default: 0.2)
  • exclude_water (bool) - If set to True then explicitly exclude waters in the method. This option is only works when 'atoms' argument is passed. (default: False)
Returns: list
a list of solvent accessible surface area of the selected atoms within st.

calculate_sasa(st, atoms=None, cutoff=8.0, probe_radius=1.4, resolution=0.2, exclude_water=False, exclude_atoms=None)

 

Calculate the solvent-accessible surface area (SASA) for the whole structure, or an atom subset.

Parameters:
  • st (Structure) - Structure for which SASA is desired.
  • atoms (list) - List of atom indices or of _StructureAtom objects for the atoms to count. If None, calculates SASA for all atoms. (default: None)
  • cutoff (float) - Atoms within this distance of atoms will be considered for occlusion. Requires atoms to be specified. (default: 5.0A)
  • probe_radius (float) - Probe radius, in units of angstroms, of the solvent molecule. (default: 1.4A)
  • resolution (float) - Resolution to use. Decreasing this number will yield better results, increasing it will speed up the calculation. NOTE: This is NOT the same option as Maestro's surface resolution, which uses a different algorithm to calculate the surface area. (default: 0.2)
  • exclude_water (bool) - If set to True then explicitly exclude waters in the method. This option is only works when 'atoms' argument is passed. (default: False)
  • exclude_atoms (list) - aid of atoms that you don't want in SASA caluclation useful for FEP-type systems where a second 'image' of a molecules is present
Returns: float
The solvent accessible surface area of the selected atoms within st.

calculate_sasa_by_atom(st, cutoff=8.0, probe_radius=1.4, resolution=0.2)

 

Calculate the solvent-accessible surface area (SASA) for each atom in the given structure, and returns a list of floats.

Parameters:
  • st (Structure) - Structure for which SASA is desired.
  • cutoff (float) - Atoms within this distance of atoms will be considered for occlusion. Requires atoms to be specified. (default: 5.0A)
  • probe_radius (float) - Probe radius, in units of angstroms, of the solvent molecule. (default: 1.4A)
  • resolution (float) - Resolution to use. Decreasing this number will yield better results, increasing it will speed up the calculation. NOTE: This is NOT the same option as Maestro's surface resolution, which uses a different algorithm to calculate the surface area.
Returns: list
The solvent accessible surface area of each atom in st.

Warning: water and solvent atoms are currently NOT ignored when calculating SASA, so it's advisable to remove them from the structure before calling this function.

get_approximate_atomic_sasa(st, iat, cutoff=7.0, sasa_probe_radius=1.4, hard_sphere_s=2.5, scale_factor=2.32)

 

Deprecated: Deprecated in favor of calculate_sasa, which is more accurate.

find_ligands(st, **kwargs)

 

Simple function interface for AslLigandSearcher class.

Parameters:
Returns: list
a list of Ligand instances for putative ligands within st.

center_of_mass(st, atom_indices=None)

 

Get the x, y, z coordinates for the center of mass. This can be limited to a subset of atoms.

Parameters:
  • st (Structure) - The structure used for calculating COM.
  • atom_indices (List) - List of atom indices. Limit calculations to supplied atoms. If None, performs calculations on all atoms. (Default: None)
Returns: numpy array
x, y, and z coordinates for the center of mass
Raises:
  • ValueError - If the atom_indices is neither a list nor None. Also if an empty list is passed in.

calculate_principle_moments(struct=None, atoms=None, massless=False)

 

Calculate the principal moments of inertia for a list of atoms. This is calculated with respect to the x, y, and z coordinates of the atom's center of mass.

Parameters:
  • struct (Structure) - If given the moments will be calculated for the entire structure. This overrides any atoms given with the atoms keyword. Either atoms or structure must be given.
  • atoms (list) - list of schrodinger.structure._StructureAtom objects. Atom objects to compute the tensor for. Either atoms or structure must be given.
  • massless (bool) - True of the calculations should be independent of the atomic masses (all mass=1), False (default) if atomic mass should be used.
Returns: tuple
A tuple of (eigenvalues, eigenvectors) of the inertial tensor. The eigenvalues are the principle moments of inertia and are a list of length 3 floats. The eigenvectors are a list of lists, each inner list is a list of length 3 floats.

find_shortest_bond_path(struct, index1, index2)

 

Find the shortest path of bonded atoms that connects atom1 to atom2

The conversion of this routine to use networkx rather than scipy resulted in a dramatic reduction in both time and memory usage.

Parameters:
  • struct (schrodinger.structure.Structure) - The structure containing the atoms index1 and index2
  • index1 (int) - The index of the first atom in the path
  • index2 (int) - The index of the second atom in the path
Returns: list
A list of atoms that connect atom index1 to atom index2 along the shortest bond path. Index1 will be the first item in the list and index2 will be the last. The second item in the list will be bonded to index1, the third will be bonded to the second, etc. If index1 == index2, a single item list is returned: [index1]
Raises:
  • ValueError - if index1 and index2 are not part of the same molecule
  • MemoryError - if the system is too large

get_average_structure(sts)

 

Calculate the average structure between the given conformers.

Parameters:
Returns: structure.Structure
Average structure

find_common_substructure(sts, atomTyping=11)

 

Find the maximum substructure that is common between all specified CTs. NOTE: This function becomes exponentioally slow with larger number of structures. Recommened maximum around 30 structures.

Parameters:
  • sts (Iterable of structure.Structure objects) - Structures to average
  • atomTyping (int) - Atom typing scheme to use. For list of available schemes, see $SCHRODINGER/utilities/canvasMCS -h
Returns: List of int lists
Substructure atoms from each structure

find_common_substructures(sts, atomTyping=11)

 

Find the maximum common substructures for each pair of the given CTs. NOTE: This function becomes exponentioally slow with larger number of structures. Recommened maximum around 30 structures.

Parameters:
  • sts (Iterable of structure.Structure objects) - Structures to average
  • atomTyping (int) - Atom typing scheme to use. For list of available schemes, see $SCHRODINGER/utilities/canvasMCS -h
Returns: List of int lists
Substructure atoms from each structure

Variables Details [hide private]

_initializer

Value:
mminit.Initializer([mm.mmstereo_initialize, mm.mmpatty_initialize, mm.\
mmsubs_initialize, mm.mmasl_initialize, mm.mmhtreat_initialize, mm.mmc\
rystal_initialize, mm.mmsmiles_initialize], [mm.mmstereo_terminate, mm\
.mmpatty_terminate, mm.mmsubs_terminate, mm.mmasl_terminate, mm.mmhtre\
at_terminate, mm.mmcrystal_terminate, lambda: None])