schrodinger.application.desmond.packages.analysis module

Classes and functions for trajectory-based analysis

Copyright Schrodinger, LLC. All rights reserved.

class schrodinger.application.desmond.packages.analysis.Angle(msys_model, cms_model, xid0, xid1, xid2)

Bases: schrodinger.application.desmond.packages.analysis.GeomAnalyzerBase

Calculate the angle formed between three xids. Result is a scalar (angle in degrees) for each trajectory frame.

class schrodinger.application.desmond.packages.analysis.AxisDirector(axis)

Bases: schrodinger.application.desmond.packages.analysis.GeomAnalyzerBase

Basis vector of 3D axis

class schrodinger.application.desmond.packages.analysis.CenterOf(gids, weights=None, return_unwrapped_atompos=False)

Bases: schrodinger.application.desmond.packages.analysis.GeomAnalyzerBase

N.B.: The calculated center is an unwrapped coordinate.

schrodinger.application.desmond.packages.analysis.CenterOfMotion

alias of MassAvgVel

class schrodinger.application.desmond.packages.analysis.Centroid(msys_model, cms_model, asl=None, gids=None, return_unwrapped_atompos=False)

Bases: schrodinger.application.desmond.packages.analysis.CenterOf

Class for computing centroid under periodic boundary condition.

For each frame, the results will be the unwrapped centroid. If return_unwrapped_atompos is True, the results will be a 2-tuple: (unwrapped-centroid, [unwrapped-positions-of-involved-atoms]).

class schrodinger.application.desmond.packages.analysis.Coc(msys_model, cms_model, asl=None, gids=None, return_unwrapped_atompos=False)

Bases: schrodinger.application.desmond.packages.analysis.Com

Class for computing center of charge under periodic boundary condition. Pseudo atoms are included.

For each frame, the results will be the unwrapped-center-of-charge. If return_unwrapped_atompos is True, the results will be a 2-tuple: (unwrapped-center-of-charge, [unwrapped-positions-of-involved-atoms]).

class schrodinger.application.desmond.packages.analysis.Com(msys_model, cms_model, asl=None, gids=None, return_unwrapped_atompos=False)

Bases: schrodinger.application.desmond.packages.analysis.CenterOf

Class for computing averaged position weighted by atomic mass, under the periodic boundary condition.

Basic usage:
ana = Com(msys_model, cms_model, gids=[1, 23, 34, 5, 6]) results = analyze(tr, ana)

where tr is a trajectory, and results contain a list of unwrapped centers of mass as floats, one float for each frame. If return_unwrapped_atompos is True, results contain a list of 2-tuples: (unwrapped-center-of-mass, [unwrapped-positions-of-involved-atoms]), and each 2-tuple in the list corresponds to a trajectory frame.

class schrodinger.application.desmond.packages.analysis.CustomMaestroAnalysis(msys_model, cms_model, func)

Bases: schrodinger.application.desmond.packages.analysis._MaestroAnalysis

Compute the result of a custom function on centered models. Under the hood, this custom function serves as cid for _CustomCalc. The same key of _MaestroAnalysis is used and the value is the function return.

One example is ASL selections. In this case, each ASL is wrapped in a function, which is used to initialize the CustomMaestroAnalysis instance, see _prot_near_ion as an example. Return values are the selected AIDs, centered frame and centered CMS model.

class schrodinger.application.desmond.packages.analysis.Dipole(msys_model, cms_model, aids)

Bases: schrodinger.application.desmond.packages.analysis._CompositeAnalyzer

Electric dipole moment of the selected atoms, in unit of debye.

The result may not be reliable when the structure of the selected atoms are large compared to the simulation box. The unwrapping with respect to periodic boundary condition provided by CenterOf is based on circular mean and may not be adequate.

EA2DEBYE = 4.802813198
class schrodinger.application.desmond.packages.analysis.DipoleDirector(msys_model, cms_model, asl)

Bases: schrodinger.application.desmond.packages.analysis.SystemDipoleDirector

Dipole direction for each molecule in the selection

class schrodinger.application.desmond.packages.analysis.Distance(msys_model, cms_model, xid0, xid1)

