LOOS 4.1.0
The Lightweight Object Oriented Structural analysis library/toolkit
Loading...
Searching...
No Matches
Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
loos.pyloos.trajectories.AlignedVirtualTrajectory Class Reference

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

Inheritance diagram for loos.pyloos.trajectories.AlignedVirtualTrajectory:
Inheritance graph
[legend]
Collaboration diagram for loos.pyloos.trajectories.AlignedVirtualTrajectory:
Collaboration graph
[legend]

Public Member Functions

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

Protected Member Functions

 _align (self)
 
 _getSlice (self, s)
 
- Protected Member Functions inherited from loos.pyloos.trajectories.VirtualTrajectory
 _initFrameList (self)
 

Protected Attributes

 _aligned
 
 _xformlist
 
 _rmsd
 
 _iters
 
 _alignwith
 
 _reference
 
 _stale
 
 _index
 
 _framelist
 
- Protected Attributes inherited from loos.pyloos.trajectories.VirtualTrajectory
 _skip
 
 _stride
 
 _nframes
 
 _iterator
 
 _trajectories
 
 _index
 
 _framelist
 
 _trajlist
 
 _stale
 

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)

A virtual trajectory that supports iterative alignment.
Definition trajectories.py:626

Align using only backbone atoms

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

Add another trajectory

vtraj.append(traj3)

Align using only C-alphas and a reference structure

refmodel = loos.createSystem('foo-ref.pdb')
refsubset = loos.selectAtoms(refmodel, 'name == "CA"')
vtraj = loos.pyloos.AlignedVirtualTrajectory(traj1, traj2, reference = refsubset)
AtomicGroup selectAtoms(const AtomicGroup &source, const std::string selection)
Applies a string-based selection to an atomic group...
Definition utils.cpp:183
AtomicGroup createSystem(const std::string &filename)
Factory function for reading in structure files.
Definition sfactories.cpp:117
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.

Constructor & Destructor Documentation

◆ __init__()

loos.pyloos.trajectories.AlignedVirtualTrajectory.__init__ ( self,
* trajs,
** kwargs )

Member Function Documentation

◆ __getitem__()

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.

Reimplemented from loos.pyloos.trajectories.VirtualTrajectory.

◆ __iter__()

loos.pyloos.trajectories.AlignedVirtualTrajectory.__iter__ ( self)

◆ _align()

loos.pyloos.trajectories.AlignedVirtualTrajectory._align ( self)
protected
Align the frames (called implicitly on iterator or array access)

◆ _getSlice()

loos.pyloos.trajectories.AlignedVirtualTrajectory._getSlice ( self,
s )
protected

◆ alignWith()

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

◆ append()

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

Reimplemented from loos.pyloos.trajectories.VirtualTrajectory.


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