Steric Clashes¶
The following function detects steric clashes in atomic structures. Two atoms are clashing if their euclidian distance is smaller than a threshold value (minus a tolerance offset).
- FilterClashes(entity, clashing_distances, always_remove_bb=False)¶
This function filters out residues with non-bonded clashing atoms. If the clashing atom is a backbone atom, the complete residue is removed from the structure, if the atom is part of the sidechain, only the sidechain atoms are removed. This behavior is changed by the always_remove_bb flag: when the flag is set to True the whole residue is removed even if a clash is just detected in the side-chain.
The function returns a view containing all elements (residues, atoms) that have not been removed from the input structure, plus a
ClashingInfo
object containing information about the detected clashes.Two atoms are defined as clashing if their distance is shorter than the reference distance minus a tolerance threshold. The information about the clashing distances and the tolerance thresholds for all possible pairs of atoms is passed to the function as a parameter.
Hydrogen and deuterium atoms are ignored by this function.
- Parameters:
entity (
EntityView
orEntityHandle
) – The input entityclashing_distances (
ClashingDistances
) – information about the clashing distancesalways_remove_bb (
bool
) – if set to True, the whole residue is removed even if the clash happens in the side-chain
- Returns:
A tuple of two elements: The filtered
EntityView
, and aClashingInfo
object
- CheckStereoChemistry(entity, bond_stats, angle_stats, bond_tolerance, angle_tolerance, always_remove_bb=False)¶
This function filters out residues with severe stereo-chemical violations. If the violation involves a backbone atom, the complete residue is removed from the structure, if it involves an atom that is part of the sidechain, only the sidechain is removed. This behavior is changed by the always_remove_bb flag: when the flag is set to True the whole residue is removed even if a violation is just detected in the side-chain.
The function returns a view containing all elements (residues, atoms) that have not been removed from the input structure, plus a
StereoChemistryInfo
object containing information about the detected stereo-chemical violations.A violation is defined as a bond length that lies outside of the range: [mean_length-std_dev*bond_tolerance, mean_length+std_dev*bond_tolerance] or an angle width outside of the range [mean_width-std_dev*angle_tolerance, mean_width+std_dev*angle_tolerance ]. The information about the mean lengths and widths and the corresponding standard deviations is passed to the function using two parameters.
Hydrogen and deuterium atoms are ignored by this function.
- Parameters:
entity (
EntityView
orEntityHandle
) – The input entitybond_stats (
StereoChemicalParams
) – statistics about bond lengthsangle_stats (
StereoChemicalParams
) – statistics about angle widthsbond_tolerance (
float
) – tolerance for bond lengths (in standard deviations)angle_tolerance (
float
) – tolerance for angle widths (in standard deviations)always_remove_bb (
bool
) – if set to True, the whole residue is removed even if the clash happens in the side-chain
- Returns:
A tuple of two elements: The filtered
EntityView
, and aStereoChemistryInfo
object
- class ClashingInfo¶
This object is returned by the
FilterClashes()
function, and contains information about the clashes detected by the function.- GetClashCount()¶
- Returns:
number of clashes between non-bonded atoms detected in the input structure
- GetAverageOffset()¶
- Returns:
a value in Angstroms representing the average offset by which clashing atoms lie closer than the minimum acceptable distance (which of course differs for each possible pair of elements)
- GetClashList()¶
- Returns:
list of detected inter-atomic clashes
- Return type:
list
ofClashEvent
- class ClashEvent¶
This object contains all the information relative to a single clash detected by the
FilterClashes()
function- GetModelDistance()¶
- Returns:
distance (in Angstroms) between the two clashing atoms as observed in the model
- GetAdjustedReferenceDistance()¶
- Returns:
minimum acceptable distance (in Angstroms) between the two atoms involved in the clash, as defined in
ClashingDistances
- class StereoChemistryInfo¶
This object is returned by the
CheckStereoChemistry()
function, and contains information about bond lengths and planar angle widths in the structure that diverge from the parameters tabulated by Engh and Huber in the International Tables of Crystallography. Only elements that diverge from the tabulated value by a minimumnumber of standard deviations (defined when the CheckStereoChemistry function is called) are reported.- GetBadBondCount()¶
- Returns:
number of bonds where a serious violation was detected
- GetBondCount()¶
- Returns:
total number of bonds in the structure checked by the CheckStereoChemistry function
- GetAvgZscoreBonds()¶
- Returns:
average z-score of all the bond lengths in the structure, computed using Engh and Huber’s mean and standard deviation values
- GetBadAngleCount()¶
- Returns:
number of planar angles where a serious violation was detected
- GetAngleCount()¶
- Returns:
total number of planar angles in the structure checked by the CheckStereoChemistry function
- GetAvgZscoreAngles()¶
- Returns:
average z-score of all the planar angle widths, computed using Engh and Huber’s mean and standard deviation values.
- GetBondViolationList()¶
- Returns:
list of bond length violations detected in the structure
- Return type:
list
ofStereoChemicalBondViolation
- GetAngleViolationList()¶
- Returns:
list of angle width violations detected in the structure
- Return type:
list
ofStereoChemicalAngleViolation
- class StereoChemicalBondViolation¶
This object contains all the information relative to a single detected violation of stereo-chemical parameters in a bond length
- GetFirstAtom()¶
- GetSecondAtom()¶
- Returns:
first / second atom of the bond
- Return type:
UniqueAtomIdentifier
- GetBondLength()¶
- Returns:
length of the bond (in Angstroms) as observed in the model
- GetAllowedRange()¶
- Returns:
allowed range of bond lengths (in Angstroms), according to Engh and Huber’s tabulated parameters and the tolerance threshold used when the
CheckStereoChemistry()
function was called- Return type:
tuple
(minimum and maximum)
- class StereoChemicalAngleViolation¶
This object contains all the information relative to a single detected violation of stereo-chemical parameters in a planar angle width
- GetFirstAtom()¶
- GetSecondAtom()¶
- GetThirdAtom()¶
- Returns:
first / second (vertex) / third atom that defines the planar angle
- Return type:
- GetAngleWidth()¶
- Returns:
width of the planar angle (in degrees) as observed in the model
- GetAllowedRange()¶
- Returns:
allowed range of angle widths (in degrees), according to Engh and Huber’s tabulated parameters and the tolerance threshold used when the
CheckStereoChemistry()
function was called- Return type:
tuple
(minimum and maximum)
- class ClashingDistances¶
Object containing information about clashing distances between non-bonded atoms
- ClashingDistances()¶
Creates an empty distance list
- SetClashingDistance(ele1, ele2, clash_distance, tolerance)¶
Adds or replaces an entry in the list
- Parameters:
ele1 – string containing the first element’s name
ele2 – string containing the second element’s name
clash_distance – minimum clashing distance (in Angstroms)
tolerance – tolerance threshold (in Angstroms)
- GetClashingDistance(ele1, ele2)¶
- Returns:
reference distance and a tolerance threshold (both in Angstroms) for two elements
- Return type:
tuple
(minimum clashing distance, tolerance threshold)- Parameters:
ele1 – string containing the first element’s name
ele2 – string containing the second element’s name
- GetAdjustedClashingDistance(ele1, ele2)¶
- Returns:
reference distance (in Angstroms) for two elements, already adjusted by the tolerance threshold
- Parameters:
ele1 – string containing the first element’s name
ele2 – string containing the second element’s name
- GetMaxAdjustedDistance()¶
- Returns:
longest clashing distance (in Angstroms) in the list, after adjustment with tolerance threshold
- IsEmpty()¶
- Returns:
True if the list is empty (i.e. in an invalid, useless state)
- PrintAllDistances()¶
Prints all distances in the list to standard output
- class StereoChemicalParams¶
Object containing stereo-chemical information about bonds and angles. For each item (bond or angle in a specific residue), stores the mean and standard deviation
- StereoChemicalParams()¶
Creates an empty parameter list
- SetParam(item, residue, mean, standard_dev)¶
Adds or replaces an entry in the list
- Parameters:
item – string defining a bond (format: X-Y) or an angle (format: X-Y-Z), where X,Y an Z are atom names
residue – string containing the residue type for this entry
mean – mean bond length (in Angstroms) or angle width (in degrees)
standard_dev – standard deviation of the bond length (in Angstroms) or of the angle width (in degrees)
- IsEmpty()¶
- Returns:
True if the list is empty (i.e. in an invalid, useless state)
- PrintAllParameters()¶
Prints all entries in the list to standard output
- FillClashingDistances(file_content)¶
- FillBondStereoChemicalParams(file_content)¶
- FillAngleStereoChemicalParams(file_content)¶
These three functions fill a list of reference clashing distances, a list of stereo-chemical parameters for bonds and a list of stereo-chemical parameters for angles, respectively, starting from the content of a parameter file.
- Parameters:
file_content (
list
ofstr
) – list of lines from the parameter file- Return type:
ClashingDistances
orStereoChemicalParams
- FillClashingDistancesFromFile(filename)¶
- FillBondStereoChemicalParamsFromFile(filename)¶
- FillAngleStereoChemicalParamsFromFile(filename)¶
These three functions fill a list of reference clashing distances, a list of stereo-chemical parameters for bonds and a list of stereo-chemical parameters for angles, respectively, starting from a file path.
- Parameters:
filename (
str
) – path to parameter file- Return type:
ClashingDistances
orStereoChemicalParams
- DefaultClashingDistances()¶
- DefaultBondStereoChemicalParams()¶
- DefaultAngleStereoChemicalParams()¶
These three functions fill a list of reference clashing distances, a list of stereo-chemical parameters for bonds and a list of stereo-chemical parameters for angles, respectively, using the default parameter files distributed with OpenStructure.
- Return type:
ClashingDistances
orStereoChemicalParams