LOOS  v2.3.2
loos::CCPDB Class Reference

Class for interpreting concatenated PDB files as a Trajectory. More...

#include <ccpdb.hpp>

Inheritance diagram for loos::CCPDB:
Collaboration diagram for loos::CCPDB:

Public Member Functions

 CCPDB (const std::string &s)
 CCPDB (const char *p)
 CCPDB (std::istream &is)
virtual 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

of atoms per frame

virtual std::vector< GCoordcoords (void)
 Returns the current frames coordinates as a vector of GCoords. More...
virtual bool hasPeriodicBox (void) const
virtual GCoord periodicBox (void) const
 Returns the periodic box for the current frame/trajectory.
virtual float timestep (void) const
PDB currentFrame (void) const
 Returns the current frame as a PDB object. More...
virtual bool parseFrame (void)
 Parse an actual frame. More...
- 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...
bool rewind (void)
 Rewinds the readFrame() iterator.
void updateGroupCoords (AtomicGroup &g)
 Update the coordinates in an AtomicGroup with the current frame. More...
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. More...

Static Public Member Functions

static pTraj create (const std::string &fname, const AtomicGroup &model)

Additional Inherited Members

- Protected Attributes inherited from loos::Trajectory
StreamWrapper ifs
bool cached_first
std::string _filename

Detailed Description

Class for interpreting concatenated PDB files as a Trajectory.

This class reads a concatenated PDB Trajectory file as a LOOS Trajectory. Each frame of the trajectory must be separated by an "END" record. Since each frame is a fully-parsed PDB object, there is quite a bit of overhead involved in reading CCPDB trajectories. In addition, upon instantiation, the trajectory will be scanned for "END" records to build a list of seek indices for each frame.

It is possible to get the contained PDB object out of the CCPDB, but be careful of semantics that are slightly inconsistent with the rest of LOOS. See CCPDB::currentFrame() for more details.

Definition at line 51 of file ccpdb.hpp.

Member Function Documentation

std::vector< GCoord > loos::CCPDB::coords ( void  )

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.

Definition at line 78 of file ccpdb.cpp.

PDB loos::CCPDB::currentFrame ( void  ) const

Returns the current frame as a PDB object.

CCPDB actually stores a PDB object inside of it that represents the currently read frame. When you request that PDB, what you get is a shared copy with the internal one, that is, the contained Atom and PeriodicBox objects are shared. However, when you read in a new frame, the internal PDB is swapped out with a new one. So at this point, what you are left holding is actually a copy (equivalent to a deep copy) of the previously read frame.

In general, since currentFrame() is not part of the Trajectory interface, you should not use it unless you need it...

Definition at line 88 of file ccpdb.hpp.

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

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.

Definition at line 68 of file ccpdb.hpp.

bool loos::CCPDB::parseFrame ( void  )

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.

Definition at line 61 of file ccpdb.cpp.

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

The timestep is currently meaningless for CCPDB's, so we return a nominal 1e-3.

Implements loos::Trajectory.

Definition at line 73 of file ccpdb.hpp.

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