schrodinger.protein.analysis module

A class for diagnosing and reporting common structural problems of protein complexes.

Usage:

instance = Report(ct) instance.write_to_stdout()

Copyright Schrodinger, LLC. All rights reserved.

class schrodinger.protein.analysis.BaseDataPoint(descriptor: str = '', atoms: list = <factory>)

Bases: object

Base class for all typed data points with type-safe attribute access.

Provides type-safe attributes (e.g., point.distance, point.deviation) instead of fragile index-based access. Point classes are pure data containers - presentation logic is handled by the dataset’s getValuesForPoint() method.

Uses @dataclass to reduce boilerplate and auto-generate __init__, __repr__, etc.

descriptor: str = ''
atoms: list
__init__(descriptor: str = '', atoms: list = <factory>) None
class schrodinger.protein.analysis.StericClashDataPoint(descriptor: str = '', atoms: list = <factory>, distance: float = 0.0, min_allowed: float = 0.0, delta: float = 0.0, is_crystal_mate_clash: bool = False)

Bases: BaseDataPoint

Steric clash with type-safe accessors.

distance: float = 0.0
min_allowed: float = 0.0
delta: float = 0.0
is_crystal_mate_clash: bool = False
__init__(descriptor: str = '', atoms: list = <factory>, distance: float = 0.0, min_allowed: float = 0.0, delta: float = 0.0, is_crystal_mate_clash: bool = False) None
class schrodinger.protein.analysis.BondLengthDataPoint(descriptor: str = '', atoms: list = <factory>, deviation: float = 0.0)

Bases: BaseDataPoint

Bond length deviation.

deviation: float = 0.0
__init__(descriptor: str = '', atoms: list = <factory>, deviation: float = 0.0) None
class schrodinger.protein.analysis.BondAngleDataPoint(descriptor: str = '', atoms: list = <factory>, deviation: float = 0.0)

Bases: BaseDataPoint

Bond angle deviation.

deviation: float = 0.0
__init__(descriptor: str = '', atoms: list = <factory>, deviation: float = 0.0) None
class schrodinger.protein.analysis.BackboneDihedralDataPoint(descriptor: str = '', atoms: list = <factory>, phi: object = '-', psi: object = '-', gfactor: object = '-')

Bases: BaseDataPoint

Backbone phi/psi dihedrals with G-factor.

Note: phi/psi/gfactor can be float or “-” string if undefined.

phi: object = '-'
psi: object = '-'
gfactor: object = '-'
property is_disallowed

Type-safe check for disallowed region.

__init__(descriptor: str = '', atoms: list = <factory>, phi: object = '-', psi: object = '-', gfactor: object = '-') None
class schrodinger.protein.analysis.SidechainDihedralDataPoint(descriptor: str = '', atoms: list = <factory>, chi1: object = '-', chi2: object = '-', gfactor: object = '-')

Bases: BaseDataPoint

Sidechain chi1/chi2 dihedrals with G-factor.

Note: chi1/chi2/gfactor can be float or “-” string if undefined.

chi1: object = '-'
chi2: object = '-'
gfactor: object = '-'
property is_disallowed
__init__(descriptor: str = '', atoms: list = <factory>, chi1: object = '-', chi2: object = '-', gfactor: object = '-') None
class schrodinger.protein.analysis.GfactorSummaryDataPoint(descriptor: str = '', atoms: list = <factory>, backbone: object = '-', sidechain: object = '-', total: object = '-')

Bases: BaseDataPoint

G-factor summary (backbone + sidechain + total).

Note: Values can be float or “-” string if undefined.

backbone: object = '-'
sidechain: object = '-'
total: object = '-'
__init__(descriptor: str = '', atoms: list = <factory>, backbone: object = '-', sidechain: object = '-', total: object = '-') None
class schrodinger.protein.analysis.BfactorDataPoint(descriptor: str = '', atoms: list = <factory>, backbone: float = 0.0, bb_stddev: float = 0.0, sidechain: float = 0.0, sc_stddev: float = 0.0)

Bases: BaseDataPoint

B-factors with backbone and sidechain values.

