LOOS 4.1.0
The Lightweight Object Oriented Structural analysis library/toolkit
Loading...
Searching...
No Matches
Public Member Functions | List of all members
loos::PDBTraj Class Reference

Class for intepreting separate PDB files as a single trajectory. More...

#include <pdbtraj.hpp>

Inheritance diagram for loos::PDBTraj:
Inheritance graph
[legend]
Collaboration diagram for loos::PDBTraj:
Collaboration graph
[legend]

Public Member Functions

 PDBTraj (const std::string &s, uint st, uint en, uint str=1)
 
 PDBTraj (const char *p, uint st, uint en, uint str=1)
 
std::string description () const
 Return a string describing trajectory format.
 
virtual uint nframes (void) const
 Number of frames in the trajectory.
 
virtual uint natoms (void) const
 
virtual std::vector< GCoordcoords (void) const
 Returns the current frames coordinates as a vector of GCoords.
 
virtual void updateGroupCoords (AtomicGroup &g)
 
virtual bool hasPeriodicBox (void) const
 
virtual GCoord periodicBox (void) const
 Returns the periodic box for the current frame/trajectory.
 
virtual float timestep (void) const
 Timestep per frame.
 
std::string currentName (void) const
 Returns the auto-generated name for the file containing the current frame.
 
PDB currentFrame (void) const
 See CCPDB::currentFrame() for important notes.
 
virtual bool parseFrame (void)
 Parse an actual frame.
 
- Public Member Functions inherited from loos::Trajectory
 Trajectory (const std::string &s)
 Automatically open the file named s.
 
 Trajectory (std::istream &fs)
 Open using the given stream...
 
 Trajectory (const Trajectory &t)
 
virtual std::string filename () const
 Return the stored filename.
 
virtual bool hasVelocities () const
 Whether or not the trajectory format supports velocities.
 
virtual double velocityConversionFactor () const
 Conversion applied to velocities to get to \AA/ps.
 
bool rewind (void)
 Rewinds the readFrame() iterator.
 
void updateGroupCoords (AtomicGroup &g)
 Update the coordinates in an AtomicGroup with the current frame.
 
virtual std::vector< GCoordvelocities (void) const
 Returns the current frame's velocities as a vector of GCoords.
 
void updateGroupVelocities (AtomicGroup &g)
 
void seekNextFrame (void)
 
void seekFrame (const uint i)
 
bool readFrame (void)
 Reads the next frame in a trajectory, returning false if at the end.
 
bool readFrame (const int i)
 Reads a specific frame in a trajectory.
 
bool atEnd () const
 
uint currentFrame () const
 

Additional Inherited Members

- Public Types inherited from loos::Trajectory
typedef boost::shared_ptr< std::istream > pStream
 
- Protected Member Functions inherited from loos::Trajectory
void setInputStream (const std::string &fname)
 
void setInputStream (std::istream &fs)
 
- Protected Attributes inherited from loos::Trajectory
pStream ifs
 
bool cached_first
 
std::string _filename
 
uint _current_frame
 

Detailed Description

Class for intepreting separate PDB files as a single trajectory.

This class takes a set of PDB files following a specified naming pattern and accesses them as though they were a contiguous trajectory. You specify a template string (in boost::format format) and a start and end values along with an optional stride. Frame numbers are then mapped onto this range.

This first frame is read as part of initialization.

Access to the internal PDB object is permitted, however, see the CCPDB::currentFrame() for important information regarding its use.

Constructor & Destructor Documentation

◆ PDBTraj()

loos::PDBTraj::PDBTraj ( const std::string & s,
uint st,
uint en,
uint str = 1 )
inlineexplicit

Use the pattern s with starting index st, ending index en, and option stride str. As an example, suppose you have frames of the trajectory stored in PDB files named: -frame_000.pdb -frame_010.pdb -frame_020.pdb You can manipulate these as a trajectory using,

PDBTraj foo("frame_%03d.pdb", 0, 20, 10);
Simple matrix template class using policy classes to determine behavior.
Definition MatrixImpl.hpp:148
Class for intepreting separate PDB files as a single trajectory.
Definition pdbtraj.hpp:55

Member Function Documentation

◆ coords()

std::vector< GCoord > loos::PDBTraj::coords ( void ) const
virtual

Returns the current frames coordinates as a vector of GCoords.

Some formats, notably DCDs, do not interleave their coordinates. This means that this could be a potentially expensive operation.

Implements loos::Trajectory.

◆ description()

std::string loos::PDBTraj::description ( ) const
inlinevirtual

Return a string describing trajectory format.

Reimplemented from loos::Trajectory.

◆ hasPeriodicBox()

bool loos::PDBTraj::hasPeriodicBox ( void ) const
virtual

Tests whether or not the given frame/trajectory has periodic boundary information. The presence of periodic box information does not necessarily indicate that said information has been read in yet. For example, the presence of crystal data is in the header so this can be detected before any frame is read, but the crystal data itself is only read when a frame is read in.

Implements loos::Trajectory.

◆ natoms()

uint loos::PDBTraj::natoms ( void ) const
virtual

of atoms per frame

Implements loos::Trajectory.

◆ nframes()

uint loos::PDBTraj::nframes ( void ) const
virtual

Number of frames in the trajectory.

Implements loos::Trajectory.

◆ parseFrame()

bool loos::PDBTraj::parseFrame ( void )
virtual

Parse an actual frame.

parseFrame() is expected to read in a frame through the Trajectory's StreamWrapper. It returns a bool indicating whether or not it was able to actually read a frame (i.e. false indicates EOF).

Implements loos::Trajectory.

◆ periodicBox()

GCoord loos::PDBTraj::periodicBox ( void ) const
virtual

Returns the periodic box for the current frame/trajectory.

Implements loos::Trajectory.

◆ timestep()

float loos::PDBTraj::timestep ( void ) const
virtual

Timestep per frame.

Implements loos::Trajectory.

◆ updateGroupCoords()

void loos::PDBTraj::updateGroupCoords ( AtomicGroup & g)
virtual

If the passed group to update is the same size as the trajectory frame, then the coordinates a copied straight out of the frame and into the group. If the sizes do not match, then the atomid's of the passed group are assumed to be indices (+1) into the frame.


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