solvation
Solvation and ionization routines for MD simulation systems.
funcget_water_boxes(wbox, nx, ny, nz)Generate a list of translated water box atom groups to form a larger box. The wbox universe should have its left bottom corner in [0, 0, 0].
Notes
- Residue IDs are incremented to ensure uniqueness across copies.
paramwboxmda.UniverseThe input water box as an MDAnalysis Universe object.
paramnxintNumber of repetitions along the x-axis.
paramnyintNumber of repetitions along the y-axis.
paramnzintNumber of repetitions along the z-axis.
Returns
list of mda.AtomGroupList of AtomGroups, each corresponding to a translated copy of the water box.
funcsolvate(system, prune_in_z=False, remove_sphere=None) → mda.UniverseFill a rectangular simulation box with water and remove clashing molecules.
paramsystemmda.UniverseThe solute system with box dimensions set. Must have a rectangular box (90-degree angles).
paramprune_in_zbool= FalseIf True, remove water molecules whose z-coordinates fall between the lipid layer boundaries (offset by 10 A inward). Default is False.
paramremove_spheretuple of float or None= NoneIf provided, a tuple (cx, cy, cz, r) specifying the center and radius of a sphere within which water molecules are removed.
Returns
MDAnalysis.UniverseSolvated system with clashing and out-of-bounds waters removed.
Also written to solvated.pdb.
funcremove_clashes(in_box, selection='water')Remove residues involved in inter-residue atomic clashes.
Find atom pairs within 0.5 A that belong to different residues in the given selection and remove both entire residues for each clashing pair.
paramin_boxmda.UniverseThe system to check for clashes.
paramselectionstr= 'water'MDAnalysis selection string identifying atoms to check.
Default is "water".
Returns
MDAnalysis.UniverseSystem with clashing residues removed, preserving box dimensions.
funcionize(u, num_na, num_cl, seed=None, min_distance=5.0)Replace water molecules in a Universe with Na+ and Cl- ions.
This function randomly selects water molecules in the given MDAnalysis Universe and replaces them with sodium (Na+) and chloride (Cl-) ions, ensuring a minimum distance from non-water atoms. The replacement is performed by renaming the oxygen atom of the selected water residue and removing the hydrogen atoms. The resulting Universe contains the original atoms (except the removed hydrogens) and the newly created ions.
Notes
- The function assumes that the Universe contains standard water residues and atom naming conventions.
paramumda.UniverseThe MDAnalysis Universe containing the system to be ionized.
paramnum_naintNumber of sodium (Na+) ions to introduce.
paramnum_clintNumber of chloride (Cl-) ions to introduce.
paramseedint= NoneRandom seed for reproducibility.
parammin_distancefloat= 5.0Minimum distance (in Å) from non-water atoms for water molecules to be considered for replacement. Default is 5.0 Å.
Returns
MDAnalysis.UniverseA new Universe object with the specified number of water molecules replaced by Na+ and Cl- ions.
