schrodinger.structutils.sitealign module¶
Perform a pairwise superposition of multiple structures using the C-alpha atoms of selected residues.
- 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)¶
- getMobileStRMSD()¶
Gets the inplace and superimposed RMSDs for the mobile st
- property 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
- property 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 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 structuremobile_sts (list of
structures
) – List of structures to align to the referencebinding_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¶
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¶
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 withself.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 thelookups
that will be used to calculate the RMSDs. There will be noSiteMatchLookup
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 3matches
, A, B and C. The matrix calculation will loop over:A and B, then
A and C, then
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
- 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