Common configuration models.
Classes:
- 
          FlatBottomRestraint–Configuration for a flat bottom restraint. 
- 
          BoreschRestraint–Configuration for a Boresch style restraint between three receptor atoms 
- 
          Prepare–Configuration for preparing a system for simulation. 
- 
          LangevinIntegrator–Configuration for a Langevin integrator. 
- 
          REST–Configure REST2 setup. 
- 
          Minimization–Configuration for a minimization. 
- 
          Simulation–Configuration for an MD simulation. 
- 
          Anneal–Configuration for a temperature annealing NVT MD simulation. 
- 
          HREMDSwapMode–The mode in which to propose state swaps between replicas. 
- 
          HREMD–Configuration for Hamiltonian replica exchange sampling 
Functions:
- 
            merge_configs–Merge multiple configurations together. 
Attributes:
- 
          DEFAULT_TEMPERATURE–The default temperature to simulate at 
- 
          DEFAULT_PRESSURE–The default pressure to simulate at 
- 
          DEFAULT_OPENMM_FF_SOURCES–The default parameter files to load when parameterizing the solvent / receptor 
module-attribute
  
#
    The default temperature to simulate at
module-attribute
  
#
    The default pressure to simulate at
module-attribute
  
#
DEFAULT_OPENMM_FF_SOURCES = [
    "amber/protein.ff14SB.xml",
    "amber/tip3p_standard.xml",
    "amber/tip3p_HFE_multivalent.xml",
]
The default parameter files to load when parameterizing the solvent / receptor
pydantic-model
  
#
    
              Bases: BaseModel
Configuration for a flat bottom restraint.
Fields:
- 
              type(Literal['flat-bottom'])
- 
              k(OpenMMQuantity[_KCAL_PER_ANG_SQR])
- 
              radius(OpenMMQuantity[_ANGSTROM])
pydantic-field
  
#
    Force constant [kcal/mol/Å^2] of the restraint.
    Dump the model to a YAML representation.
Parameters:
- 
            output_path(Path | None, default:None) –The (optional) path to save the YAML representation to. 
Returns:
- 
              str–The YAML representation. 
Source code in femto/md/utils/models.py
              
pydantic-model
  
#
    
              Bases: BaseModel
Configuration for a Boresch style restraint between three receptor atoms (r1, r2, r3) and three ligand atoms (l1, l2, l3).
See Also
femto.md.restraints.create_boresch_restraint
Fields:
- 
              type(Literal['boresch'])
- 
              k_distance(OpenMMQuantity[_KCAL_PER_ANG_SQR])
- 
              k_angle_a(OpenMMQuantity[_KCAL_PER_RAD_SQR])
- 
              k_angle_b(OpenMMQuantity[_KCAL_PER_RAD_SQR])
- 
              k_dihedral_a(OpenMMQuantity[_KCAL_PER_RAD_SQR])
- 
              k_dihedral_b(OpenMMQuantity[_KCAL_PER_RAD_SQR])
- 
              k_dihedral_c(OpenMMQuantity[_KCAL_PER_RAD_SQR])
pydantic-field
  
#
    Force constant [kcal/mol/Å^2] of the harmonic distance restraint between r3 and l1.
pydantic-field
  
#
    Force constant [kcal/mol/rad^2] of the harmonic angle restraint on the angle formed by r2, r3, and l1.
pydantic-field
  
#
    Force constant [kcal/mol/rad^2] of the harmonic angle restraint on the angle formed by r3, l1, and l2.
pydantic-field
  
#
    Force constant [kcal/mol/rad^2] of the harmonic dihedral restraint on the dihedral angle formed by r1, r2, r3, and l1.
pydantic-field
  
#
    Force constant [kcal/mol/rad^2] of the harmonic dihedral restraint on the dihedral angle formed by r2, r3, l1, and l2.
pydantic-field
  
#
    Force constant [kcal/mol/rad^2] of the harmonic dihedral restraint on the dihedral angle formed by r3, l1, l2, and l3.
    Dump the model to a YAML representation.
Parameters:
- 
            output_path(Path | None, default:None) –The (optional) path to save the YAML representation to. 
Returns:
- 
              str–The YAML representation. 
Source code in femto/md/utils/models.py
              
pydantic-model
  
#
    
              Bases: BaseModel
Configuration for preparing a system for simulation.
Fields:
- 
              ionic_strength(OpenMMQuantity[molar])
- 
              neutralize(bool)
- 
              cation(Literal['Na+', 'K+'])
