Wrap and Center MD System - k-ngo/CATMD GitHub Wiki
Wrap and Center MD System
Overview and Methodology
What It Does
This tool corrects for periodic boundary condition (PBC) artifacts in molecular dynamics trajectories by wrapping and re-centering the system. It realigns fragmented molecules, proteins, or complexes split across box boundaries, creating cleaner, more interpretable trajectories for analysis and visualization.
How It Works
-
Objective: Restore physical continuity by repositioning atoms/molecules within the simulation box.
-
Process:
- Atom Wrapping: Moves selected atoms back into the primary unit cell using one of several strategies (simple, residue-based, or chain-based).
- Centering: Centers the system (or a specified reference part) at the geometric center of the box, with optional padding offset.
- Output: Saves a new, cleaned-up trajectory for downstream use.
-
Use Cases:
- Correcting visual fragmentation of chains, ligands, or complexes.
- Preparing systems for RMSD, interaction analysis, or visualization.
- Addressing issues caused by PBC in long simulations.
Configuration and Inputs
Prerequisites
- Requires a loaded trajectory.
- Reasonable initial selection for system and centering reference.
Key Configuration Options
-
System Definition:
system_sel
: Atom group to wrap and center (e.g.,protein
,protein or resname LIG
).ref_sel
: Reference group for centering (e.g.,name CA
,resid 1-100
); defaults tosystem_sel
if blank.
-
Wrapping Method:
'Simple Wrap'
: Wraps all atoms based on primary unit cell and centers on reference center of mass (COM). Suitable for compact, continuous systems.'Compound Wrap (residues)'
: Keeps residues intact while wrapping, then centers. Best for ligands or disjointed residues.'Compound Wrap (chains)'
: Wraps by chain/segment, preserving multimer structure. Ideal for multi-chain complexes or membranes.'No Wrap, Center Only'
: Applies no wrapping. Only centers the reference selection.
-
Padding:
padding
: Shifts the center slightly off from the geometric center. Useful for manual adjustments when molecules remain near box edges after centering.
-
Frame Range:
begin_frame
,end_frame
,step
: Select a frame subset to process (e.g., every 10th frame or specific trajectory region).
-
Output Settings:
output_traj
: Filename for the wrapped and centered trajectory.
Output
-
Wrapped Trajectory:
- Saved to:
wrapped.dcd
(or user-specified name).
- Saved to:
-
Console Output:
- Confirmation of method, selections, and total number of frames processed.
- Logs selection sizes and method parameters.
Example Scenarios
Protein–Ligand Complex
- Scenario: Ligand diffuses outside the box.
- Method: Use
Compound Wrap (residues)
withsystem_sel='protein or resname LIG'
. - Outcome: Ligand remains in visual contact with the protein throughout.
Multimeric Protein System
- Scenario: Tetrameric protein with chains split.
- Method: Use
Compound Wrap (chains)
withref_sel='name CA'
. - Outcome: Each chain remains intact and centered.
Membrane Protein in Lipid Bilayer
- Scenario: Protein appears shifted out of membrane slab.
- Method: Use
Simple Wrap
orNo Wrap, Center Only
to reposition the protein. - Tip: Adjust
padding
to fine-tune center placement without disrupting membrane alignment.
Usage Tips
-
Reference Selection:
- Use backbone atoms (
name CA
) for centering proteins. - For entire systems or ligand focus, use full selections like
protein or resname LIG
.
- Use backbone atoms (
-
Padding:
- Leave at
0.0
unless specific offset is needed. - Try
2.0–5.0
Å for gentle shifts if visual artifacts persist.
- Leave at
-
Wrapping Strategy:
- Avoid
Simple Wrap
for multi-chain or fragmented systems. - Use
Compound Wrap (residues)
or(chains)
for modular integrity.
- Avoid