mythos.energy.martini.base
Common Martini Energy Utilities.
Classes
Class representing the topology of a Martini system. |
|
Base class for Martini energy functions. |
|
Base class for Martini energy function configurations. |
Functions
|
Return displacement function given box_size. |
|
Derive bond names aligned with bonded_neighbors. |
|
Derive angle names aligned with angles. |
Module Contents
- mythos.energy.martini.base.get_periodic(box_size: mythos.utils.types.Vector3D) callable[source]
Return displacement function given box_size.
- mythos.energy.martini.base.derive_bond_names(residue_names: tuple[str, Ellipsis], atom_names: tuple[str, Ellipsis], bonded_neighbors: mythos.utils.types.Arr_N) tuple[str, Ellipsis][source]
Derive bond names aligned with bonded_neighbors.
Each name has the form
RESIDUE_BEAD1_BEAD2, e.g.DMPC_GL1_GL2.
- mythos.energy.martini.base.derive_angle_names(residue_names: tuple[str, Ellipsis], atom_names: tuple[str, Ellipsis], angles: mythos.utils.types.Arr_N) tuple[str, Ellipsis][source]
Derive angle names aligned with angles.
Each name has the form
RESIDUE_BEAD1_BEAD2_BEAD3, e.g.DMPC_NC3_PO4_GL1.
- class mythos.energy.martini.base.MartiniTopology[source]
Class representing the topology of a Martini system.
This class contains information about the atom types, bonded interactions, and angles in the system. It can be used to construct energy functions and to interpret simulation results.
- atom_types
A tuple of atom type names.
- atom_names
A tuple of atom names.
- residue_names
A tuple of residue names.
- angles
An array of shape (n_angles, 3) containing the indices of the atoms involved in each angle.
- bonded_neighbors
An array of shape (n_bonds, 2) containing the indices of the bonded pairs of atoms.
- angles: mythos.utils.types.Arr_N
- bonded_neighbors: mythos.utils.types.Arr_N
- classmethod from_universe(universe: MDAnalysis.Universe) MartiniTopology[source]
Create a MartiniTopology from a Universe object.
- classmethod from_tpr(tpr_file: pathlib.Path) MartiniTopology[source]
Create a MartiniTopology from a TPR format topology file.
- class mythos.energy.martini.base.MartiniEnergyFunction[source]
Bases:
mythos.energy.base.BaseEnergyFunctionBase class for Martini energy functions.
- angles: mythos.utils.types.Arr_N
- displacement_fn: callable
- classmethod from_topology(topology: MartiniTopology, **kwargs) MartiniEnergyFunction[source]
Create an energy function from a MartiniTopology.
- class mythos.energy.martini.base.MartiniEnergyConfiguration(couplings: dict[str, list[str]] | None = None, **kwargs)[source]
Base class for Martini energy function configurations.
Given the large size and sparse inclusion of parameters in Martini models, this class implements parameters as a dictionary while supporting operations of configuration classes used in EnergyFunction.
This class also supports parameter coupling, where a single proxy parameter controls multiple underlying parameters. Couplings should be provided as a dictionary of lists, where each key is a proxy parameter name and the value is a list of target parameter names that it controls. The params field of this will be populated with the expanded parameters.
Subclasses can override __post_init__ for additional initialization logic. Parameters will be available in self.params after initialization.
- couplings
- reversed_couplings
- params
- init_params() MartiniEnergyConfiguration[source]
Dependent params initialization. Default to no-op.
- __or__(other: MartiniEnergyConfiguration) MartiniEnergyConfiguration[source]
Merge two configurations, with other taking precedence.