schrodinger.trajectory.analysis module

A module of classes to analyze Desmond trajectories.

Please see the AnalysisTool documentation for a description of the API that handles interaction between AnalysisTool objects and schrodinger.trajectory.desmondsimulation.DesmondSimulation instances.

Copyright Schrodinger, LLC. All rights reserved.

class schrodinger.trajectory.analysis.Angle(atomsel1, atomsel2, atomsel3, *args, **kwargs)

Bases: schrodinger.trajectory.analysistool.AnalysisTool

A tool to calculate angles between selected atom sets.

getFrameResults()
getLabel()
plot(*args, **kwargs)

A generic matplotlib 2D plot implementation.

processFrame(frame)
class schrodinger.trajectory.analysis.AverageStructure(fit_asl, ref_fit_pos=None, *args, **kwargs)

Bases: schrodinger.trajectory.analysistool.AnalysisTool

A tool to calculate average position over time for each atom in a set.

doFrameInit(frame)
getFrameResults()
getLabel()
plot(*args, **kwargs)

A generic matplotlib 2D plot implementation.

postProcess()
processFrame(frame)
class schrodinger.trajectory.analysis.CenterOfMass(atomsel, *args, **kwargs)

Bases: schrodinger.trajectory.analysistool.AnalysisTool

A tool to calculate center of mass of selected atoms.

getFrameResults()
getLabel()
plot(*args, **kwargs)

A generic matplotlib 2D plot implementation.

processFrame(frame)
class schrodinger.trajectory.analysis.CenterOfMotion(atomsel, *args, **kwargs)

Bases: schrodinger.trajectory.analysistool.AnalysisTool

A tool to calculate center of motion of selected atoms.

getFrameResults()
getLabel()
plot(*args, **kwargs)

A generic matplotlib 2D plot implementation.

processFrame(frame)
class schrodinger.trajectory.analysis.CovarianceMatrix(covmat_asl, ref_pos=None, fit_asl=None, ref_fit_pos=None, *args, **kwargs)

Bases: schrodinger.trajectory.analysistool.AnalysisTool

A tool to calculate covmatiant matrix.

doFrameInit(frame)
getFrameResults()
getLabel()
plot(*args, **kwargs)

A generic matplotlib 2D plot implementation.

postProcess()
processFrame(frame)
class schrodinger.trajectory.analysis.Dihedral(atomsel1, atomsel2, atomsel3, atomsel4, *args, **kwargs)

Bases: schrodinger.trajectory.analysistool.AnalysisTool

A tool to calculate dihedral angles from selected atom sets.

getFrameResults()
getLabel()
plot(*args, **kwargs)

A generic matplotlib 2D plot implementation.

processFrame(frame)
class schrodinger.trajectory.analysis.Distance(atomsel1, atomsel2, *args, **kwargs)

Bases: schrodinger.trajectory.analysistool.AnalysisTool

A tool to calculate distances between selected atom sets.

getFrameResults()
getLabel()
plot(*args, **kwargs)

A generic matplotlib 2D plot implementation.

processFrame(frame)
class schrodinger.trajectory.analysis.Grid3D(origin=[0.0, 0.0, 0.0], spacing=[1.0, 1.0, 1.0], length=[1.0, 1.0, 1.0], default_radius=1.5)

Bases: object

A class for representing a function of 3D Cartesian coordinates discretize onto a grid. Numpy arrays are used extensively, and are returned by most methods.

grid_size
length
mapAtomListToGrid(st, atom_list=[], scale_radii=1.0)

Given a Structure object and a list of atom indices, map atoms in the list to the grid.

args:
st => Structure object atom_list => list of atom indices scale_radii => scale atom vdw radii by this amount: default = 1.0
mapAtomToGrid(atom, scale_radius=1.0)

Assigns atom density to the grid based on the atom’s position. In oder to discretize the atom’s position, it is treated as a normalized Gaussian, which is evaluated at N grid points closest to the atom’s position.

args:

atom => A _StructureAtom object scale_radii => scale the atom vdw radius by this amount:

default = 1.0
mapPointToGrid(point)

Maps a single point to the grid, assuming a default radius

mapPointsToGrid(points)

maps a numpy array of points (shape n,3) to the grid.

Parameters:points (numpy array of shape n,3) – the points to map to the grid
nearestIndexToPoint(point)

Returns the grid indices (a,b,c) that are closest to the point (x,y,z).

normalize()

Normalize the grid values

origin
pointForIndex(index)

Given grid index (a,b,c), return the corresponding point in 3D space