Bases: schrodinger.application.desmond.packages.analysis.GeomAnalyzerBase

Calculate the distance between two xids. Result is a scalar (distance in Angstroms) for each trajectory frame.

class schrodinger.application.desmond.packages.analysis.GeomAnalyzerBase

Bases: object

Base class of all geometry analyzer classes

All subclasses are expected to define two private methods:
  • _precalc - This private method will be called by a GeomCalc object to register

    wanted geometry calculations.

  • _postcalc - This private method will be called by a GeomCalc object to finish

    the particular analysis calculation. And the results should are saved in the self._result

In between the _precalc and _postcalc calls, the GeomCalc object will be called (outside the analyzer class) for the current frame to calculate all requested geometry calculation. Also see the docstring of the analyze function below.

class schrodinger.application.desmond.packages.analysis.GeomCalc

Bases: object

We use this class to batch the geometry calculations and avoid duplications. For example, you want to calculate the bond distance between atoms 1 and 2, and also an dihedral angle involving these two atoms. Both calculations require to calculate the vector between the mininum images of the two atoms, but we don’t want to do the calculation twice. With this class, we avoid such duplications.

All geometry calculations take into account the peridoic boundary condition.

Basic usage:

calc = GeomCalc()

# Loads geometry-calculation requests. calc.addVector(…) calc.addDistance(…) calc.addAngle(…) calc.addTorsion(…)

# Does calculations. calc(pbc, frame)

# Gets results. vec = calc.getVector(…) dis = calc.getDistance(…) ang = calc.getAngle(…) dih = calc.getTorsion(…)

addAnalyzer(analyzer)

Add a custom analyzer. :type analyzer: Duck type that must define the following interface:

  1. _precalc(self, calc)

where calc is a GeomCalc object. This method should call calc.addCustom to add an calculation item of a custom calculation type.

  1. _postcalc(self, calc, pbc, fr) where calc is a GeomCalc object, pbc is a Pbc object, and fr is a traj.Frame object. This method can get the calculation result by calling calc.getCustom and do further calculations as necessary to get the final analytic results.
addAngle(i_gid, j_gid, k_gid)

Add an angle calculation request.

The angle is defined by the two vectors: j==>i and j==>k.

addCustom(cid, key=None, default=None)

Add a custom calculation item.

Parameters:
  • cid (Any hashable object) – Specify the type of the calculation. The results of this type of calculation can be obtained by calling getCustom(c).
  • key (Any hashable object) – A particular calculation item of the type c. The result of this item can be obtained by this: getCustom(c)[key].
  • default – The default result of the calculation item key.
addDistance(i_gid, j_gid)

Add a distance calculation request.

addPosition(positer, num_pos)

Add extra position into the position array.

Parameters:
  • positer (Callable, will be called as: positer(pbc, fr), where pbc is a Pbc object, and fr is a traj.Frame object.) – Function (or callable object) to append new positions into the position array of the given frame.
  • num_pos (int, must be a nonnegative number.) – The number of new positions to be added by positer
Return type:

int

Returns:

The gid offset of the first new position that will be generated by this positer.

addTorsion(i_gid, j_gid, k_gid, l_gid)

Add a torsion calculation request.

The torsion is defined by the four position vectors:

i o o l
/
/

j o—–o k

In other words, it’s the dihedral angle between the two planes: i-j-k and j-k-l.

addVector(from_gid, to_gid)

Add a vector calculation request.

getAngle(i_gid, j_gid, k_gid)

Get the angle (in radians) between the two vectors: j==>i and j==>k.

getCustom(cid)

Return all results of the custom calculation type c :type cid: Any hashable object

getDistance(i_gid, j_gid)

Get the distance (in Angstroms) between the atoms: i_gid and j_gid.

getTorsion(i_gid, j_gid, k_gid, l_gid)

Get the torsion (in radians) as defined by the four atoms: i_gid, j_gid, k_gid, and l_gid. See the docstring of addTorsion for more detail.

getVector(from_gid, to_gid)

Get the vector between the atoms: from_gid and to_gid.

