LOOS  v2.3.2
loos.pyloos.trajectories.AlignedVirtualTrajectory Class Reference

A virtual trajectory that supports iterative alignment. More...

Inheritance diagram for loos.pyloos.trajectories.AlignedVirtualTrajectory:
Collaboration diagram for loos.pyloos.trajectories.AlignedVirtualTrajectory:

Public Member Functions

def __init__ (self, trajs, kwargs)
 
def append (self, traj)
 
def alignWith (self, selection)
 
def __iter__ (self)
 
def setReference (self, reference)
 
def rmsd (self)
 
def iters (self)
 
def __getitem__ (self, i)
 
- Public Member Functions inherited from loos.pyloos.trajectories.VirtualTrajectory
def __init__ (self, trajs, kwargs)
 
def append (self, traj)
 
def stride (self, n)
 
def skip (self, n)
 
def allStride (self, n)
 
def allSkip (self, n)
 
def setSubset (self, selection)
 
def frame (self)
 
def index (self)
 
def frameLocation (self, i)
 Returns information about the ith frame in the VirtualTrajectory The tuple returned has the following format: More...
 
def __len__ (self)
 
def __getitem__ (self, i)
 
def __iter__ (self)
 
def reset (self)
 
def next (self)
 

Detailed Description

A virtual trajectory that supports iterative alignment.

Only the transformation needed to align each frame is stored. When a frame is accessed, it is automatically transformed into the aligned orientation. All keywords from VirtualTrajectory are supported, along with the following new ones,

Keyword Description
alignwith=s Use 's' to select what part of the model is used for aligning.
reference=g Use the AtomicGroup g as a reference structure. All frames will be aligned to it.

There are two ways that a trajectory can be aligned. The first uses in iterative alignment method (the same used in LOOS). This is the default method. In order to do the alignment, the alignwith subset must be read into memory and temporarily stored. This can potentially use a lot of memory and create delays in execution. Once the alignment is complete, however, those cached frames are released and subsequent frame accesses will be quick.

The second method is to align each frame to a reference structure. This method is selected when a reference structure is passed to the constructor (with the 'reference' keyword), or when setReference() is called. Note that you can pass None to setReference() which will return the AlignedVirtualTrajectory to the iterative method. Also note that the reference structure is copied into the AVT object as a deep copy (i.e. it does not share any atoms).

See VirtualTrajectory for some basic examples in addition to below...

Align using only C-alphas (the default)

1 vtraj = loos.pyloos.AlignedVirtualTrajectory(traj1, traj2)

Align using only backbone atoms

1 vtraj = loos.pyloos.AlignedVirtualTrajectory(traj1, traj2, alignwith='name =~ "^(C|N|O|CA)$"')

Add another trajectory

1 vtraj.append(traj3)

Align using only C-alphas and a reference structure

1 refmodel = loos.createSystem('foo-ref.pdb')
2 refsubset = loos.selectAtoms(refmodel, 'name == "CA"')
3 vtraj = loos.pyloos.AlignedVirtualTrajectory(traj1, traj2, reference = refsubset)
Combine loos.pyloos.Trajectory objects and align them

>>> aligned = loos.pyloos.AlignedVirtualTrajectory(traj1, traj2, alignwith = 'backbone')
Supports the same keywords as VirtualTrajectory.
New keywords:
  alignwith = Selection used for alignment (default is all C-alphas)
  reference = AtomicGroup that all frames are aligned to (disables iterative alignment)

See the Doxygen documentation for more details.

Definition at line 586 of file trajectories.py.

Member Function Documentation

def loos.pyloos.trajectories.AlignedVirtualTrajectory.__getitem__ (   self,
  i 
)
Returns the ith frame aligned.  Supports Python slices.  Negative indices are relative
to the end of the composite trajectory.

Definition at line 704 of file trajectories.py.

def loos.pyloos.trajectories.AlignedVirtualTrajectory.alignWith (   self,
  selection 
)
Change the selection used to align with.  Requires re-aligning

Definition at line 624 of file trajectories.py.

def loos.pyloos.trajectories.AlignedVirtualTrajectory.append (   self,
  traj 
)
Add another trajectory at the end.  Requires re-aligning

Definition at line 616 of file trajectories.py.


The documentation for this class was generated from the following file: