schrodinger.structutils.sitealign module

Perform a pairwise superposition of multiple structures using the C-alpha atoms of selected residues.

schrodinger.structutils.sitealign.get_ligand_asl(cutoff=5.0, molnum=None, fillres=True)

Returns an ASL expression defining binding site atoms based on the ligand molecule number and cutoff distance. This ASL specifically identifies the C-alpha atoms.

Parameters:
  • cutoff (float) – Cutoff from ligand used to asign binding site atoms
  • molnum (int) – The molecule number fo the ligand. If None the ligand will be automatically detected.
  • fillres (bool) – Use all atoms in a residue if any atom is found
Returns:

ASL expression for binding site atoms

Return type:

str

schrodinger.structutils.sitealign.get_residue_asl(residues)

Returns an ASL expression defining binding site atoms based on the residue strings passed in. This ASL specifically identifies the C-alpha atoms.

Parameters:residues (list of residue strings (<chain>:<resnum>)) – Residues used to define binding site atoms
Returns:ASL expression for binding site atoms
Return type:str
class schrodinger.structutils.sitealign.SiteMatchLookup(ref_st, mobile_st, atom_map)

Bases: object

Lookup for any reference and mobile structures that have matching binding site atoms. This stores a reference structure and a mobile structure, along with their mapped C-alpha atoms.

The reason the terms reference and mobile are used is because when superimposing 2 structures for RMSD calculations the “reference” structure will always be the stationary structure by default. The “mobile” structure will have it’s coordinates changed to get an iteratively lower RMSD.

SUPERIMPOSED_PROPERTY = 'r_sitealign_Superimposed_RMSD'
INPLACE_PROPERTY = 'r_sitealign_In_Place_RMSD'
__init__(ref_st, mobile_st, atom_map)
Parameters:
  • ref_st (structure) – Reference structure
  • mobile_st (structure) – Mobile structure
  • atom_map (dict where keys are ref atom indices and values are the mobile atom indices that overlap the ref indices.) – Reference and mobile binding site atom map
getMobileStRMSD()

Gets the inplace and superimposed RMSDs for the mobile st

ref_keys

Getter for reference keys. The key is a list of residue strings defining the residues belonging to the reference structure.

Returns:List of residue strings defining residues in reference structure
Return type:list
mob_keys

Getter for mobile keys. The key is a list of residue strings defining the residues belonging to the mobile structure. If the matching mobile key is None, an empty string is appended.

Returns:List of residue strings defining residues in mobile structure
Return type:list
getMatchingAtomMap()
getSuperimposedRMSD()

Superimpose mobile structure to reference structure. This will translate the mobile structure to the reference structure.

Returns:The RMSD after superimposing
Return type:float
getInPlaceRMSD(**kwargs)

Get the in-place RMSD of the reference structure to the mobile structure. No translation happens.

Returns:The in-place RMSD
Return type:float
See:rmsd.calculate_in_place_rmsd for available kwargs
colorByRMSD()

Color the reference and mobile structure by per-residue, backbone atom RMSD. This will change:

  • Style of all non-het atoms in mobile structure to “element”

  • Color of all non-het carbons in mobile structure to “user12”

  • Style of mobile backbone atoms to ball and stick

  • Color of mobile residues by red-blue scale depending on per-reside RMSD

    • blue for RMSD below 0.1
    • red for RMSD above 3.4
__class__

alias of builtins.type

__delattr__

Implement delattr(self, name).