class schrodinger.application.desmond.packages.analysis.Gyradius(msys_model, cms_model, asl=None, gids=None)

Bases: schrodinger.application.desmond.packages.analysis._CompositeAnalyzer

Class for computing radius of gyration under periodic boundary condition.

For each frame, the result is the radius of gyration as float

class schrodinger.application.desmond.packages.analysis.HydrogenBondFinder(msys_model, cms_model, aids1, aids2, max_dist=2.8, min_donor_angle=120.0, min_acceptor_angle=90.0, max_acceptor_angle=180.0, honor_pbc=True)

Bases: schrodinger.application.desmond.packages.analysis._MaestroAnalysis

Find hydrogen bonds present between two sets of atoms. This class wraps around the get_hydrogen_bonds() function. The result is a list of tuples, where each tuple is a pair of `schrodinger.structure._StructureAtom`s, i.e., (acceptor, donor).

Basic usage:

ana = HydrogenBondFinder(msys_model, cms_model, aids1, aids2) results = analyze(tr, ana)
class schrodinger.application.desmond.packages.analysis.HydrophobicInter(msys_model, cms_model, prot_asl, lig_asl, contact_cutoff=6.0, hydrophobic_search_cutoff=3.2, hbond_cutoff=2.8)

Bases: schrodinger.application.desmond.packages.analysis._CompositeAnalyzer

Calculate hydrophobic interactions between protein and ligand, with hbonds and pi-pi interactions excluded.

Returns a list of dict. The length of this list is the number of frames. The dict key is ‘HydrophobicResult’, and the value is a list of _HydrophobicInter.Result, where ca_aid is the AID of alpha carbon, frag_idx is the index of ligand fragment. There are also keys of ‘PiPiResult’, ‘PiCatResult’, ‘HBondResult’ with ProtLigPiInter, ProtLigHbondInter results as values.

class schrodinger.application.desmond.packages.analysis.LigandRMSD(msys_model, cms_model, aids, ref_pos, fit_aids=None, fit_ref_pos=None)

Bases: schrodinger.application.desmond.packages.analysis.PosAlign

Ligand Root Mean Square Deviation from reference positions, with optional alignment fitting. Taking conformational symmetry into account.

class schrodinger.application.desmond.packages.analysis.LipidDirector(msys_model, cms_model, asl, tail_type)

Bases: schrodinger.application.desmond.packages.analysis._CompositeAnalyzer

Direction of CH bond for carbon atoms on lipid tail

class schrodinger.application.desmond.packages.analysis.MassAvgVel(msys_model, cms_model, asl=None, gids=None, return_unwrapped_atompos=False)

Bases: schrodinger.application.desmond.packages.analysis.Com

Class for computing mass-averaged velocity

For each frame, the result is numpy.ndarray of `float`s

class schrodinger.application.desmond.packages.analysis.MetalInter(msys_model, cms_model, prot_asl, lig_asl, contact_cutoff=6.0, metal_cutoff=3.4)

Bases: schrodinger.application.desmond.packages.analysis._CompositeAnalyzer

Interactions between metal elements and protein/ligand atoms.

Returns a list of dict. The length of this list is the number of frames. The dict key is ‘MetalResult’, and the value is a list of either _MetalInter.MetalP or _MetalInter.MetalL objects, where ion_aid, prot_aid and lig_aid are the AID of the ion atom, protein atom and ligand atom, ion_ele is the ion element string, distance is the distance between the ion atom and the protein/ligand atom.

MetalL

alias of _MetalL

MetalP

alias of _MetalP

class schrodinger.application.desmond.packages.analysis.MolecularSurfaceArea(msys_model, cms_model, asl, grid_spacing=None)

Bases: schrodinger.application.desmond.packages.analysis._MaestroAnalysis

Calculate the molecular surface area. The result is a single scalar number.

class schrodinger.application.desmond.packages.analysis.MomentOfInertia(msys_model, cms_model, aids)

Bases: schrodinger.application.desmond.packages.analysis._CompositeAnalyzer

Moment of inertia tensor

Result is 3x3 numpy.ndarray

class schrodinger.application.desmond.packages.analysis.MomentOfInertiaDirector(msys_model, cms_model, asl)