- 
              anion(Literal['Cl-'])
- 
              water_model(Literal['tip3p'])
- 
              default_protein_ff(list[str])
- 
              default_ligand_ff(str | None)
- 
              box_padding(OpenMMQuantity[_ANGSTROM] | None)
- 
              box_shape(Literal['cube', 'cubeoid'])
- 
              n_waters(int | None)
Validators:
- 
              _validate_n_waters
pydantic-field
  
#
    The total concentration of ions pairs (anion and cation) to add to approximate an ionic strength. This does not include ions that are added to neutralize the system.
pydantic-field
  
#
    Whether to add counter ions to neutralize the system.
pydantic-field
  
#
    The cation to use when neutralizing the system.
pydantic-field
  
#
    The water model to use when generating solvent coordinates. The actual force field parameters used for the solvent are determined by the default_protein_ff or any extra parameters provided while preparing the system.
pydantic-field
  
#
default_protein_ff: list[str] = [*DEFAULT_OPENMM_FF_SOURCES]
The default parameters to use when parameterizing the protein, solvent, and ions.
pydantic-field
  
#
    The default parameters to apply when parameterizing ligands, or None otherwise. Currently, only the path to an OpenFF offxml file can be specified.
pydantic-field
  
#
    The minimum distance between any complex atom (including any offset ligands) and the box wall. This option is mutually exclusive with n_waters.
pydantic-field
  
#
    The shape of the box to use when solvating the complex, when box_padding is specified.
pydantic-field
  
#
    The number of extra waters to solvate the complex using. This option is mutually exclusive with box_padding.
    Dump the model to a YAML representation.
Parameters:
- 
            output_path(Path | None, default:None) –The (optional) path to save the YAML representation to. 
Returns:
- 
              str–The YAML representation. 
Source code in femto/md/utils/models.py
              
pydantic-model
  
#
    
              Bases: BaseModel
Configuration for a Langevin integrator.
Fields:
- 
              type(Literal['langevin'])
- 
              timestep(OpenMMQuantity[picosecond])
- 
              friction(OpenMMQuantity[picosecond ** -1])
- 
              constraint_tolerance(float)
pydantic-field
  
#
    The timestep to use.
pydantic-field
  
#
    The friction coefficient.
pydantic-field
  
#
    The tolerance with which constraints are maintained.
    Dump the model to a YAML representation.
Parameters:
- 
            output_path(Path | None, default:None) –The (optional) path to save the YAML representation to. 
Returns:
- 
              str–The YAML representation. 
Source code in femto/md/utils/models.py
              
pydantic-model
  
#
    
              Bases: BaseModel
Configure REST2 setup.
Fields:
- 
              scale_bonds(bool)
- 
              scale_angles(bool)
- 
              scale_torsions(bool)
- 
              scale_nonbonded(bool)
pydantic-field
  
#
    Whether to scale bond force constants by beta_m / beta_0.
pydantic-field
  
#
    Whether to scale angle force constants by beta_m / beta_0.
pydantic-field
  
#
    Whether to scale torsion barrier heights  by beta_m / beta_0.
pydantic-field
  
#
    Whether to scale non-bonded epsilons by beta_m / beta_0 and charges by sqrt(beta_m / beta_0).
    Dump the model to a YAML representation.
Parameters:
- 
            output_path(Path | None, default:None) –The (optional) path to save the YAML representation to. 
Returns:
- 
              str–The YAML representation. 
Source code in femto/md/utils/models.py
              
pydantic-model
  
#
    
              Bases: BaseModel
Configuration for a minimization.
Fields:
- 
              type(Literal['minimization'])
- 
              restraints(dict[str, FlatBottomRestraint])
- 
              tolerance(OpenMMQuantity[_KCAL_PER_MOL / _ANGSTROM])
- 
              max_iterations(int)
pydantic-field
  
#
restraints: dict[str, FlatBottomRestraint] = {}
The position restraints to apply during the minimization. The keys should be AMBER style selection masks.
pydantic-field
  
#
    Minimization will be halted once the root-mean-square value of all force components reaches this tolerance.
pydantic-field
  
#
    The maximum number of iterations to perform. If 0, minimization will continue until the tolerance is met.
    Dump the model to a YAML representation.
Parameters:
- 
            output_path(Path | None, default:None) –The (optional) path to save the YAML representation to. 
Returns:
- 
              str–The YAML representation. 
Source code in femto/md/utils/models.py
              
pydantic-model
  
#
    
              Bases: _SimulationStep
