LOOS  v2.3.2
loos.pyloos.ensembles Namespace Reference

Functions

def averageStructure (traj)
 Python version of averageStructure (using loos.pyloos.Trajectory-like objects) The subset defined in the trajectory controls what is averaged over. More...
 
def extractCoords (traj)
 Returns the coordinates for an entire trajectory as an MxN numpy matrix where M is 3*natoms and N is the length of the trajectory. More...
 
def svd (traj)
 Returns a tuple containing the SVD result for a trajectory, along with the average structure. More...
 

Detailed Description

PyLOOS functions applicable to ensembles (trajectories or trajectory-like collections)

Function Documentation

def loos.pyloos.ensembles.averageStructure (   traj)

Python version of averageStructure (using loos.pyloos.Trajectory-like objects) The subset defined in the trajectory controls what is averaged over.

The trajectory may actually be a VirtualTrajectory or an AlignedVirtualTrajectory.

Returns the average structure for a trajectory.
>>> avg = loos.pyloos.averageStructure(traj)

Definition at line 14 of file ensembles.py.

def loos.pyloos.ensembles.extractCoords (   traj)

Returns the coordinates for an entire trajectory as an MxN numpy matrix where M is 3*natoms and N is the length of the trajectory.

The subset in the trajectory controls what is extracted. The trajectory may actually be a VirtualTrajectory or an AlignedVirtualTrajectory.

Extracts coords from a trajectory as a NumPy matrix
>>> A = loos.pyloos.extractCoords(traj)

Definition at line 35 of file ensembles.py.

def loos.pyloos.ensembles.svd (   traj)

Returns a tuple containing the SVD result for a trajectory, along with the average structure.

The tuple is, (left-singular-vectors, singular-values, right-singular-vectors, average)

The subset set in the trajectory controls what is used for the SVD. The trajectory may be a VirtualTrajectory or an AlignedVirtualTrajectory. The following example computes an SVD using backbone atoms for a trajectory that has been iteratively aligned using C-alphas

1 traj = loos.pyloos.Trajectory('foo.dcd', model, subset = 'backbone')
2 aligned = loos.pyloos.AlignedVirtualTrajectory(traj, alignwith = 'name == "CA"')
3 (L,S,V,avg) = loos.pyloos.svd(aligned)
Returns a tuple containing SVD results along with the average structure for a trajectory
>>> (L,S,V,avg) = loos.pyloos.svd(traj)

Definition at line 66 of file ensembles.py.