__dict__ = mappingproxy({'__module__': 'schrodinger.structutils.sitealign', '__doc__': '\n Lookup for any reference and mobile structures that have matching\n binding site atoms. This stores a reference structure and a mobile\n structure, along with their mapped C-alpha atoms.\n\n The reason the terms reference and mobile are used is because when\n superimposing 2 structures for RMSD calculations the "reference" structure\n will always be the stationary structure by default. The "mobile" structure\n will have it\'s coordinates changed to get an iteratively lower RMSD.\n\n ', 'SUPERIMPOSED_PROPERTY': 'r_sitealign_Superimposed_RMSD', 'INPLACE_PROPERTY': 'r_sitealign_In_Place_RMSD', '__init__': <function SiteMatchLookup.__init__>, 'getMobileStRMSD': <function SiteMatchLookup.getMobileStRMSD>, '_setSuperimposedRMSD': <function SiteMatchLookup._setSuperimposedRMSD>, '_setInPlaceRMSD': <function SiteMatchLookup._setInPlaceRMSD>, 'ref_keys': <property object>, 'mob_keys': <property object>, 'getMatchingAtomMap': <function SiteMatchLookup.getMatchingAtomMap>, 'getSuperimposedRMSD': <function SiteMatchLookup.getSuperimposedRMSD>, 'getInPlaceRMSD': <function SiteMatchLookup.getInPlaceRMSD>, 'colorByRMSD': <function SiteMatchLookup.colorByRMSD>, '__dict__': <attribute '__dict__' of 'SiteMatchLookup' objects>, '__weakref__': <attribute '__weakref__' of 'SiteMatchLookup' objects>})
__dir__() → list

default dir() implementation

__eq__

Return self==value.

__format__()

default object formatter

__ge__

Return self>=value.

__getattribute__

Return getattr(self, name).

__gt__

Return self>value.

__hash__

Return hash(self).

__init_subclass__()

This method is called when a class is subclassed.

The default implementation does nothing. It may be overridden to extend subclasses.

__le__

Return self<=value.

__lt__

Return self<value.

__module__ = 'schrodinger.structutils.sitealign'
__ne__

Return self!=value.

__new__()

Create and return a new object. See help(type) for accurate signature.

__reduce__()

helper for pickle

__reduce_ex__()

helper for pickle

__repr__

Return repr(self).

__setattr__

Implement setattr(self, name, value).

__sizeof__() → int

size of object in memory, in bytes

__str__

Return str(self).

__subclasshook__()

Abstract classes can override this to customize issubclass().

This is invoked early on by abc.ABCMeta.__subclasscheck__(). It should return True, False or NotImplemented. If it returns NotImplemented, the normal algorithm is used. Otherwise, it overrides the normal algorithm (and the outcome is cached).

__weakref__

list of weak references to the object (if defined)

class schrodinger.structutils.sitealign.BindingSiteAligner(ref_st, mobile_sts, binding_site_asl, ignore_dist=5.0)

Bases: object

Align structures by matching binding site atoms.

__init__(ref_st, mobile_sts, binding_site_asl, ignore_dist=5.0)
Parameters:
  • ref_st (schrodinger.structure.Structure) – The reference structure
  • mobile_sts (list of structures) – List of structures to align to the reference
  • binding_site_asl (str) – The asl used to define the binding site atoms
  • ignore_dist (float) – Minimum dist needed for atoms to match each other in reference struct and mobile structs
site_matches = None

List of each match found between the reference structure and each mobile structure. These contain the reference structure and a mobile structure sharing at least 3 C-alpha binding site atoms.

matrix_matches = None

List of each match found between mobile structures. These contain the pair of mobile structures that share at least 3 C-alpha binding site atoms with each other and with self.reference.

setBindingSiteAtoms(asl=None)

Sets the binding site atoms to the asl provided.

Parameters:asl (str) – The asl used to define the binding site atoms. If None self.asl will be used (from asl passed in in init).
Raises:RuntimeError – If the asl does not return at least 3 atom indices
setSiteMatches()

Set the self.site_matches variable. This stores all the lookups that will be used to calculate the RMSDs. There will be no SiteMatchLookup created for mobiles sites that do not have at least 3 atoms matching the reference binding site atoms .

alignSites(inplace=False, color_by_rmsd=False)

Align all structures from self.site_matches. This will return the aligned mobile structures.

All mobile structures have a r_sitealign_inlpace_rmsd property added to them indicating the RMSD in-place of the reference and the mobile structure.

If inplace=False another property, r_sitealign_superimposed_rmsd is added to the mobile structure indicating the RMSD of the reference and mobile structure after they have been superimposed.

Parameters:
  • inplace (bool) – Whether to run RMSD calculations in-place or not
  • color_by_rmsd (bool) – Color the mobile atoms by RMSD. Can only be used if inplace is False
Returns:

The mobile structures (aligned if inplace=False)

Return type:

list(structures<schrodinger.structure.Structure)