Bases: schrodinger.application.desmond.packages.analysis._CompositeAnalyzer

Direction of the principal moment of inertia for each molecule

class schrodinger.application.desmond.packages.analysis.OrderParameter(vec1, vec2, reducer)

Bases: schrodinger.application.desmond.packages.analysis.GeomAnalyzerBase

Given the director (local or global), and the descriptor (local or global), calculate the order parameter <P2> for each frame

S = 1/N sum_i ((3 * (n dot m_i)^2 -1) / 2)

Where n is the director vector and m is the descriptor vector. For example, n is the z axis and m is the electric dipole moment.

Typical usage includes
Director Descriptor result Axis Lipid avg over carbon type Axis Smarts avg over bond type Axis Dipole avg over molecule SystemDipole Dipole avg over molecule Dipole Smarts avg over bond type

To extend its functionality, implement to the GeomAnalyzerBase interface and provide the reduction rule as callable.

class schrodinger.application.desmond.packages.analysis.Pbc(box)

Bases: object

box
calcMinimumDiff(from_pos, to_pos)

Calculates the difference vector from from_pos to the minimum image of to_pos. pos and ref_pos can also be arrays of 3D vectors. In this case, they must be of the same size, and minimum image difference will be calculated for each element in pos and ref_pos.

Parameters:
  • from_pos (numpy.ndarray. Either 1x3 or Nx3) – Reference position vector(s)
  • to_pos (numpy.ndarray. Either 1x3 or Nx3) – Position vector(s) of which we will calculate the minimum image.
Return type:

numpy.ndarray

Returns:

The difference vector(s). This function does NOT mutate any of the input vectors.

calcMinimumImage(ref_pos, pos)

Calculates the minimum image of a position vector pos relative to another position vector ref_pos. pos and ref_pos can also be arrays of 3D vectors. In this case, they must be of the same size, and minimum images will be calculated for each element in pos and ref_pos.

Parameters:
  • ref_pos (numpy.ndarray. Either 1x3 or Nx3.) – Reference position vector(s)
  • pos (numpy.ndarray. Either 1x3 or Nx3.) – Position vector(s) of which we will calculate the minimum image.
Return type:

numpy.ndarray

Returns:

The position vector(s) of the mininum image. This function does NOT mutate any of the input vectors.

inv_box
isWithinCutoff(pos0, pos1, cutoff_sq)

Return True if any of pos0 and pos1 are within the cutoff distance.

Parameters:cutoff_sq (float) – = cutoff x cutoff
volume
wrap(pos)

Puts a coordinate back into the box. If the coordinate is already in the box, this function will return a new position vector that equals the original vector.

Return type:numpy.ndarray
Returns:A new position vector which is within the box. This function does NOT mutate and return the input vector pos.
class schrodinger.application.desmond.packages.analysis.PolarSurfaceArea(msys_model, cms_model, asl, resolution=None)

Bases: schrodinger.application.desmond.packages.analysis._MaestroAnalysis

Calculate polar surface area for selected atoms.

N.B.: Only O and N atoms are considered as polar atoms in this implementation.

class schrodinger.application.desmond.packages.analysis.PosAlign(msys_model, cms_model, aids, fit_aids, fit_ref_pos)

Bases: schrodinger.application.desmond.packages.analysis._MaestroAnalysis

This analyzer first aligns the geometric center of the solute atoms to that of cms_model, then calculates the rotation/translation transformation for converting the structure (fit_aids) of a centered trajectory frame to a given geometry (fit_ref_pos) and finally applies the transformation to a position array of only the selected atoms (aids).

If fit_ref_pos is not provided, perform centering.

class schrodinger.application.desmond.packages.analysis.PosTrack(msys_model, cms_model, asl=None, gids=None)

Bases: schrodinger.application.desmond.packages.analysis.GeomAnalyzerBase

Class for tracking positions of selected atoms in a trajectory. Pseudo atoms are included.

Since periodic boundary condition is assumed in the MD simulation, the atom positions are wrapped back into the simulation box when they move out of the box. The PosTrack class unwraps the atom positions with respect to their positions in the previous frame. It can be used when atom positions need to be tracked over time, such as diffusion.

