Extracts positional data from MD trajectories. The output can be filtered simultaneously by frame selections and CHARMM-style atom selections.


Extracts frame 100, 200, and 300 from membrane.dcd.

f_extract.py membrane.psf membrane.dcd output.dcd --frames 100:301:100

Extracts the complete trajectories of all atoms that are at most five Angstroms away from the origin in frame 10 (the eleventh frame) while wrapping atom coordinates periodically back to the simulation box.

f_extract.py membrane.psf membrane.dcd output.dcd \
             --charmm 'point 0.0 0.0 0.0 5.0' \
             --selection_frame 10 \

Extracts the last frame of a trajectory.

f_extract.py membrane.psf membrane.dcd output.dcd --frames -1

Shows usage.

f_extract.py -h

Supported formats

All file formats of MDAnalysis are supported. Input files may be compressed using gzip or bzip2.


File formats are recognized by file extension. Therefore, you have to stick to the standard file extensions.


Some output formats may only support writing a single frame.


Only rectangular simulation boxes are currently supported.

Command line interface


The topology file to work with.


The coordinate file to work with.


Output file to write to.


The zero-based frame selection that allows for slicing. The general syntax is ‘start:stop:step’ which would select all frames from start to stop (excluding stop) while skipping step frames inbetween. Selecting single frames by specifying a single number is possible. Negative indices count backwards from the end of the trajectory.


Please refer to the section on atom selections.


Input frame to select on (zero-based). Only interesting for geometric criteria.


Progress report every time this many frames have been written.


Whether to overwrite existing output files.


Whether to wrap atoms for spatial selection criteria back to the original cell.

Open Issues


Single frame PDB output not functional.


Progress output: wrap last line.


Allow for comma-separated list of frames.

Internal functions


Wrapper function.

Table Of Contents

Previous topic

Welcome to finley’s documentation!

Next topic


This Page