Trajectory Management
mdxplain supports all MDTraj-compatible trajectory formats (xtc, dcd, trr, pdb, h5, netcdf, etc.) and provides powerful tools for organizing and manipulating multiple trajectories. Tags enable systematic organization for comparative analyses, while labels add residue metadata like consensus nomenclature or fragment definitions.
# Load trajectories (supports all MDTraj formats)
# See: http://mdtraj.org/latest/load_functions.html
pipeline.trajectory.load_trajectories("data/system_A/")
pipeline.trajectory.load_trajectories("data/system_B/")
# Add residue labels and metadata
pipeline.trajectory.add_labels(traj_selection="all")
# Add tags for organizing trajectories (enables tag-based selection)
pipeline.trajectory.add_tags(0, ["wild_type", "system_A"])
pipeline.trajectory.add_tags(1, ["mutant", "system_B"])
# Trajectory manipulation
pipeline.trajectory.cut_traj(0, start=100, end=5000) # Trim frames
pipeline.trajectory.select_atoms(selection="protein") # Atom selection
Consensus Nomenclature for Structured Proteins
For proteins with established numbering schemes (GPCRs, kinases, G-proteins), consensus nomenclature enables biologically meaningful feature selection. This allows selecting structurally/functionally equivalent positions across different proteins.
# Example: GPCR-G-Protein complex (3SN6)
# Define two fragments with different consensus schemes
pipeline.trajectory.add_labels(
fragment_definition={
"cgn_a": (0, 349), # G-protein alpha subunit
"beta2": (349+340+58, 349+340+58+284) # Beta-2 adrenergic receptor
},
fragment_type={
"cgn_a": "cgn", # Common Galpha Numbering
"beta2": "gpcr" # GPCRdb numbering
},
fragment_molecule_name={
"cgn_a": "gnas2_bovin", # UniProt entry for G-alpha-s
"beta2": "adrb2_human" # UniProt entry for beta-2 receptor
},
consensus=True, # Enable consensus numbering
aa_short=False # Use full amino acid names (THR vs T)
)
# Now you can select features using consensus patterns:
# "consensus 7x49-7x53" => NPxxY region on TM7
# "consensus G.H5.*" => G-protein helix 5
# "consensus 3x* and consensus 6x*" => TM3-TM6 interface