class schrodinger.application.desmond.packages.analysis.Positer(analyzers, num_pos)

Bases: object

A class to create a positer object for use with the GeomCalc class.

gids()
Return type:list of int objects
Returns:The GIDs of the new positions to be added.
numPos()
Return type:int
Returns:The number of new positions to be added into the position array of the given frame.
setGidOffset(gid_offset)
Parameters:gid_offset (int) – The GID of the first position added by this positer will be natoms + gid_offset, where natoms is the number of interaction sites in the original model system.
schrodinger.application.desmond.packages.analysis.Position

alias of PosTrack

schrodinger.application.desmond.packages.analysis.ProtLigHbondInter(*args)

Compute protein-ligand hydrogen bonds.

Returns a list of dict. The length of this list is the number of frames. The dict key is ‘HBondResult’, and the value is a list of ProtLigHbondInter.Result, where prot_aid is the AID of the protein atom, prot_type is a string that denotes the acceptor/donor, backbone/side chain information, lig_aid is the AID of ligand atom.

class schrodinger.application.desmond.packages.analysis.ProtLigInter(msys_model, cms_model, prot_asl, lig_asl)

Bases: schrodinger.application.desmond.packages.analysis._CompositeAnalyzer

Composition of various protein ligand interactions.

Returns a list of dict. The length of this list is the number of frames. The dict keys are ‘WaterBridgeResult’, ‘LigWatResult’, ‘HBondResult’, ‘PiPiResult’, ‘PiCatResult’, ‘MetalResult’, ‘PolarResult’.

schrodinger.application.desmond.packages.analysis.ProtLigPiInter(*args)

Compute pi-pi and pi-cation interations between protein and ligand.

Returns a list of dict. The length of this list is the number of frames. The dict keys are ‘PiPiResult’, and ‘PiCatResult’. The value is a list of ProtLigPiInter.Pipi, ProgLigPiInter.PiLCatP, or ProgLigPiInter.PiPCatL objects, where frag_idx is the index of the ligand fragment, ca_aid is the AID of alpha carbon, prot_aid and lig_aid are the AID of the protein atom and ligand atom, ring_idx is the ligand ring index, type could be ‘f2f’ or ‘e2f’, distance and angle describe the geometry of the corresponding interaction.

class schrodinger.application.desmond.packages.analysis.ProtLigPolarInter(msys_model, cms_model, prot_asl, lig_asl, contact_cutoff=6.0, salt_bridge_cutoff=5.0, hbond_cutoff=2.8)

Bases: schrodinger.application.desmond.packages.analysis._CompositeAnalyzer

Calculate polar interactions between protein and ligand, with hbonds and water bridges excluded.

Returns a list of dict. The length of this list is the number of frames. The dict key is ‘PolarResult’, and the value is a list of _ProtLigSaltBridges.Result, where prot_aid and lig_aid are the AID of the protein atom and ligand atom, polar_type is a string that denotes the side chain/backbone information, distance is the distance between the protein atom and the ligand atom. It also contains keys of ‘HBondResult’ and ‘WaterBridgeResult’ with ProtLigHbondInter and WaterBridges results as values.

class schrodinger.application.desmond.packages.analysis.ProtProtHbondInter(msys_model, cms_model, asl)

Bases: schrodinger.application.desmond.packages.analysis._CompositeAnalyzer

Protein-protein hydrogen bond finder.

Returns a dict with four keys: hbond_bb, hbond_sb, hbond_bs, hbond_ss, b for backbone and s for sidechain. Values are list of 2-element `tuple`s (donor AID, acceptor AID).

class schrodinger.application.desmond.packages.analysis.ProtProtInter(msys_model, cms_model, asl)

Bases: schrodinger.application.desmond.packages.analysis._CompositeAnalyzer

Protein-protein interactions.

Return summary over the whole trajectory. For the same frame, results are unique up to residue level, e.g., even if there are multiple salt-bridges between residue A and B, only 1 is recorded.

reduce(results, *_, **__)
Parameters:results (list of `dict`s. Its length is the number of frames.) – interactions of all frames

