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

Table of all supported formats in MDAnalysis

File type

Description

Topology

Coordinates

Read

Write

ARC

Tinker file

CHEMFILES

use readers from chemfiles library

CONFIG

DL_Poly CONFIG file

COOR

NAMD binary restart file

CRD

CHARMM CARD file

CRDBOX

AMBER ASCII trajectories

DATA

LAMMPS data file

DCD

CHARMM, NAMD, or LAMMPS binary trajectory

DMS

DESRES Molecular Structure file

ENT

Standard PDB file

FHIAIMS

FHI-aims input file

GMS

GAMESS file

GRO

GROMACS structure file

GSD

HOOMD GSD file

HISTORY

DL_Poly HISTORY file

IN

FHI-aims input file

INPCRD

AMBER restart file

ITP

GROMACS portable topology file

LAMMPS

a LAMMPS DCD trajectory

LAMMPSDUMP

LAMMPS ascii dump file

MDCRD

AMBER ASCII trajectories

MMTF

MMTF file

MOL2

Tripos MOL2 file

NAMDBIN

NAMD binary restart file

NC

AMBER NETCDF format

NCDF

AMBER NETCDF format

PARM7

AMBER topology file

PARMED

ParmEd Structure

PDB

Standard PDB file

PDBQT

PDBQT file

PQR

PQR file

PRMTOP

AMBER topology file

PSF

CHARMM, NAMD, or XPLOR PSF file

RESTRT

AMBER restart file

TOP

AMBER topology file

TPR

GROMACS run topology file

TRJ

AMBER ASCII trajectories

TRR

GROMACS TRR trajectory

TRZ

IBIsCO or YASP binary trajectory

TXYZ

Tinker file

XML

HOOMD XML file

XPDB

Extended PDB file

XTC

GROMACS compressed trajectory

XYZ

XYZ file

Topology

Table of supported topology parsers and the attributes read

Format

Description

Attributes read

Attributes guessed

CONFIG

DL_Poly CONFIG file

names

masses, types

CRD

CHARMM CARD file

names, resnames, tempfactors

masses, types

DATA

LAMMPS data file

angles, bonds, charges, dihedrals, impropers

DMS

DESRES Molecular Structure file

atomnums, bonds, chainIDs, charges, names, resnames

types

GMS

GAMESS file

atomiccharges, names

masses, types

GRO

GROMACS structure file

names, resnames

masses, types

GSD

HOOMD GSD file

angles, bonds, charges, dihedrals, impropers, names, radii, resnames

HISTORY

DL_Poly HISTORY file

names

masses, types

IN, FHIAIMS

FHI-aims input file

elements, names

masses, types

LAMMPSDUMP

LAMMPS ascii dump file

masses

MMTF

MMTF file

altLocs, bonds, charges, icodes, models, names, occupancies, resnames, tempfactors

masses

MOL2

Tripos MOL2 file

bonds, charges, elements, names, resnames

masses

PDB, ENT

Standard PDB file

altLocs, chainIDs, elements, icodes, names, occupancies, record_types, resnames, tempfactors

masses, types

PDBQT

PDBQT file

altLocs, charges, icodes, names, occupancies, record_types, resnames, tempfactors

masses

PQR

PQR file

charges, icodes, names, radii, record_types, resnames

masses, types

PSF

CHARMM, NAMD, or XPLOR PSF file

angles, bonds, charges, dihedrals, impropers, names, resnames

TOP, PRMTOP, PARM7

AMBER topology file

angles, bonds, charges, dihedrals, impropers, names, resnames, type_indices

TPR

GROMACS run topology file

angles, bonds, charges, dihedrals, elements, impropers, molnums, moltypes, names, resnames

TXYZ, ARC

Tinker file

bonds, elements, names

masses

XML

HOOMD XML file

angles, bonds, charges, dihedrals, impropers, radii

XPDB

Extended PDB file

altLocs, chainIDs, icodes, names, occupancies, record_types, resnames, tempfactors

masses, types

XYZ

XYZ file

elements, names

masses, types

Coordinates

Table of supported coordinate readers and the information read

File type

Description

Velocities

Forces

ARC

Tinker file

CHEMFILES

use readers from chemfiles library

CONFIG

DL_Poly CONFIG file

COOR

NAMD binary restart file

CRD

CHARMM CARD file

CRDBOX

AMBER ASCII trajectories

DATA

LAMMPS data file

DCD

CHARMM, NAMD, or LAMMPS binary trajectory

DMS

DESRES Molecular Structure file

ENT

Standard PDB file

FHIAIMS

FHI-aims input file

GMS

GAMESS file

GRO

GROMACS structure file

GSD

HOOMD GSD file

HISTORY

DL_Poly HISTORY file

IN

FHI-aims input file

INPCRD

AMBER restart file

LAMMPS

a LAMMPS DCD trajectory

LAMMPSDUMP

LAMMPS ascii dump file

MDCRD

AMBER ASCII trajectories

MMTF

MMTF file

MOL2

Tripos MOL2 file

NAMDBIN

NAMD binary restart file

NC

AMBER NETCDF format

NCDF

AMBER NETCDF format

PARMED

ParmEd Structure

PDB

Standard PDB file

PDBQT

PDBQT file

PQR

PQR file

RESTRT

AMBER restart file

TRJ

AMBER ASCII trajectories

TRR

GROMACS TRR trajectory

TRZ

IBIsCO or YASP binary trajectory

TXYZ

Tinker file

XPDB

Extended PDB file

XTC

GROMACS compressed trajectory

XYZ

XYZ file