calculateMatrix()

Generates an in-place RMSD matrix between all mobile structures in self.site_matches.

This method will go through all combinations of mobile structures in self.site_matches, in subsequences of two. It will then test for 3 common C-alpha atoms between the two mobile structures that have matches with the reference structure. Example: self.site_matches has 3 matches, A, B and C. The matrix calculation will loop over:

  1. A and B, then
  2. A and C, then
  3. B and C

Pairs of mobile structures that do not share 3 atoms with each other and with the reference will be skipped.

The in-place RMSD can be accessed in two ways. One way is to write the data out to a CSV-formatted file. This file contains a header and then each row will summarize teh RMSD calculated. This file can be written using the self.writeMatrixData() method. The second way to access the RMSD information is to get it from the returned lookups:

matrix_matches = aligner.calculateMatrix()
for match in matrix_matches:
    mobile_st1   = match.ref_st
    mobile_st2   = match.mobile_st
    inplace_rmsd = match.inplace_rmsd
Return type:list(SiteMatchLookup)
Returns:Lookups for each pair of mobile atoms sharing at least 3 atoms with each other and the reference
Raises:RuntimeError – If less than 2 mobile structures were aligned to reference
writeStructures(filename)

Write reference and mobile structures to a file. This will write the structures to a file based on their current state. If this is called right after initializing the class the structures will be unaltered. If this is called after sites are superimposed the structures written will be superimposed.

Parameters:filename (str) – File name to write structures to
getAlignedMobileStructures()

Returns a generator that iterates over the aligned mobile structures

__class__

alias of builtins.type

__delattr__

Implement delattr(self, name).

__dict__ = mappingproxy({'__module__': 'schrodinger.structutils.sitealign', '__doc__': '\n Align structures by matching binding site atoms.\n\n ', '__init__': <function BindingSiteAligner.__init__>, 'setBindingSiteAtoms': <function BindingSiteAligner.setBindingSiteAtoms>, 'setSiteMatches': <function BindingSiteAligner.setSiteMatches>, 'alignSites': <function BindingSiteAligner.alignSites>, 'calculateMatrix': <function BindingSiteAligner.calculateMatrix>, 'writeStructures': <function BindingSiteAligner.writeStructures>, 'getAlignedMobileStructures': <function BindingSiteAligner.getAlignedMobileStructures>, '_writeCSVData': <function BindingSiteAligner._writeCSVData>, 'writeAlignData': <function BindingSiteAligner.writeAlignData>, 'writeMatrixData': <function BindingSiteAligner.writeMatrixData>, '__dict__': <attribute '__dict__' of 'BindingSiteAligner' objects>, '__weakref__': <attribute '__weakref__' of 'BindingSiteAligner' objects>})
__dir__() → list

default dir() implementation

__eq__

Return self==value.

__format__()

default object formatter

__ge__

Return self>=value.

__getattribute__

Return getattr(self, name).

__gt__

Return self>value.

__hash__

Return hash(self).

__init_subclass__()

This method is called when a class is subclassed.

The default implementation does nothing. It may be overridden to extend subclasses.

__le__

Return self<=value.

__lt__

Return self<value.

__module__ = 'schrodinger.structutils.sitealign'
__ne__

Return self!=value.

__new__()

Create and return a new object. See help(type) for accurate signature.

__reduce__()

helper for pickle

__reduce_ex__()

helper for pickle

__repr__

Return repr(self).

__setattr__

Implement setattr(self, name, value).

__sizeof__() → int

size of object in memory, in bytes

__str__

Return str(self).

__subclasshook__()

Abstract classes can override this to customize issubclass().

This is invoked early on by abc.ABCMeta.__subclasscheck__(). It should return True, False or NotImplemented. If it returns NotImplemented, the normal algorithm is used. Otherwise, it overrides the normal algorithm (and the outcome is cached).

__weakref__

list of weak references to the object (if defined)

writeAlignData(filename)

Write out all RMSD data for mobile structures aligned to the reference structure.

Parameters:filename (str) – File name to write csv data to
writeMatrixData(filename)

Write out all RMSD data for mobile structures aligned to other mobile structures.

Parameters:filename (str) – File name to write csv data to