:rtype : dict :return: counts of the various interactions over the whole trajectory

class schrodinger.application.desmond.packages.analysis.ProtProtPiInter(msys_model, cms_model, asl)

Bases: schrodinger.application.desmond.packages.analysis._MaestroAnalysis

Protein-protein Pi interaction finder.

Returns a dict with two keys: pi-pi and pi-cat. Values are list of 2-element `tuple`s

class schrodinger.application.desmond.packages.analysis.ProteinRMSF(msys_model, cms_model, aids, fit_aids, fit_ref_pos, in_place=False)

Bases: schrodinger.application.desmond.packages.analysis.RMSF

Root Mean Square Fluctuation from reference positions (averaged positions over the trajectory) for each residue, with optional alignment fitting

reduce(pos_t, *_, **__)

:rtype : list[string], list[float] :return: residue tags and RMSF for each residue

class schrodinger.application.desmond.packages.analysis.RMSD(msys_model, cms_model, aids, ref_pos, fit_aids=None, fit_ref_pos=None, in_place=False)

Bases: schrodinger.application.desmond.packages.analysis.PosAlign

Root Mean Square Deviation from reference positions, with optional alignment fitting.

If spikes are seen, call topo.make_glued_topology, see DESMOND-7129.

class schrodinger.application.desmond.packages.analysis.RMSF(msys_model, cms_model, aids, fit_aids, fit_ref_pos, in_place=False)

Bases: schrodinger.application.desmond.packages.analysis.PosAlign

Root Mean Square Fluctuation from reference positions (averaged position over the trajectory) for each atom, with optional alignment fitting.

If spikes are seen, call topo.make_glued_topology, see DESMOND-7129.

reduce(pos_t, *_, **__)

Temporal average of the RMSF over the trajectory

Return type:length N numpy.ndarray
schrodinger.application.desmond.packages.analysis.RadiusOfGyration

alias of Gyradius

class schrodinger.application.desmond.packages.analysis.Ramachandran(msys_model, cms_model, asl)

Bases: schrodinger.application.desmond.packages.analysis._Ramachandran

Calculate the Phi and Psi torsions for selected atoms.

Usage example:

ana = Ramachandran(msys_model, cms_model, ‘protein and res.num 20-30’) results = analyze(tr, ana)

where tr is a trajectory, and results is a list, and each element in the list is a list: [(phi_0, psi_0), (phi_1, psi_1),] for the corresponding trajectory frame.

reduce(results, *_, **__)
class schrodinger.application.desmond.packages.analysis.Rdf(msys_model, cms_model, asl0, asl1=None, pos_type0='atom', pos_type1='atom', dr=0.1, rmax=12.0)

Bases: schrodinger.application.desmond.packages.analysis.GeomAnalyzerBase

Calculate radial distribution function (RDF) of provided selection.

bins()
reduce(*_, **__)

Aggregates the frame-based results (histograms) and returns the final RDF results.

Return type:(list, list)
Returns:Returns the RDF (the first list), and the integral (the second list).
class schrodinger.application.desmond.packages.analysis.SaltBridgeFinder(msys_model, cms_model, aids1, aids2, cutoff=5.0)

Bases: schrodinger.application.desmond.packages.analysis._MaestroAnalysis

Find salt bridges present between two sets of atoms. This class wraps around the get_salt_bridges() function.

Return a list of tuples, where each tuple is a pair of `schrodinger.structure._StructureAtom`s, i.e., (anion atom, cation atom).

class schrodinger.application.desmond.packages.analysis.SecondaryStructure(msys_model, cms_model, aids)

Bases: schrodinger.application.desmond.packages.analysis._MaestroAnalysis

Calculate the secondary-structure property for selected atoms. The result is a list of int numbers, each of which corresponds to a selected atoms and is one of the following values:

SecondaryStructure.NONE SecondaryStructure.LOOP SecondaryStructure.HELIX SecondaryStructure.STRAND SecondaryStructure.TURN

The selected atoms can be obtained by calling the aids method.