Configuration for an MD simulation.
Fields:
- 
              type(Literal['simulation'])
- 
              temperature(OpenMMQuantity[kelvin])
- 
              pressure(OpenMMQuantity[atmospheres] | None)
- 
              barostat_frequency(int)
- 
              n_steps(int)
pydantic-field
  
#
integrator: LangevinIntegrator
The integrator to use during the simulation.
pydantic-field
  
#
restraints: dict[str, FlatBottomRestraint] = {}
The position restraints to apply during the minimization. The keys should be AMBER style selection masks.
pydantic-field
  
#
    The pressure to simulate at, or none to run in NVT.
pydantic-field
  
#
    The frequency at which to apply the barostat. This is ignored if pressure is None.
    Dump the model to a YAML representation.
Parameters:
- 
            output_path(Path | None, default:None) –The (optional) path to save the YAML representation to. 
Returns:
- 
              str–The YAML representation. 
Source code in femto/md/utils/models.py
              
pydantic-model
  
#
    
              Bases: _SimulationStep
Configuration for a temperature annealing NVT MD simulation.
Fields:
- 
              type(Literal['anneal'])
- 
              temperature_initial(OpenMMQuantity[kelvin])
- 
              temperature_final(OpenMMQuantity[kelvin])
- 
              n_steps(int)
- 
              frequency(int)
pydantic-field
  
#
integrator: LangevinIntegrator
The integrator to use during the simulation.
pydantic-field
  
#
restraints: dict[str, FlatBottomRestraint] = {}
The position restraints to apply during the minimization. The keys should be AMBER style selection masks.
pydantic-field
  
#
    The starting temperature to simulate at.
pydantic-field
  
#
    The final temperature to simulate at.
    Dump the model to a YAML representation.
Parameters:
- 
            output_path(Path | None, default:None) –The (optional) path to save the YAML representation to. 
Returns:
- 
              str–The YAML representation. 
Source code in femto/md/utils/models.py
              
    
              Bases: str, Enum
The mode in which to propose state swaps between replicas.
- NEIGHBOURS: Only allow swapping the current state with neighbouring states.
- ALL: Allow swapping the current state with any other state.
pydantic-model
  
#
    
              Bases: BaseModel
Configuration for Hamiltonian replica exchange sampling
Fields:
- 
              temperature(OpenMMQuantity[kelvin])
- 
              n_warmup_steps(int)
- 
              n_steps_per_cycle(int)
- 
              n_cycles(int)
- 
              max_step_retries(int)
- 
              swap_mode(HREMDSwapModeLiteral | None)
- 
              max_swaps(int | None)
- 
              trajectory_interval(int | None)
- 
              trajectory_enforce_pbc(bool)
- 
              checkpoint_interval(int | None)
pydantic-field
  
#
temperature: OpenMMQuantity[kelvin] = DEFAULT_TEMPERATURE
The temperature to sample at.
pydantic-field
  
#
    The number of steps to run each replica for before starting hremd trials. All energies gathered during this period will be discarded.
pydantic-field
  
#
    The number of steps to propagate the system by before attempting an exchange.
pydantic-field
  
#
    The number of cycles of 'propagate the system' -> 'exchange replicas' to run.
pydantic-field
  
#
    The maximum number of times to attempt to step if a NaN is encountered before raising an exception
pydantic-field
  
#
    The mode in which to propose state swaps between replicas. This can either be: 'neighbours', only try and swap adjacent states or ii. 'all', try and swap all states stochastically. If None, no replica exchanges will be attempted.
pydantic-field
  
#
    The maximum number of swap proposals to make if running in 'all' mode. This variable does nothing when running in 'neighbours' mode.
pydantic-field
  
#
    The number of cycles to run before saving the current replica states to DCD trajectory files. If None, no trajectories will be saved.
pydantic-field
  
#
    Whether to apply periodic boundary conditions when retrieving coordinates for writing to trajectory files.
pydantic-field
  
#
    The number of cycles to run before saving the current replica states to checkpoint files. If None, no checkpoints will be saved.
    Dump the model to a YAML representation.
Parameters:
- 
            output_path(Path | None, default:None) –The (optional) path to save the YAML representation to. 
Returns:
- 
              str–The YAML representation. 
Source code in femto/md/utils/models.py
              
    Merge multiple configurations together.
Parameters:
- 
            configs(_T, default:()) –The configurations to merge. These should either be dataclasses or plain dictionaries. Values in subsequent configs will overwrite values in previous ones. 
Returns:
- 
              dict[str, Any]–The merged configuration.