Interface for formats¶
Formatclass defines the interface to implement in order to add a new format to chemfiles.
It is possible to implement only one of
Format::write. In that case, only the corresponding operations will be available from the corresponding
Subclassed by chemfiles::AmberNetCDFFormat, chemfiles::CMLFormat, chemfiles::mmCIFFormat, chemfiles::MMTFFormat, chemfiles::Molfile< F >, chemfiles::TextFormat, chemfiles::TNGFormat, chemfiles::TRRFormat, chemfiles::XTCFormat
read_step(size_t step, Frame &frame)¶
Read a specific
stepfrom the trajectory file.
Read the next step from the trajectory file.
write(const Frame &frame)¶
Write a frame to the trajectory file.
nsteps() = 0¶
Get the number of frames in the associated file. This function can be expensive to call since it may needs to scan the whole file.
The number of frames
These classes implement the format interface defined previously.
PDBFormat: public chemfiles::TextFormat¶
PDB file format reader and writer.
For multi-frame trajectories, we follow the convention of VMD to use multiple
ENDrecords, separating the steps.
LAMMPSDataFormat: public chemfiles::TextFormat¶
LAMMPS Data file format reader and writer.
LAMMPS data files are not fully stand-alone, as one needs to know the atom style to read the data. This reader will try to guess the atom style by checking the first line of the header for
atom_style <style>, and by reading any comment after the
Atomssection name. If no atom style is specified, the code default to
fulland send a warning.
The code alse tries to read atomic names at the end of data lines. For example, the atom at index 44 will have
C2as atomic name.
44 44 2 0.000000 1.094000 2.061000 69.552002 # C2 RES
TinkerFormat: public chemfiles::TextFormat¶
Tinker XYZ file format.
The format is described here: http://chembytes.wikidot.com/tnk-tut00#toc2. Additionally to the original Tinker XYZ format, chemfiles also supports the files with unit cell data, as introduced in Tinker 6.3.
This format is associated with the .arc extension, but not the .xyz extension, which is used for the standard XYZ format.
Molfile: public chemfiles::Format¶
Use of VMD Molfile plugins as format reader. This class is templated by a value in the
List all the VMD molfile plugins enabled. For more documentation about VMD molfile plugins, please see: http://www.ks.uiuc.edu/Research/vmd/plugins/molfile/
DCD binary file format.
Gromacs .trj file format.
Lammps trajectory files.
Molden file format.