HELIX = 1
LOOP = 0
NONE = -1
STRAND = 2
TURN = 3
reduce(results, *_, **__)
class schrodinger.application.desmond.packages.analysis.SmartsDirector(msys_model, cms_model, asl, smarts)

Bases: schrodinger.application.desmond.packages.analysis._CompositeAnalyzer

Direction of atom pairs from SMARTS pattern.

Convention: the vector is pointing from the first atom to the second

reduce_vec(n, m)

Calculate Legendre polynomial P2 using inner product of n and m as input

Parameters:m (N’x3 numpy.array where N’ is the number of chemical bonds) – output of SmartsDirector for one frame
class schrodinger.application.desmond.packages.analysis.SolventAccessibleSurfaceArea(msys_model, cms_model, asl, exclude_asl=None, resolution=None)

Bases: schrodinger.application.desmond.packages.analysis._MaestroAnalysis

Calculate solvent accessible surface area for selected atoms.

class schrodinger.application.desmond.packages.analysis.SolventAccessibleSurfaceAreaByResidue(msys_model, cms_model, asl, resolution=None)

Bases: schrodinger.application.desmond.packages.analysis._MaestroAnalysis

Calculate the relative SASA broken down by residues. The values are relative to the average SASAs as given by SolventAccessibleSurfaceAreaByResidue.DIPEPTIDE_SASA.

The result is a 2-tuple: ([residue-names], [relative-SASAs]).

DIPEPTIDE_SASA = {'GLH': (203.2443, 6.2765), 'ILE': (207.2248, 5.0012), 'GLN': (208.6171, 6.5794), 'GLY': (94.1021, 5.1977), 'GLU': (201.466, 6.9328), 'CYS': (158.1909, 5.3923), 'ASP': (173.4664, 6.9882), 'ACE': (115.4897, 3.5972), 'LYS': (242.8734, 9.351), 'PRO': (168.783, 5.5848), 'CYX': (99.3829, 10.7089), 'HID': (208.8269, 5.9202), 'HIE': (218.799, 5.6097), 'LYN': (235.5351, 6.8589), 'ASH': (175.7041, 5.1167), 'ASN': (179.5393, 4.632), 'HIP': (221.1223, 8.3364), 'VAL': (181.2543, 4.864), 'NMA': (97.3748, 4.0446), 'THR': (169.0046, 4.9049), 'HIS': (208.8269, 5.9202), 'TRP': (287.0895, 6.892), 'UNK': (189.961, 6.3732), 'SER': (140.6706, 4.9089), 'PHE': (243.4793, 5.9699), 'ALA': (128.7874, 4.715), 'MET': (218.5396, 6.9879), 'LEU': (211.8823, 5.149), 'ARG': (271.5978, 9.5583), 'TYR': (256.8637, 6.2782)}
reduce(results, *_, **__)
class schrodinger.application.desmond.packages.analysis.SystemDipoleDirector(msys_model, cms_model, asl)

Bases: schrodinger.application.desmond.packages.analysis._CompositeAnalyzer

Direction of electric dipole moment of all the selected atoms

class schrodinger.application.desmond.packages.analysis.Torsion(msys_model, cms_model, xid0, xid1, xid2, xid3)

Bases: schrodinger.application.desmond.packages.analysis.GeomAnalyzerBase

Calculate the torsion formed between four xids. Result is a scalar (dihedral angle in degrees) for each trajectory frame.

class schrodinger.application.desmond.packages.analysis.Vector(msys_model, cms_model, from_xid, to_xid)

Bases: schrodinger.application.desmond.packages.analysis.GeomAnalyzerBase

Calculate the vector between two xids. Result is a vector for each trajectory frame.

class schrodinger.application.desmond.packages.analysis.VolumeMapper(cms_model, asl, origin=[0.0, 0.0, 0.0], spacing=[1.0, 1.0, 1.0], length=[10.0, 10.0, 10.0])

Bases: schrodinger.application.desmond.packages.analysis.GeomAnalyzerBase

This class takes the coordinates of provided particles and maps them onto a discretized grid using kernel density estimation as implemented in scipy. The returned occupancy object is a volumetric numpy.array which contains the probability density of the selected particles.

