Skip to content

File Formats

Structures

aseview reads structures with ASE, so every format ase.io.read supports works: xyz/extxyz, cif, pdb, VASP POSCAR/CONTCAR/XDATCAR/OUTCAR/vasprun.xml, ASE .traj, Gaussian, ORCA, Quantum ESPRESSO, LAMMPS, CP2K and many more. Compressed files (.gz, .bz2, .xz) are read directly.

ASE detects the format from the file name and content. When it guesses wrong, name the format:

aseview pw.in -f espresso-in
aseview system.data -f lammps-data
MolecularViewer(read("pw.in", format="espresso-in"))

From Python, viewers also accept a path (every frame is read), a glob such as "frames/*.xyz", or viewer-frame dicts (see MolecularData).

PDB residue names (resname) are available as fragment labels in Python, the CLI and the VS Code viewer. Atoms sharing a residue name share a fragment; the original residue names and numbers remain in the frame's per-atom arrays.

Other inputs

MD topology and coordinates

Install the optional MD reader:

pip install "aseview[md]"
aseview trajectory.dcd --topology system.pdb -i ::10 -o trajectory.html

This Python/CLI input path uses MDAnalysis and converts selected frames to ASE Atoms. The tested topology formats are PDB, PSF, GRO and Amber prmtop/parm7/top; coordinate trajectories are DCD, XTC and TRR. OpenMM's CHARMM DCD output is supported. The Node-based VS Code extension keeps its existing format support; installing this Python extra does not change it.

from aseview import MolecularViewer, read_trajectory

viewer = MolecularViewer("trajectory.dcd", topology="system.pdb", index="::10")
viewer.save_html("trajectory.html")

atoms = read_trajectory("trajectory.dcd", topology="system.pdb", index=-1)[0]

Topology supplies atom identity and residue metadata, while each coordinate frame supplies its positions and box. Coordinates and cell vectors use Å. Atom rows are preserved: use the same topology and atom order that produced the trajectory, including any OpenMM atomSubset. A count mismatch is an error; equal counts cannot prove that the atom identities or order match. Elements missing from topology are inferred from atom names with a warning and recorded provenance. Force-field types are not interpreted as element symbols. The viewer continues to infer displayed bonds from distances.

Each frame uses its own trajectory box; a missing box is nonperiodic and does not inherit the topology's box. Residue and atom metadata are stored in Atoms.arrays; source frame/segment and time provenance are in Atoms.info (see read_trajectory()). DCD times are derived from the file header, which need not represent a continuous absolute simulation clock across restarts.

Multiple coordinate files use one matching topology, in the supplied order:

aseview part1.dcd part2.dcd --topology system.pdb -i ::10 -v molecular -o joined.html

The index is applied to each file before concatenation. Several CLI input files still choose the overlay viewer by default; use -v molecular for serial playback or molecular annotations. Files are not sorted by time, deduplicated or stitched across restart boundaries. Python accepts an ordered list of paths in the same way. Index selection occurs before converted frames are retained, but saved HTML still embeds all selected frames; this is not unlimited streaming.

For XTC/TRR, MDAnalysis may cache frame offsets in hidden .<filename>_offsets.npz sidecar files beside a writable input. Read-only directories use in-memory offset calculation instead. Trajectory files are not rewritten.

Use --topology-format when topology detection needs an override and -f for the coordinate format. The equivalent Python controls are topology_format and format. MD format names are case-insensitive. Coordinate-only DCD/XTC/TRR input needs --topology; CP2K-specific DCD remains available explicitly through -f cp2k-dcd without MD topology controls.

Specialized viewers

Input Viewer Notes
ORCA .hess NormalViewer --hess / NormalViewer.from_orca()
VASP OUTCAR (IBRION=5/6) NormalViewer --hess / NormalViewer.from_vasp()
Gaussian CUBE, VASP CHGCAR/CHGDIFF SurfaceViewer Needs the surface extra
JSONL manifest, extxyz with surface paths SurfaceViewer Surface sequences, see Isosurfaces

Copying structures out

The viewer toolbar copies the current frame or every frame, and the fragment selector copies selections, in four formats:

Format Cell Fixed atoms
xyz — —
extxyz ✓ ✓ (fixed / move-mask arrays)
cif ✓ —
POSCAR ✓ ✓ (selective dynamics)