Expand description
Chemfiles is a multi-language library written in modern C++ for reading and writing from and to molecular trajectory files. These files are created by your favorite theoretical chemistry program, and contains information about atomic or residues names and positions. Some format also have additional information, such as velocities, forces, energy, …
This crate expose the C API of chemfiles to Rust, and make all the functionalities accessible. For more information on the C++ library, please see its documentation. Specifically, the following pages are worth reading:
- The overview of the classes organization;
- The list of supported formats;
- The documentation for the selection language;
Structs
- An
Atomis a particle in the currentFrame. It stores the following atomic properties: - An analog to a mutable reference to an atom (
&mut Atom) - An analog to a reference to an atom (
&Atom) - Error type for Chemfiles.
FormatMetadatacontains metadata associated with one format.- A
Framecontains data from one simulation step: the current unit cell, the topology, the positions, and the velocities of the particles in the system. If some information is missing (topology or velocity or unit cell), the corresponding data is filled with a default value. - A
Matchis a set of atomic indexes matching a given selection. It can mostly be used like a&[usize]. MemoryTrajectoryReaderis a handle for aTrajectoryin memory.- An iterator over the properties in an atom/frame/residue
- A
Residueis a group of atoms belonging to the same logical unit. They can be small molecules, amino-acids in a protein, monomers in polymers, etc. - An analog to a reference to a residue (
&Residue) - A
Selectionallow to select atoms in aFrame, from a selection language. The selection language is built by combining basic operations. Each basic operation follows the<selector>[(<variable>)] <operator> <value>structure, where<operator>is a comparison operator in== != < <= > >=. - A
Topologycontains the definition of all the atoms in the system, and the liaisons between the atoms (bonds, angles, dihedrals, …). It will also contain all the residues information if it is available. - An analog to a reference to a topology (
&Topology) - The
Trajectorytype is the main entry point when using chemfiles. ATrajectorybehave a bit like a file, allowing to read and/or writeFrame. - An
UnitCellrepresent the box containing the atoms, and its periodicity. - An analog to a mutable reference to an unit cell (
&mut UnitCell) - An analog to a reference to an unit cell (
&UnitCell)
Enums
- Possible bond order associated with bonds
- Available unit cell shapes.
- A
Propertyis a piece of data that can be associated with anAtomor aFrame. - Possible causes of error in chemfiles
Functions
- Read configuration data from the file at
path. - Get the list of formats known by chemfiles, as well as all associated metadata.
- Get the format that chemfiles would use to read a file at the given
path. - Use
callbackfor every chemfiles warning. The callback will be passed the warning message. This will drop any previous warning callback. - Get the version of the chemfiles library.