Simple python scripts (and Gromacs commands) for manipulating MD trajectories.
Info & Extraction
frame_info.py
Print trajectory metadata (frame count, timestep, box, atoms).
extract_frames.py
Extract a frame range with optional stride.
extract_pdb.py
Save a single frame as a PDB file.
Selection & Filtering
select_by_rmsd.py
Keep frames below/above an RMSD threshold.
select_nucleic_trajectory.py
Extract only nucleic acid atoms from a trajectory.
find_closest_frames_all_trajectories.py
Find frames closest to target Q-RMSD combinations across trajectories.
Conversion & Re-encoding
convert_traj.py
Convert trajectory format (e.g. TRR to XTC).
convert_traj_with_selection.py
Convert format with atom selection filter.
reencode_trajectory.py
Re-encode with new stride/selection to reduce file size.
merge_trajectories.py
Concatenate multiple trajectories (mdtraj).
Alignment & Reordering
align_trajectory.py
Align all frames to a reference (least-squares fit).
traj_reorder_index_atoms.py
Reorder atoms in trajectory based on a mapping file.
GROMACS Commands
Convert trajectory
Convert trajectory format (e.g. TRR to XTC).
Convert structure
Convert structure format (e.g. GRO to PDB).
Extract time range
Extract frames between time -b and -e (ps), with step -dt.
Remove PBC jumps
Prevent molecules from jumping across periodic boundaries.
Center + fix PBC
Center the solute in the box and make whole molecules.
Fit to reference
Remove overall rotation and translation by fitting to a reference.
Strip solvent
Keep only the solute (remove water and ions).
Amber / cpptraj
Convert to XTC
Convert an Amber NetCDF trajectory to XTC format.
Extract first frame as PDB
Save the first frame as a PDB topology file.