Previous topic

surface_alg module

Next topic

Installation

This Page

trajectory_utilities module

This module contains functions for filtering and building trajectories

CalculateInterfaceFromTraj(t, waters, lipids, PBC=False, cell_center=None, cell_size=None, low_pass_filter_length=10, density_cutoff=None, outdir='', outname='', stride=1)[source]
CalculateGeneralizedCorrelations(t, view, superposition_view)[source]

Calculates the generalized correlation coefficient between the N atoms in the view, as defined in: “Generalized Correlation for biomolecular dynamics”, O. F. Lange and H. Grubmuller, Protein: Structure, Function and Bioinformatics 62:1053-1061 (2006) If superposition_view is defined, the trajectory is first aligned.

CalculateMutualInformation(t, view, superposition_view=None)[source]

Calculates the mutual information between the N atoms in the view. If superposition_view is defined, the trajectory is first aligned.

CalculateCovariance(t, view, superposition_view=None)[source]

Calculates the covariance matrix C(3Nx3N) for the N atoms in the view. If superposition_view is defined, the trajectory is first aligned.

AverageMembraneThickness(t, upper, lower, step_size=2, z_midplane=None)[source]

This function creates a discrete mesh in the xy plane and calculates the average z position of the atoms in the upper and lower EntityViews over the trajectory t. Typically upper and lower contain the phosphate atoms of the lipids in the upper and lower leaflets of the membrane. It returns two Entities, representing these average positions in the upper and lower leaflets, as well as two matricies containing the same information. Each atom of the output entities is assigned a FloatProp ‘thickness’, representing the local thickness of the membrane, another FloatProp ‘’ ‘monolayer_thickness’ representing the local thickness of the monolayer, an FloatProp ‘count’ which is the number times that particular bin was sampled and a FloatProp ‘count_thickness’ which is the min between the counts for this bin and the corresponding bin on the other leaflet. Relevant atoms for which the bin was sampled at least i times can therefore be selected with eh_upper.Select(‘gacount>=i’) whereas relevant atoms for which the thickness was sampled at least i times can therefore be selected with eh_upper.Select(‘gacount_thickness>=i’) Input: -t : CoordGroup, the trajectory

-upper : EntityView, the upper membrane leaflet
-lower : EntityView, the lower membrane leaflet
-step_size : size of the bins in xy

-z_midplane : average height of the midplane

Output: -eh_upper : EntityHandle, average membrane upper leaflet
-eh_lower : EntityHandle, average membrane lower leaflet
-zu : numpy matrix, binned average z positions upper leaflet
-zl : numpy matrix, binned average z positions lower leaflet
SmoothAverageMembrane(eh_upper, eh_lower, zu, zl, smooth_sigma=2.0, smooth_sampling_cutoff=5, z_midplane=None)[source]

This function smoothes a membane surface obtained from the AverageMembraneThickness function. Input: -eh_upper : EntityHandle, average membrane upper leaflet

-eh_lower : EntityHandle, average membrane lower leaflet
-zu : numpy matrix, binned average z positions upper leaflet
-zl : numpy matrix, binned average z positions lower leaflet

-smooth_sigma: standard deviation of the gaussian used for smoothing -smooth_sampling_cutoff: atoms with FloatProp ‘count’ smaller than this

do not participate in smoothing of their neighboring atoms

-z_midplane : average height of the midplane

Output: -eh_upper_smooth : EntityHandle, smoothed average membrane upper leaflet
-eh_lower_smooth : EntityHandle, smoothed average membrane lower leaflet
WrapFloatList(fl, center, period)[source]
GetCellVectorsList(t)[source]
GetCellAnglesList(t)[source]
GetCellSizeList(t)[source]
CreatePerResidueCMTrajectory(eh, t, cm_sele_list=[], atom_name_list=[], superposition_view=None)[source]

This function will generate a trajectory containing for each residue the center of masse for each selection in the selection list. The atoms corresponding to these COMs will be named according to the atom_name_list. If provided the trajectory will first be aligned on the superposition_view (has to be from the same entity). As default it gives one CM for the backbone heavy atoms and one for the sidechain heavy atoms, except for GLY and PRO for which only the backbone is used.

ExtendTrajectoryToNeighboringUnitCells(t, extension_directions, cell_size_mult_factors=(1, 1, 1))[source]

This function is used to extend a trajectory to its neighboring unit cells. Specifically, it will copy and translate the simulation box for each frame i in each of the directions given by extension_directions. For example if extension_directions=[[1,0,0],[0,1,0],[1,1,0]] it will extend the simulation in the x, y and x+y directions. It will also reset the cell size for each frame by multiplying it by cell_size_mult_factors. Specifically, the unit cell is specified by the length of the 3 unit cell vectors and 3 angles. So for each frame i, the size of each of the unit cell vectors will be multiplied by the corresponding component of cell_size_mult_factors[i].

Parameters:
  • t (CoordGroupHandle) – the trajectory
  • extension_directions (list (list)) – The list of lists used to define the directions in which the unit cell should be copied.
  • cell_size_mult_factors (Vec3) –
ExtendTrajectory(t, vecs_to_neighbor_ucells_list, cell_size_mult_factors=(1, 1, 1))[source]

This function is used to extend a trajectory to its neighboring unit cells. Specifically, it will copy and translate the simulation box for each frame i by each vector in vecs_to_neighbor_ucells_list[i]. It will also reset the cell size for each frame by multiplying it by cell_size_mult_factors. Specifically, the unit cell is specified by the length of the 3 unit cell vectors and 3 angles. So for each frame i, the size of each of the unit cell vectors will be multiplied by the corresponding component of cell_size_mult_factors[i].

Parameters:
  • t (CoordGroupHandle) – the trajectory
  • vecs_to_neighbor_ucells_list (list (Vec3List)) – The list of Vec3List used to translate the unit cell. This list should contain one Vec3List for each frame in the trajectory.
  • cell_size_mult_factors (Vec3) –
TranslateFrames(t, trans_list)[source]

This function translates each frame in the trajectory t by the corresponding Vec3 in the trans_list. The transformation is done in place, so that the provided trajectory gets transformed.

WrapTrajectoryInPeriodicCell(t, centers, cell_sizes=None, cell_angles=None, group_res=False, follow_bonds=False)[source]