Note: The trajectory provided for this method should already be pre-aligned
onto the selection of interest. For example, to calculate the water occupancy around a protein, the provided trajectory should already contain the necessary transformations on the protein.
Basic usage:
ana = VolumeMapper(cms_model, ‘mol.num 1’) results = analyze(tr, ana)
reduce(*_, **__)
class schrodinger.application.desmond.packages.analysis.WatLigFragDistance(msys_model, cms_model, prot_asl, lig_asl, contact_cutoff=6.0, hbond_cutoff=2.8)

Bases: schrodinger.application.desmond.packages.analysis._CompositeAnalyzer

Distance between water oxygen atom and its closest ligand fragment, with water bridges excluded.

Returns a list of dict. The length of this list is the number of frames. The dict key is ‘LigWatResult’, and the value is a list of _WatLigFragDistance.Result, where frag_idx is the index of the ligand fragment, wat_res_num is the water residue number, distance is the distance between water oxygen atom and ligand fragment centroid. It also contains the key of ‘WaterBridgeResult’ with WaterBridges results as value.

schrodinger.application.desmond.packages.analysis.WaterBridges(*args)

Find water bridges between protein and ligand

Returns a list of dict. The length of this list is the number of frames. The dict key is ‘WaterBridgeResult’, and the value is a list of WaterBridges.Result, where prot_aid and lig_aid are the AID of the protein atom and ligand atom, prot_type and lig_type are strings that denotes the acceptor/donor information, wat_res_num is the water residue number.

schrodinger.application.desmond.packages.analysis.analyze(tr, analyzer, *arg, **kwarg)

Do analyses on the given trajectory tr, and return the results. The analyses are specified as one or more positional arguements. Each analyzer should satisfy the interface requirements (see the docstring of GeomCalc.addAnalyzer).

Parameters:
  • tr (list of `traj.Frame`s) – The simulation trajectory to analyze
  • arg – A list of analyzer objects
  • kwarg["progress_feedback"] (callable, e.g., func(i, fr, tr), where i is the current frame index, fr the current frame, tr the whole trajectory.) – This function will be called at start of analysis on the current frame. This function is intended to report the progress of the analysis.
Return type:

list

Returns:

For a single analyzer, this function will return a list of analysis results, and each element in the list corresponds to the result of the corresponding frame. For multiple analyzers, this function will return a list of lists, and each element is a list of results of the corresponding analyzer. If an analyzer has a reduce method, the reduce method will be called, and its result will be returned.

schrodinger.application.desmond.packages.analysis.cluster(affinity_matrix)

Do clustering using the affinity propagation method.

Parameters:affinity_matrix (numpy.ndarray of `float`s) – A square matrix of affinity/similarity values

:rtype (list-of-int`s, `list-of-`int`s) :return: The first list is the sample indices of the clusters’ centers, the

second list is a cluster label of all samples.
schrodinger.application.desmond.packages.analysis.is_small_struc(atoms)

A simple API to determine whether a molecular structure is small. :type atoms: list :param atoms: A list of atoms in the structure. The atoms can be atom IDs

or atom-class instances.
schrodinger.application.desmond.packages.analysis.progress_report_frame_number(i, *_)
schrodinger.application.desmond.packages.analysis.reduce_vec(n, m)

Calculate Legendre polynomial P2 using inner product of n and m as input

schrodinger.application.desmond.packages.analysis.reduce_vec_list(n, m)

Calculate Legendre polynomial P2 using inner product of n and m as input

schrodinger.application.desmond.packages.analysis.rmsd_matrix(msys_model, tr, rmsd_gids, fit_gids)

For all pairs of frames in the trajectory tr, we first superimpose the structures from the two frames on the atoms as specified by fit_gids, and then we calculate the RMSD for atoms as specified by rmsd_gids.

Parameters:
  • tr (list of traj.Frame objects) – Trajectory
  • rmsd_gids (list of `int`s) – GIDs of atoms for which to calculate the RMSD
  • fit_gids (list of `int`s) – GIDs of atoms on which to we align the structures
Return type:

numpy.ndarray of `float`s

Returns:

A symetric square matrix of RMSDs