backbone: float = 0.0
bb_stddev: float = 0.0
sidechain: float = 0.0
sc_stddev: float = 0.0
__init__(descriptor: str = '', atoms: list = <factory>, backbone: float = 0.0, bb_stddev: float = 0.0, sidechain: float = 0.0, sc_stddev: float = 0.0) None
class schrodinger.protein.analysis.GammaBfactorDataPoint(descriptor: str = '', atoms: list = <factory>, bfactor: float = 0.0)

Bases: BaseDataPoint

Gamma atom B-factor.

bfactor: float = 0.0
__init__(descriptor: str = '', atoms: list = <factory>, bfactor: float = 0.0) None
class schrodinger.protein.analysis.PeptidePlanarityDataPoint(descriptor: str = '', atoms: list = <factory>, dihedral_angle: float = 0.0)

Bases: BaseDataPoint

Peptide planarity dihedral angle.

dihedral_angle: float = 0.0
__init__(descriptor: str = '', atoms: list = <factory>, dihedral_angle: float = 0.0) None
class schrodinger.protein.analysis.SidechainPlanarityDataPoint(descriptor: str = '', atoms: list = <factory>, rmsd: float = 0.0)

Bases: BaseDataPoint

Sidechain planarity RMSD.

rmsd: float = 0.0
__init__(descriptor: str = '', atoms: list = <factory>, rmsd: float = 0.0) None
class schrodinger.protein.analysis.ImproperTorsionDataPoint(descriptor: str = '', atoms: list = <factory>, rms_deviation: object = '-')

Bases: BaseDataPoint

Improper torsion RMS deviation.

Note: rms_deviation can be float or “-” string if undefined.

rms_deviation: object = '-'
__init__(descriptor: str = '', atoms: list = <factory>, rms_deviation: object = '-') None
class schrodinger.protein.analysis.ChiralityDataPoint(descriptor: str = '', atoms: list = <factory>, chirality: str = '')

Bases: BaseDataPoint

C-alpha chirality (L or D).

chirality: str = ''
__init__(descriptor: str = '', atoms: list = <factory>, chirality: str = '') None
class schrodinger.protein.analysis.MissingAtomsDataPoint(descriptor: str = '', atoms: list = <factory>)

Bases: BaseDataPoint

Missing atoms (no values, just descriptor).

__init__(descriptor: str = '', atoms: list = <factory>) None
class schrodinger.protein.analysis.PrimexStericClashDataPoint(descriptor: str = '', atoms: list = <factory>, distance: float = 0.0, min_allowed: float = 0.0, delta: float = 0.0, is_severe: bool = False)

Bases: BaseDataPoint

PrimeX steric clash (similar to StericClashDataPoint but for PrimeX).

Note: Uses ‘is_severe’ field to indicate severity instead of crystal mate indicator.

distance: float = 0.0
min_allowed: float = 0.0
delta: float = 0.0
is_severe: bool = False
__init__(descriptor: str = '', atoms: list = <factory>, distance: float = 0.0, min_allowed: float = 0.0, delta: float = 0.0, is_severe: bool = False) None
class schrodinger.protein.analysis.Report(ct, sets_to_run=None)

Bases: object

A class to calculate properties of proteins.

To use this class in a script to compute a set of data:

reporter = Report(struct, [Report.sidechain_dihedral_data_set, Report.gamma_Bfactor_data_set])
dihedrals = reporter.get_set(Report.sidechain_dihedral_data_set)
for point in dihedrals.points:
    resnum = point.descriptor.split()[1]
    resid = point.descriptor.split(':')[0] + ':' + resnum
    for val in dihedrals.getValuesForPoint(point):
        try:
            true_value = float(val)
        except ValueError:
            # Some angles will have '-' if they aren't defined for
            # this residue type
            continue
        do_something_with_chi_angle(true_value)
__init__(ct, sets_to_run=None)

Create a Report instance.

Parameters:
  • ct (Structure) – The structure this Report operates on

  • sets_to_run (list) – Either ALL (default) or one or more dataset classes.

class BaseDataSet

Bases: object

Base class for all data sets.

