From PDB to Solvated Box#

Task: Transform a dry protein structure from the PDB into a system fully prepared for simulation (water box + ions) in seconds.

One of the most tedious tasks in simulation setup is building the water box and ensuring the correct ion concentration. MolSysMT makes this a one-liner.

PDB files and PDB text enter through the same native handler before this workflow starts. Alternate-location sites, explicit LINK/SSBOND/CONECT connectivity, formal charges, and REMARK 350 bioassembly operators are therefore interpreted consistently. Use msm.convert(..., return_report=True) first when you need an exhaustive record of any PDB limitation or canonicalization.

import molsysmt as msm
from molsysmt import systems

# Load the T4 Lysozyme (dry)
lysozyme = systems['T4 lysozyme L99A']['181l.pdb']

# Solvate with 0.15 M NaCl in a cubic box with 1.0 nm clearance
solvated_system = msm.build.solvate(lysozyme, box_shape='cubic', clearance='1.0 nm', 
                                    salt_concentration='0.15 molar')

msm.info(solvated_system)

Verification#

The system now contains thousands of water molecules and the necessary sodium and chloride ions to reach the desired concentration.

box = msm.get(solvated_system, element='system', box=True)
lengths, angles = msm.pbc.get_lengths_and_angles_from_box(box)
volume = msm.pbc.get_volume_from_lengths_and_angles(lengths, angles)

print(f"Box lengths: {lengths}")
print(f"Box angles: {angles}")
print(f"Box volume: {volume}")
msm.view(solvated_system)