pointIsOutOfBounds(point)

Returns True if the point (x,y,z) is outside the space represented by the grid.

setOrigin(origin)

Reposition the origin of the grid in the lab frame

spacing
writeCNS(filename=None, norm=True)
class schrodinger.trajectory.analysis.HydrogenBondFinder(atomsel1, atomsel2, dist=2.8, min_da=120.0, min_aa=90.0, max_aa=360.0, *args, **kwargs)

Bases: schrodinger.trajectory.analysistool.AnalysisTool

A tool to find hydrogen bonds present between two sets of molecules.

getAllBonds()

Return a set of all hydrogen bonds found by the analysis. Results are in the same form as getFrameResults() - a pair of (acceptor, donor) integers.

getFrameResults()

For each frame, return a list of (acceptor, donor) integer tuples, each value being a 1-based atom index into the overall simulation structure.

Note that the returned value here is not a numpy array as each frame may have a different number of hydrogen bonds.

getResults()
processFrame(frame)
class schrodinger.trajectory.analysis.HydrogenBondTracker(acceptor_sel, donor_sel, *args, **kwargs)

Bases: schrodinger.trajectory.analysistool.AnalysisTool

A tool to track the state of hydrogen bonds between atom sets.

getFrameResults()
getLabel()
plot(*args, **kwargs)

A generic matplotlib 2D plot implementation.

processFrame(frame)
class schrodinger.trajectory.analysis.LigandRMSD(rmsd_asl, ref_rmsd_pos, fit_asl=None, ref_fit_pos=None, *args, **kwargs)

Bases: schrodinger.trajectory.analysistool.AnalysisTool

A tool to calculate Root Mean Square Deviation from reference positions of a small molecule. Taking symmetry into account.

doFrameInit(frame)
getFrameResults()
getLabel()
plot(*args, **kwargs)

A generic matplotlib 2D plot implementation.

processFrame(frame)
class schrodinger.trajectory.analysis.MolecularSurfaceArea(atomsel, grid_spacing, *args, **kwargs)

Bases: schrodinger.trajectory.analysistool.AnalysisTool

A tool to calculate molecular (connolly) surface area.

doFrameInit(frame)
getFrameResults()
getLabel()
plot(*args, **kwargs)

A generic matplotlib 2D plot implementation.

processFrame(frame)
class schrodinger.trajectory.analysis.PlanarAngle(atomsel1, atomsel2, atomsel3, atomsel4, atomsel5, atomsel6, *args, **kwargs)

Bases: schrodinger.trajectory.analysistool.AnalysisTool

A tool calculate inter-planar angles from selected atoms

Planar angles are normalized to lie between 0 and 90 since the plane normal directions are arbitrary based on the order of atoms sent.

This does not handle sets of planes and instead takes the first plane as first atoms in selections 1, 2, and 3 and the second plane as the first atoms in selections 4, 5, and 6.

getFrameResults()
getLabel()
plot(*args, **kwargs)

A generic matplotlib 2D plot implementation.

processFrame(frame)
class schrodinger.trajectory.analysis.PolarSurfaceArea(atomsel, resolution, *args, **kwargs)

Bases: schrodinger.trajectory.analysistool.AnalysisTool

A tool to calculate Polar Surface Area.

doFrameInit(frame)
getFrameResults()
getLabel()
plot(*args, **kwargs)

A generic matplotlib 2D plot implementation.

processFrame(frame)
class schrodinger.trajectory.analysis.Position(atomsel, *args, **kwargs)

Bases: schrodinger.trajectory.analysistool.AnalysisTool

A tool to track positions of atoms.

getFrameResults()
plot(colormap=None)
processFrame(frame)
class schrodinger.trajectory.analysis.RMSD(rmsd_asl, ref_rmsd_pos, in_place=False, fit_asl=None, ref_fit_pos=None, *args, **kwargs)

Bases: schrodinger.trajectory.analysistool.AnalysisTool

A tool to calculate Root Mean Square Deviation from reference positions.

getFrameResults()
getLabel()
plot(*args, **kwargs)

A generic matplotlib 2D plot implementation.

processFrame(frame)
class schrodinger.trajectory.analysis.RMSF(rmsf_asl, residue=False, fit_asl=None, ref_fit_pos=None, *args, **kwargs)

Bases: schrodinger.trajectory.analysistool.AnalysisTool

A tool to calculate Root Mean Square Fluctation from reference positions.

doFrameInit(frame)
getAtomIndices()
getFrameResults()
getLabel()
plot(*args, **kwargs)

A generic matplotlib 2D plot implementation.

