Format overview¶
MDAnalysis can read topology or coordinate information from a wide variety of file formats. The emphasis is on formats used in popular simulation packages. By default, MDAnalysis figures out formats by looking at the extension, unless the format is explicitly specified with the format
or topology_format
keywords.
Below is a table of formats in MDAnalysis, and which information can be read from them. A topology file supplies the list of atoms in the system, their connectivity and possibly additional information such as B-factors, partial charges, etc. The details depend on the file format and not every topology file provides all (or even any) additional data.
Important
File formats are complicated and not always well defined. MDAnalysis tries to follow published standards but this can sometimes surprise users. It is highly recommended that you read the page for your data file format instead of assuming certain behaviour. If you encounter problems with a file format, please get in touch with us.
As a minimum, all topology parsers will provide atom ids
, atom types
, masses
, resids
, resnums
, and segids
. They will also assign all Atoms to Residues and all Residues to Segments. For systems without residues and segments, this results in there being a single Residue and Segment to which all Atoms belong. See Topology attributes for more topology attributes.
Often when data is not provided by a file, it will be guessed based on other data in the file. In this scenario, MDAnalysis will issue a warning. See Guessing for more information.
If a trajectory is loaded without time information, MDAnalysis will set a default timestep of 1.0 ps, where the first frame starts at 0.0 ps. In order to change these, pass the following optional arguments to Universe:
dt
: the timestep
time_offset
: the starting time from which to calculate the time of each frame
File type |
Description |
Topology |
Coordinates |
Read |
Write |
---|---|---|---|---|---|
Tinker file |
✓ |
✓ |
✓ |
||
use readers from chemfiles library |
✓ |
✓ |
✓ |
||
DL_Poly CONFIG file |
✓ |
✓ |
✓ |
||
NAMD binary restart file |
✓ |
✓ |
✓ |
||
CHARMM CARD file |
✓ |
✓ |
✓ |
✓ |
|
AMBER ASCII trajectories |
✓ |
✓ |
|||
LAMMPS data file |
✓ |
✓ |
✓ |
✓ |
|
CHARMM, NAMD, or LAMMPS binary trajectory |
✓ |
✓ |
✓ |
||
DESRES Molecular Structure file |
✓ |
✓ |
✓ |
||
Standard PDB file |
✓ |
✓ |
✓ |
✓ |
|
FHI-aims input file |
✓ |
✓ |
✓ |
✓ |
|
GAMESS file |
✓ |
✓ |
✓ |
||
GROMACS structure file |
✓ |
✓ |
✓ |
✓ |
|
HOOMD GSD file |
✓ |
✓ |
✓ |
||
DL_Poly HISTORY file |
✓ |
✓ |
✓ |
||
FHI-aims input file |
✓ |
✓ |
✓ |
✓ |
|
AMBER restart file |
✓ |
✓ |
|||
GROMACS portable topology file |
✓ |
✓ |
|||
a LAMMPS DCD trajectory |
✓ |
✓ |
✓ |
||
LAMMPS ascii dump file |
✓ |
✓ |
✓ |
||
AMBER ASCII trajectories |
✓ |
✓ |
|||
MMTF file |
✓ |
✓ |
✓ |
||
Tripos MOL2 file |
✓ |
✓ |
✓ |
✓ |
|
NAMD binary restart file |
✓ |
✓ |
✓ |
||
AMBER NETCDF format |
✓ |
✓ |
|||
AMBER NETCDF format |
✓ |
✓ |
✓ |
||
AMBER topology file |
✓ |
✓ |
|||
ParmEd Structure |
✓ |
✓ |
✓ |
✓ |
|
Standard PDB file |
✓ |
✓ |
✓ |
✓ |
|
PDBQT file |
✓ |
✓ |
✓ |
✓ |
|
PQR file |
✓ |
✓ |
✓ |
✓ |
|
AMBER topology file |
✓ |
✓ |
|||
CHARMM, NAMD, or XPLOR PSF file |
✓ |
✓ |
|||
AMBER restart file |
✓ |
✓ |
|||
AMBER topology file |
✓ |
✓ |
|||
GROMACS run topology file |
✓ |
✓ |
|||
AMBER ASCII trajectories |
✓ |
✓ |
|||
GROMACS TRR trajectory |
✓ |
✓ |
✓ |
||
IBIsCO or YASP binary trajectory |
✓ |
✓ |
✓ |
||
Tinker file |
✓ |
✓ |
✓ |
||
HOOMD XML file |
✓ |
✓ |
|||
Extended PDB file |
✓ |
✓ |
✓ |
||
GROMACS compressed trajectory |
✓ |
✓ |
✓ |
||
XYZ file |
✓ |
✓ |
✓ |
✓ |
Topology¶
Format |
Description |
Attributes read |
Attributes guessed |
---|---|---|---|
DL_Poly CONFIG file |
names |
masses, types |
|
CHARMM CARD file |
names, resnames, tempfactors |
masses, types |
|
LAMMPS data file |
angles, bonds, charges, dihedrals, impropers |
||
DESRES Molecular Structure file |
atomnums, bonds, chainIDs, charges, names, resnames |
types |
|
GAMESS file |
atomiccharges, names |
masses, types |
|
GROMACS structure file |
names, resnames |
masses, types |
|
HOOMD GSD file |
angles, bonds, charges, dihedrals, impropers, names, radii, resnames |
||
DL_Poly HISTORY file |
names |
masses, types |
|
FHI-aims input file |
elements, names |
masses, types |
|
LAMMPS ascii dump file |
masses |
||
MMTF file |
altLocs, bfactors, bonds, charges, icodes, models, names, occupancies, resnames |
masses |
|
Tripos MOL2 file |
bonds, charges, names, resnames |
masses |
|
ParmEd Structure |
altLocs, angles, bonds, chainIDs, charges, cmaps, dihedrals, elements, epsilon14s, epsilons, gbscreens, impropers, names, nbindices, occupancies, resnames, rmin14s, rmins, solventradii, tempfactors, ureybradleys |
||
Standard PDB file |
altLocs, bonds, chainIDs, elements, icodes, names, occupancies, record_types, resnames, tempfactors |
masses, types |
|
PDBQT file |
altLocs, charges, icodes, names, occupancies, record_types, resnames, tempfactors |
masses |
|
PQR file |
charges, icodes, names, radii, record_types, resnames |
masses, types |
|
CHARMM, NAMD, or XPLOR PSF file |
angles, bonds, charges, dihedrals, impropers, names, resnames |
||
AMBER topology file |
angles, bonds, charges, dihedrals, impropers, names, resnames, type_indices |
elements |
|
GROMACS run topology file |
angles, bonds, charges, dihedrals, impropers, molnums, moltypes, names, resnames |
||
Tinker file |
bonds, names |
masses |
|
HOOMD XML file |
angles, bonds, charges, dihedrals, impropers, radii |
||
Extended PDB file |
altLocs, bonds, chainIDs, icodes, names, occupancies, record_types, resnames, tempfactors |
masses, types |
|
XYZ file |
elements, names |
masses, types |
Coordinates¶
File type |
Description |
Velocities |
Forces |
---|---|---|---|
Tinker file |
|||
use readers from chemfiles library |
|||
DL_Poly CONFIG file |
✓ |
||
NAMD binary restart file |
|||
CHARMM CARD file |
|||
AMBER ASCII trajectories |
|||
LAMMPS data file |
✓ |
||
CHARMM, NAMD, or LAMMPS binary trajectory |
|||
DESRES Molecular Structure file |
✓ |
||
Standard PDB file |
|||
FHI-aims input file |
✓ |
||
GAMESS file |
|||
GROMACS structure file |
✓ |
||
HOOMD GSD file |
|||
DL_Poly HISTORY file |
✓ |
||
FHI-aims input file |
✓ |
||
AMBER restart file |
|||
a LAMMPS DCD trajectory |
|||
LAMMPS ascii dump file |
|||
AMBER ASCII trajectories |
|||
MMTF file |
|||
Tripos MOL2 file |
|||
NAMD binary restart file |
|||
AMBER NETCDF format |
✓ |
✓ |
|
AMBER NETCDF format |
✓ |
✓ |
|
ParmEd Structure |
|||
Standard PDB file |
|||
PDBQT file |
|||
PQR file |
|||
AMBER restart file |
|||
AMBER ASCII trajectories |
|||
GROMACS TRR trajectory |
✓ |
✓ |
|
IBIsCO or YASP binary trajectory |
✓ |
||
Tinker file |
|||
Extended PDB file |
|||
GROMACS compressed trajectory |
|||
XYZ file |