Variables:
  • label (str) – the name of this data set

  • title (str) – the name of this data set when printing out the data

  • fields (list[str]) – first item is the name of the BaseDataPoint descriptor property, remaining items are the names of the items in the BaseDataPoint values property

  • points (list(BaseDataPoint)) – list of BaseDataPoint subclass objects

  • summary (str) – overall summary of the data set for the entire protein

  • bad_points (list(BaseDataPoint)) – a subset of problematic points for filtering in table and bubble plot

  • count (int) – the number of violations, in most cases the length of data_points, but for ‘global’ or non-residue specific properties it may be just 0 (for no issues) or 1 (e.g., X-Ray check)

  • score (float) – raw quality score, which has higher priority

  • bubble_scale (float) – normalized scale

  • color (str) – bubble color used as a pylab color argument

  • area (float) – bubble area

__init__()
property title

Return title from class-level (read-only).

property tooltip

Return tooltip from class-level (read-only).

property fields

Return fields from class-level (read-only).

property summary

Return static summary if defined, otherwise computed or N/A.

add_point(descriptor='', atoms=[], **kwargs)

Add a new point to the points property.

Creates a typed point using _POINT_CLASS by passing keyword arguments directly to the constructor.

Parameters:
  • descriptor (str) – Label for this point

  • atoms (list) – Atom indices involved in this point

  • kwargs – Point-specific attributes (e.g., distance, deviation, etc.) that match the _POINT_CLASS constructor signature

report_data_points()

Return all data points for this set in a list

Return type:

list

Returns:

list of data for each point in self.points, each item is a list whose first item is the point.descriptor and remaining items are from getValuesForPoint().

getValuesForPoint(point)

Get the display values for a point.

Returns the values that should be displayed/serialized for this point. Default implementation uses dataclass introspection to extract field values (excluding descriptor and atoms). Subclasses can override this to customize how point data is presented (e.g., adding computed fields, formatting, etc.).

Parameters:

point (BaseDataPoint) – The point to get values from

Return type:

list

Returns:

List of values to display/serialize (floats, strings, etc.)

analyze(parent)

Must be subclassed, this implementation does nothing

Parameters:

parent (Report object) – The Report object that this is for

report()

Must be subclassed, this implementation does nothing

showPointWhenFiltering(point)
class steric_clash_data_set(*args, **kwargs)

Bases: BaseDataSet

Class to compute and hold data for Steric Clashes.

Data point descriptor is atoms involved, values are “Distance”, “Min Allowed”, “Delta”.

Summary is N/A

See parent class BaseDataSet for additional documentation

__init__(*args, **kwargs)
within_three_bonds(protein, iatom, target_atom)

Method to determine whether two atoms are within three bonds of each other.

Parameters:
  • parent – The Report object that this is for

  • iatom (int) – atom number of first atom

  • target_atom (int) – atom number of the second atom

Return type:

bool

Returns:

True if atoms are within 3 bonds of each other, False if not

analyze(parent)

compute and store the data for this class

Parameters:

parent (l{report} object) – the report object that this is for

run_analysis(protein)

Iterate over the atom pairs and check record clashes :param protein: the protein :type protein: Report.local_protein

analyze_pair(protein, atom1, atom2)

Test a pair of atoms and record data if they clash. Order does not matter. :param protein: The protein :type protein: Report.local_protein :param atom1: One atom of the pair :type atom1: Report.local_atom :param atom2: The second atom of the pair :type atom2: Report.local_atom

check_hbond(protein, atom1, atom2, clash=None, distance=None, require_hydrogen=True)

Test and atom pair to see if they can be considered a hydrogen bond. The presence of a H-bond makes permissible atom proximity that would normally be considered a clash. Atom order does not matter.

Parameters:
  • protein (local_protein) – The protein

  • atom1 (local_atom) – atom 1

  • atom2 (local_atom) – atom 2

  • clash (float or None) – Pre-computed clash ratio

  • distance (float or None) – Pre-computed distance

  • require_hydrogen (bool) – Whether an intervening hydrogen must be found to qualify as an H-bond.

find_hbond_hydrogen(protein, donor, acceptor, distance=None)

Locate a hydrogen that is bound to the donor that is closer to the acceptor than the donor is. :param protein: the protein :type protein: Report.local_protein :param donor: donor atom :type donor: Report.local_atom :param acceptor: acceptor atom :type acceptor: Report.local_atom :param distance: pre-computed distance between donor and acceptor :type distance: float or None