processFrame(frame)
class schrodinger.trajectory.analysis.RadiusOfGyration(atomsel, *args, **kwargs)

Bases: schrodinger.trajectory.analysistool.AnalysisTool

A tool to calculate radius of gyration for a set of atoms.

getFrameResults()
getLabel()
plot(*args, **kwargs)

A generic matplotlib 2D plot implementation.

processFrame(frame)
class schrodinger.trajectory.analysis.Ramachandran(interactive_plot=True, phi_psi_atoms=None, *args, **kwargs)

Bases: schrodinger.trajectory.analysistool.AnalysisTool

A tool to look at Ramachandran information and plots.

doFrameInit(frame)

Collect the atom indices from the first frame and set up the phi and psi Dihedral analyses.

Parameters:frame – A _DesmondFrame instance.
getFrameResults()
plot(frames=None, colormap=None)

Draw a Ramachandran plot.

Parameters:
  • frames (sequence of ints) – The frame indices to plot. Default is all available frames.
  • colormap (matplotlib.colors.Colormap) – A colormap to indicate the simulation frame that a datapoint belongs to. Default is ‘pylab.cm.copper’.
processFrame(frame)
class schrodinger.trajectory.analysis.SecondaryStructure(selection=None, *args, **kwargs)

Bases: schrodinger.trajectory.analysistool.AnalysisTool

A tool to track secondary protein structure.

Secondary structure status corresponds to the values of class variables NONE (-1), LOOP (0), HELIX (1), STRAND (2), or TURN (3).

HELIX = 1
LOOP = 0
NONE = -1
STRAND = 2
TURN = 3
doFrameInit(frame)

Initialize protein structure and then just update the coordinates

getDataLabels()

Return the data labels for the residues being tracked.

getFrameResults()
getLabel()
plot(*args, **kwargs)

Plot the secondary structure results with specific integer values for each structure type. Values used are as noted in the class docstring. Small offsets are added to each residue so the lines are distinguishable on the plot.

processFrame(frame)
class schrodinger.trajectory.analysis.SolventAccessibleSurfaceArea(atomsel, resolution, exclude_asl=None, *args, **kwargs)

Bases: schrodinger.trajectory.analysistool.AnalysisTool

A class which calculates Solvent Accessible Surface Area.

doFrameInit(frame)
getFrameResults()
getLabel()
plot(*args, **kwargs)

A generic matplotlib 2D plot implementation.

processFrame(frame)
class schrodinger.trajectory.analysis.SolventAccessibleSurfaceAreaByResidue(atomsel, resolution, *args, **kwargs)

Bases: schrodinger.trajectory.analysistool.AnalysisTool

A class which calculates Solvent Accessible Surface Area and returns results groupped by residues. And their values are then normalized by the SASA of the solvated residue of same type, which was calculated from a the dipeptide configuration (Ala-XXX-Ala).

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': (150.0, 5.0), '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)}
doFrameInit(frame)
getConnonicalSASA()

returns a list of mean SASA of each residue

getFrameResults()
getLabel()
getResidueInfo()
plot(*args, **kwargs)

A generic matplotlib 2D plot implementation.

processFrame(frame)
class schrodinger.trajectory.analysis.Superimposer

Bases: object

apply(coords)
getRotTran()

Return rotation matrix and translation vector.

set(reference_coords, coords)
class schrodinger.trajectory.analysis.VolumeMapper(map_asl, fit_asl, grid, ref_fit_pos=None, *args, **kwargs)

Bases: schrodinger.trajectory.analysistool.AnalysisTool

A tool to map atomic volume onto a grid. Each frame is superimposed onto a reference using fit_asl and ref_fit_pos. Next, the atoms selected by map_asl are mapped onto the grid.

doFrameInit(frame)
getLabel()
grid
processFrame(frame)
schrodinger.trajectory.analysis.get_phi_psi_atoms(st, ca_asl_expr='atom.ptype " CA "', atom_list=None)

Return phi_psi atoms that can be used in Ramachandran class

Parameters:
  • st (Structure) – A Structure instance to be operated on
  • ca_asl_expr (string) – ASL expression for CA
  • atom_list (list) – An atom index list that used to determine if the selected atom is valid. By default, it is set to None, which means any selected atom is valid.
schrodinger.trajectory.analysis.import_pylab()

Do a lazy import of pylab here. We want to usually use agg backend to do non interactive drawing. We will only successfully set this if no one has already used matplotlib functions.

schrodinger.trajectory.analysis.superimpose(p, coords, reference_coords)