build
Core build pipeline for constructing MD simulation systems.
func_compute_charge_from_universe(u, species) → intCompute total system charge from actual residue counts in the universe.
This is needed because transformations like sphere cropping or shell projection may change residue counts from the input specification.
paramumda.UniverseThe universe with the actual system structure
paramspecieslistList of species objects with resname and charge properties
Returns
intTotal system charge based on actual residue counts
func_get_parametrize_function(inp)Get the parametrization function, optionally wrapping with config for SMIRNOFF.
paraminpBuildInputReturns
Nonefuncbuild_mixedbox(inp)Build a mixed-box system: compress, ionize, write topology and run files.
paraminpBuildInputReturns
Nonefunccreate_mixedbox_by_compression(inp)Create a mixed-box universe by packing at low density then compressing with OpenMM.
paraminpBuildInputReturns
tuple(universe, parameters, parametrize_function, topology_function)
funcbuild_bilayer(inp)Build a bilayer system: compress, solvate, ionize, write topology and run files.
paraminpBuildInputReturns
Nonefunccreate_bilayer_by_compression(inp)Create a bilayer universe by placing lipids then compressing with OpenMM.
paraminpReturns
tuple(universe, parameters, parametrize_function, topology_function)
funcbuild_lnp(inp)Build an LNP (Lipid Nanoparticle) system.
The LNP consists of:
- Core (internal): A compressed sphere of lipid molecules
- Shell (external): A spherical monolayer wrapping the core
Workflow:
- Create core via create_mixedbox_by_compression → create_sphere
- Create shell via create_bilayer_by_compression → shell_from_monolayer
- Merge core and shell components
- Solvate with spherical exclusion zone
- Ionize the solvated system
- Write topology and run files
paraminpBuildInputReturns
Nonefunccreate_lnp_core(inp)Create the LNP core by compressing a mixed box and shaping into a sphere.
For efficiency, we pack only a unit cell (1/n³ of total molecules) and replicate it n×n×n times before cropping to a sphere.
paraminpBuildInputReturns
tuple(u_core, parameters, parametrize_function, topology_function)
funccreate_lnp_shell(inp, parametrize_function, topology_function)Create the LNP shell from a monolayer projected onto the core surface.
Returns
tuple(u_shell, shell_parameters)
func_log_lnp_composition(u, inp) → NoneLog a table comparing input fractions vs actual fractions for core and shell.
paramumda.UniverseparaminpBuildInputReturns
Nonefuncmerge_lnp_components(u_core, u_shell, inp, parameters, parametrize_function, topology_function)Merge core and shell into a single LNP universe.
The shell is positioned around the core and the combined system undergoes a brief equilibration with spherical restraints.
paramu_coreparamu_shellparaminpBuildInputparamparametersparamparametrize_functionparamtopology_functionReturns
MDAnalysis.UniverseMerged LNP universe.
funcionize_solvated_system(ion_config, u_solvated, total_charge)Add ions for neutralization and salt concentration.
paramion_configIonizationConfig or NoneIonization settings (concentration, neutralize, etc.)
paramu_solvatedmda.UniverseSolvated system universe
paramtotal_chargeintTotal charge of the system before ionization
Returns
tupleIonized universe and list of ion species added