showPointWhenFiltering(point)

Determine if a steric clash should be shown when filtering is enabled.

Parameters:

point (StericClashDataPoint) – The data point representing a clash

Returns:

True if the row should be shown (non-crystal-mate clash), False if it should be hidden (crystal mate clash)

Return type:

bool

getValuesForPoint(point)

Get values including computed xtal_indicator for StericClashDataPoint.

class primex_steric_clash_data_set(*args, **kwargs)

Bases: steric_clash_data_set

A subclass of steric_clash_data_set that computes clashes using a different set of criteria used by PrimeX Polish.

__init__(*args, **kwargs)
analyze(parent)

compute and store the data for this class

Parameters:

parent (l{report} object) – the report object that this is for

check_hbond(protein, atom1, atom2, clash=None, distance=None)

Runs a number of quick checks first before calling the super class’ method. See the super class for more information.

analyze_pair(protein, atom1, atom2)

Test a pair of atoms and record data if they clash (PrimeX version). Creates PrimexStericClashDataPoint with is_severe flag.

getValuesForPoint(point)

Get values including computed severe string for PrimexStericClashDataPoint.

class bond_length_data_set

Bases: BaseDataSet

Class to compute and hold data for Bond Length Deviations

Data point descriptor is atoms involved, values are “Deviation”

Summary is the RMS the deviations.

See parent class BaseDataSet for additional documentation

analyze(parent)

compute and store the data for this class

Parameters:

parent (report object) – the report object that this is for

showPointWhenFiltering(point)

Whether to show this row even if ‘Filter by threshold’ is checked.

class bond_angle_data_set

Bases: BaseDataSet

Class to compute and hold data for Bond Angle Deviations

Data point descriptor is atoms involved, values are “Deviation”

Summary is the RMS of the deviations.

See parent class BaseDataSet for additional documentation

analyze(parent)

compute and store the data for this class

Parameters:

parent (report object) – the report object that this is for

showPointWhenFiltering(point)

Whether to show this row even if ‘Filter by threshold’ is checked.

class backbone_dihedral_data_set

Bases: BaseDataSet

Class to compute and hold data for Backbone Dihedrals

Data point descriptor is the residue involved, values are “Phi”, “Psi”, “G-Factor”

Summary is N/A

See parent class BaseDataSet for additional documentation

analyze(parent)

compute and store the data for this class

Parameters:

parent (report object) – the report object that this is for

showPointWhenFiltering(point)

Whether to show this row even if ‘Filter by threshold’ is checked.

class sidechain_dihedral_data_set

Bases: BaseDataSet

Class to compute and hold data for Sidechain Dihedrals

Data point descriptor is the residue involved, values are “Chi1”, “Chi2”, “G-Factor”

Summary is N/A

See parent class BaseDataSet for additional documentation

analyze(parent)

compute and store the data for this class

Parameters:

parent (report object) – the report object that this is for

showPointWhenFiltering(point)

Whether to show this row even if ‘Filter by threshold’ is checked.

class Gfactor_summary_data_set

Bases: BaseDataSet

Class to compute and hold data for G-factor summaries of the Backbone and Sidechain dihedrals.

Data point descriptor is the residue involved, values are “Backbone”, “Sidechain”, “Total”

Summary is N/A

See parent class BaseDataSet for additional documentation

analyze(parent)

compute and store the data for this class

Parameters:

parent (report object) – the report object that this is for

class Bfactor_data_set

Bases: BaseDataSet

Class to compute and hold data for B-Factors

Data point descriptor is the residue involved, values are “Backbone”, “BBStdDev”, “Sidechain”, “SCStdDev”

Summary is the average B-Factor for backbone and sidechain atoms

See parent class BaseDataSet for additional documentation

__init__()
property title

Return appropriate title based on mode.

analyze(parent)

compute and store the data for this class

Parameters:

parent (report object) – the report object that this is for

showPointWhenFiltering(point)

Whether to show this row even if ‘Filter by threshold’ is checked.

class gamma_Bfactor_data_set

