Menu

Tree [a63198] master /
 History

HTTPS access


File Date Author Commit
 cmake 2017-12-07 Guillaume Fraux Guillaume Fraux [b4d641] Always set C++11 flags for compilers
 doc 2018-03-13 Jonathan Fine Jonathan Fine [7e1114] Added Residue property functions to Doxygen
 examples 2017-12-06 Guillaume Fraux Guillaume Fraux [c51aa2] Fix out of bounds access in example
 external 2018-02-21 Guillaume Fraux Guillaume Fraux [f85691] Update MMTF dependencies to point to chemfiles ...
 include 2018-03-16 Jonathan Fine Jonathan Fine [a29634] Assign residue connectivity from a table
 scripts 2018-03-16 Jonathan Fine Jonathan Fine [a29634] Assign residue connectivity from a table
 src 2018-03-16 Jonathan Fine Jonathan Fine [a29634] Assign residue connectivity from a table
 tests 2018-03-16 Jonathan Fine Jonathan Fine [a29634] Assign residue connectivity from a table
 .gitignore 2017-05-16 Guillaume Fraux Guillaume Fraux [ab0554] Add a Configuration class reading type renaming...
 .travis.yml 2017-12-10 Guillaume Fraux Guillaume Fraux [87828e] Allow failures with ICC and PGI
 AUTHORS 2018-02-21 Guillaume Fraux Guillaume Fraux [a38afa] Add @frodofine to AUTHORS
 CHANGELOG.md 2018-03-16 Jonathan Fine Jonathan Fine [5d53d8] Updated change log for residue connectivity
 CMakeLists.txt 2018-02-12 Jonathan Fine Jonathan Fine [29964c] MMTF read support
 Contributing.md 2017-02-25 Guillaume Fraux Guillaume Fraux [7616ba] Add a Contributing.md file
 Doxyfile.in 2017-02-25 Guillaume Fraux Guillaume Fraux [57ae85] Reorganise documentation sources
 LICENSE 2017-04-06 Guillaume Fraux Guillaume Fraux [bf1734] Relicense to 3-clauses BSD license
 README.md 2018-02-27 Jonathan Fine Jonathan Fine [69e50f] Initial SDF Support
 VERSION 2017-12-14 Guillaume Fraux Guillaume Fraux [f4a087] Update master to 0.9.0-dev
 appveyor.yml 2017-10-12 Guillaume Fraux Guillaume Fraux [33fb13] Remove static lib builders on Appveyor
 codecov.yml 2017-07-18 Guillaume Fraux Guillaume Fraux [4bbf79] Lower codecov target

Read Me

Chemfiles: a library for reading and writing chemistry files

Documentation
Build Status -- Linux & OSX
Build Status -- Windows
Code Coverage
Gitter
DOI

Chemfiles is a modern and high-quality library for reading and writing
trajectory files created by computational chemistry simulations programs. To help you access information (atomic positions, velocities, names, topology, etc.) about these files, Chemfiles provides an interface that is
- unified: the same code will work with all supported formats;
- simple: the interface is easy to use and extensively documented.

You can use Chemfiles to conduct post-processing analysis and extract physical
information about the systems you're simulating, to convert files from one
format to another, or to write trajectories with your own simulation software.

This repository contains the core of the Chemfiles library — a programmer
interface written in C++11, with a C99 interface. If you want a ready-to-use
programs for trajectory analysis, use cfiles.
You can also use Chemfiles from other languages: Python 2&3,
Fortran, Rust,
and Julia.

Is Chemfiles for You?

We created Chemfiles to be able to write analysis algorithms once and use them
with all the existing trajectory formats in
cfiles; and to provide input/output
capacities in two molecular simulation engines. You might want to use it too, if
any of these apply to your use case:

  • you don't want to spend time writing and debugging a file parser;
  • you use binary formats because they are faster and take up less disk space;
  • you write analysis algorithms and want to read more than one trajectory
    format;
  • you write simulation software and want to use more than one format for input or output.

There are other libraries
doing the roughly the same job as Chemfiles, have a look at them if Chemfiles is
not for you. Here we also say why we could not use them instead of creating a
new library.

  • OpenBabel is a C++ library providing
    convertions between more than 110 formats. It is more complex than chemfiles,
    and distributed under the GPL license.
  • VMD molfile plugins are a collection
    of plugins witten in C and C++ used by VMD to read/write trajectory files.
    It does not support non-constant number of atoms in a trajectory, and do not
    provide a lot of documentation.
  • MDTraj, MDAnalyis,
    cclib are Python libraries providing analysis and
    read capacities for trajectories. Unfortunely, they are only usable from
    Python.

Contact/Contribute

Chemfiles is free and open source. Your contributions are
always welcome!

If you have questions or suggestions, or need help, please open an [issue] or join us on our [Gitter] chat room.

If you are using Chemfiles in a published scientific study, please cite us using the following DOI: https://doi.org/10.5281/zenodo.800663.

Chemfiles Features

  • Reads both text (XYZ, PDB, ...) and binary (NetCDF, TNG, ...) file formats;
  • Filters atoms with a rich selection language;
  • Supports non-constant numbers of atoms in trajectories;
  • Easy-to-use programming interface in Python, C++, C, Fortran 95, Julia and Rust;
  • Cross-platform and usable from Linux, OS X and Windows;
  • Open source and freely available (3-clauses BSD license);

Supported File Formats

Chemfiles can read and write files in the following formats:
- XYZ;
- PDB;
- Amber NetCDF
- LAMMPS data files;
- Tinker XYZ files (.arc files);
- BIOVIA SDF files;

Chemfiles can also read but not (yet) write files in the following formats:
- TNG;
- LAMMPS trajectory;
- GROMACS formats: .gro; .xtc; .trj; .trr;
- CHARMM DCD files;
- TRIPOS mol2 files;
- Molden files;
- MacroMolecular Transmission Format (MMTF) files;

See the issue list
for planned formats. If you need another format, open a new issue with a link to
the format definition, or — even better — write the code and
contribute it!

Getting Started

Here, we'll help you get started with the C++ and C interface. If you want to
use Chemfiles with another language, please refer to the corresponding
documentation.

Installing Compiled Packages

We provide compiled packages of the latest Chemfiles release for Linux
distributions. You can use your package manager to download them
here.

We also provide conda packages in the conda-forge community channel for Linux
and OS X. This package provides the C++, C and Python interfaces. Install the conda package by running:

conda install -c conda-forge chemfiles

Find more information about packages in the documentation.

Building from Source

You will need cmake and a C++11 compiler.

git clone https://github.com/chemfiles/chemfiles
cd chemfiles
mkdir build
cd build
cmake ..
make
make install

Usage Examples

This is what the interface looks like in C++:

// C++ version
#include <iostream>
#include "chemfiles.hpp"

int main() {
    chemfiles::Trajectory trajectory("filename.xyz");

    auto frame = trajectory.read();
    std::cout << "There are " << frame.natoms() << " atoms in the frame" << std::endl;

    auto positions = frame.positions();
    // Do awesome science with the positions here !
}

License

Guillaume Fraux created and maintains Chemfiles, which is distributed under the
3 clauses BSD license. By contributing to Chemfiles, you agree to
distribute your contributions under the same license.

The AUTHORS file lists all contributors to Chemfiles. Many thanks to
all of them!

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.