MDFactoryMDFactory
User Guide

System Types

Understanding mixed box, bilayer, and LNP simulations

MDFactory supports three system-building strategies. Each uses different Pydantic composition models and build functions.

Mixed Box

Creates a homogeneous mixture of molecules in a rectangular box. Molecules are packed to a target density using OpenMM compression.

Use cases

  • Solution simulations (solvent + solute)
  • Polymer blends
  • Small molecule mixtures
  • Bulk liquid properties

Configuration

engine: gromacs
simulation_type: mixedbox
parametrization: smirnoff

system:
  species:
    - smiles: "O"
      resname: SOL
      count: 900
    - smiles: "CCO"
      resname: ETH
      count: 100
  target_density: 1.0
  ionization:
    neutralize: true
    concentration: 0.15

MixedBoxComposition fields

FieldTypeDefaultDescription
specieslist of SingleMoleculeSpeciesMolecules in the system
total_countint | nullnullTotal molecule count (used with fractions)
target_densityfloat1.0Target density in g/cm³
ionizationIonizationConfigsee belowIon placement settings

Tips

  • Use count for absolute molecule numbers or fraction for molar ratios (with total_count)
  • target_density determines the box size — no need to specify box dimensions
  • Fractions must sum to 1.0 across all species

Bilayer

Builds lipid bilayer systems with water on both sides. Uses OpenMM compression to assemble the bilayer structure, then solvates and ionizes.

Use cases

  • Membrane simulations
  • Lipid phase behavior
  • Drug permeation studies
  • Bilayer property calculations (APL, order parameters, thickness)

Configuration

engine: gromacs
simulation_type: bilayer
parametrization: cgenff

system:
  species:
    - smiles: "CCCCCCCCCCCCCCCC(=O)OC[C@H](COP(=O)([O-])OCC[N+](C)(C)C)OC(=O)CCCCCCC/C=C\\CCCCCCCC"
      resname: POPC
      count: 128
      head_atoms: [32, 33, 34, 35, 36, 37, 38, 39, 40, 41]
      tail_atoms: []
  z_padding: 20.0
  monolayer: false
  ionization:
    neutralize: true
    concentration: 0.15

BilayerComposition fields

FieldTypeDefaultDescription
specieslist of LipidSpeciesLipid molecules (uses LipidSpecies with head/tail atom indices)
total_countint | nullnullTotal lipid count (used with fractions)
z_paddingfloat20.0Water padding above/below bilayer in Å
monolayerboolfalseBuild a monolayer instead of bilayer
ionizationIonizationConfigsee belowIon placement settings

LipidSpecies fields

FieldTypeDefaultDescription
smilesstringCanonical SMILES
resnamestringResidue name (max 4 chars)
count or fractionint or floatNumber or molar fraction
head_atomslist of int[]0-based atom indices for headgroup (auto-detected if empty)
tail_atomslist of int[]0-based atom indices for tail (auto-detected if empty)
branch_atomslist of int[]0-based atom indices for branch points (auto-detected if empty)

Tips

  • Lipid count must be even for bilayers (split between leaflets)
  • head_atoms and tail_atoms are auto-detected from SMILES if not provided
  • Use monolayer: true for monolayer systems

Lipid Nanoparticle (LNP)

Builds spherical lipid nanoparticle systems with a hydrophobic core and lipid monolayer shell. The build process creates the core and shell separately, merges them, then solvates with spherical exclusion and ionizes.

Use cases

  • mRNA vaccine delivery vehicles
  • Drug encapsulation and delivery
  • Ionizable lipid formulations
  • PEGylated nanoparticle systems

Configuration

engine: gromacs
simulation_type: lnp
parametrization: smirnoff

system:
  radius: 60.0
  shell_thickness: 28.0
  padding: 25.0

  core:
    species:
      - smiles: "IONIZABLE_LIPID_SMILES"
        resname: ILN
        fraction: 0.4
      - smiles: "CHOLESTEROL_SMILES"
        resname: CHL
        fraction: 0.6
    target_density: 0.95
    replication_factor: 1

  shell:
    species:
      - smiles: "DSPC_SMILES"
        resname: DSP
        fraction: 0.5
      - smiles: "PEG_LIPID_SMILES"
        resname: PEG
        fraction: 0.5
    z0: 10.0
    area_per_lipid: 65.0

  ionization:
    neutralize: true
    concentration: 0.15

LNPComposition fields

FieldTypeDefaultDescription
radiusfloatTotal LNP radius in Å
shell_thicknessfloat28.0Lipid monolayer thickness in Å
paddingfloat25.0Water padding around the nanoparticle in Å
coreCoreCompositionCore composition
shellShellCompositionShell composition
ionizationIonizationConfigsee belowIon placement settings

CoreComposition fields

FieldTypeDefaultDescription
specieslist of SingleMoleculeSpeciesCore molecules (must use fraction)
target_densityfloat0.95Target density for core packing in g/cm³
replication_factorint1Unit cell replication factor

ShellComposition fields

FieldTypeDefaultDescription
specieslist of LipidSpeciesShell lipids (must use fraction)
z0float10.0Pivotal plane offset in Å
area_per_lipidfloat65.0Area per lipid in shell in Ų

Tips

  • Core species must all use fraction (not count), and fractions must sum to 1.0
  • Shell species must also use fraction summing to 1.0
  • core_radius is computed as radius - shell_thickness
  • Molecule counts are calculated automatically from the geometry and density
  • Include both neutral and protonated forms of ionizable lipids as separate species

IonizationConfig (shared)

All system types support ionization configuration:

FieldTypeDefaultDescription
neutralizebooltrueAdd counter-ions to neutralize system charge
concentrationfloat0.15Ion concentration in mol/L
min_distancefloat5.0Minimum distance between ions in Å
seedint | nullnullRandom seed for ion placement

SingleMoleculeSpecies fields (shared)

FieldTypeDefaultDescription
smilesstringCanonical isomeric SMILES
resnamestringResidue name (max 4 chars)
countint | nullnullAbsolute molecule count
fractionfloat | nullnullMolar fraction (0 to 1)

Either count or fraction must be provided (not both).

Choosing a system type

System TypeBest ForComplexity
mixedboxSolution chemistry, bulk propertiesLow
bilayerMembrane systems, lipid studiesMedium
lnpDrug delivery, mRNA vaccinesHigh

All system types use the same parametrization and topology generation workflows. Switch between them by changing the simulation_type field.

Next steps

On this page