Bases: BaseDataSet

Class to compute and hold data for B-Factors of sidechain gamma atoms

Data point descriptor is the residue involved, value is “B-Factor”

Summary is the average B-Factor for gamma atoms

See parent class BaseDataSet for additional documentation

analyze(parent)

compute and store the data for this class

Parameters:

parent (report object) – the report object that this is for

showPointWhenFiltering(point)

Whether to show this row even if ‘Filter by threshold’ is checked.

class peptide_planarity_data_set

Bases: BaseDataSet

Class to compute and hold data for Peptide Planarity

Data point descriptor is the atoms involved, value is “Dihedral Angle”

Summary is the average absolute planarity

See parent class BaseDataSet for additional documentation

MAX_PEPTIDE_BOND_LENGTH = 3.0
analyze(parent)

compute and store the data for this class

Parameters:

parent (report object) – the report object that this is for

showPointWhenFiltering(point)

Whether to show this row even if ‘Filter by threshold’ is checked.

class sidechain_planarity_data_set

Bases: BaseDataSet

Class to compute and hold RMS data for planarity of sidechains

Data point descriptor is the residue involved, value is “RMSD From Planarity”

Summary is the average RMSD deviation from planarity of sidechains

See parent class BaseDataSet for additional documentation

analyze(parent)

compute and store the data for this class

Parameters:

parent (report object) – the report object that this is for

showPointWhenFiltering(point)

Whether to show this row even if ‘Filter by threshold’ is checked.

class improper_torsion_data_set

Bases: BaseDataSet

Class to compute and hold RMS data for improper torsions

Data point descriptor is the residue involved, value is “RMS Deviation”

Summary is the average RMSD deviation for improper torsions

See parent class BaseDataSet for additional documentation

analyze(parent)

compute and store the data for this class

Parameters:

parent (report object) – the report object that this is for

showPointWhenFiltering(point)

Whether to show this row even if ‘Filter by threshold’ is checked.

class chirality_data_set

Bases: BaseDataSet

Class to compute and hold C-alpha chirality data

Data point descriptor is the residue involved, value is C-alpha “Chirality”

Summary is N/A

See parent class BaseDataSet for additional documentation

analyze(parent)

compute and store the data for this class

Parameters:

parent (report object) – the report object that this is for

class missing_atoms_data_set

Bases: BaseDataSet

Class to compute and hold information on missing atoms

Data point descriptor is the residue involved, value is nothing

Summary is N/A

See parent class BaseDataSet for additional documentation

analyze(parent)

compute and store the data for this class

Parameters:

parent (report object) – the report object that this is for

getValuesForPoint(point)

MissingAtomsDataPoint has no value fields, return empty list.

class local_atom

Bases: object

Private class used to store atom information locally for speed

__init__()
class local_residue

Bases: object

Private class used to store residue information locally for convenience

__init__()
get_backbone_indices()
get_sidechain_indices()
get_atom_indices()
class local_protein

Bases: object

Private class used to store protein information locally for convenience

__init__()
get_vdw_radius(atom, vdwr_mode=0)
setup_protein(ct)

An internal method used to set up the protein for Report calculations. This method should be considered a private method of the Report class and need not be explicitly called by the user/calling script.

Parameters:

ct (Structure) – The structure this method operates on

make_local_protein(ct, keep_hydrogens=False, vdwr_mode=0)
Parameters:
  • ct (Structure) – The structure this method operates on

  • keep_hydrogens (bool) – Whether to include hydrogens in the local protein

  • vdwr_mode (int) – which VDWR source should be used

get_residue_name(iatom, protein=None)

Create a residue name for the atom iatom.

Parameters:

iatom (int) – the atom index to build a residue name for

Return type:

str

Returns:

A residue name of the form: Chain:PDB_residue_codeResidue_numberInsertion_code where PDB_residue_code is a 4 character field and Residue_number is a 3 character field

get_set(dataset_class) BaseDataSet

Return a dataset instance by its class type.

Parameters:

dataset_class – The dataset class to look up (e.g. Report.steric_clash_data_set)

Raises:

ValueError – If no dataset of the given class exists in this report

write_to_stdout()

Write each of the computed sets of data to the terminal