acemd.protocols module#
- acemd.protocols.get_cellular_restraints(mol: Molecule, extracellular_sel: str, intracellular_sel: str, membrane_rel_z: float, lipidsel: str = '(lipid or resname AR CHL DHA LAL MY OL PA PC PE PGR PGS PS SA SPM ST) and noh', extracellular_crossing: str | None = 'cross', intracellular_crossing: str | None = 'cross')#
Utility function for getting restraints for membrane-ligand simulations.
Get restraints to keep given molecules from changing from extracellular to intracellular or vice versa through the periodic images of the simulation.
This assumes that the membrane is in the xy plane and the positive z axis is pointing from the intracellular side to the extracellular side. It utilizes a flat-bottomed potential which is only applied on the molecules when they exit from the box defined by this function.
Additionally the function allows the user to specify if the molecules should be allowed to enter the membrane or cross it (useful for example in ion channel simulations).
Note: Only use these restraints in NVT simulations as they require the box size to remain constant. When equilibrating such a system using NPT please restrain your molecules with positional restraints to their original locations.
- Parameters:
mol (Molecule) – The simulation system
extracellular_sel (str) – Atom selection for the molecules which should be kept on the extracellular side
intracellular_sel (str) – Atom selection for the molecules which should be kept on the intracellular side
membrane_rel_z (float) – The relative position of the membrane in the z direction. 0.5 means the membrane is in the middle of the box meaning half the solvent is above the membrane and half below.
lipidsel (str, optional) – The selection of lipids to use for the membrane
extracellular_crossing (str, optional) – Whether to allow the extracellular molecules to cross the membrane. If set to “cross” it will allow crossing. If set to “enter” it will allow entering the membrane but not crossing it. If set to None it will not allow entering the membrane.
intracellular_crossing (str, optional) – Whether to allow the intracellular molecules to cross the membrane. If set to “cross” it will allow crossing. If set to “enter” it will allow entering the membrane but not crossing it. If set to None it will not allow entering the membrane.
- acemd.protocols.setup_equilibration(builddir: Path, outdir: Path, run: str | int, temperature: float = 300, minimize: int = 500, extforces: list[dict] | None = None, coordinates: Path | None = None, structure: Path | None = None, parameters: Path | None = None, barostatconstratio: bool = False, defaultrestraints: bool = True, restraintdecay: str | int | None = None, cispeptidebondcheck: bool = True, **kwargs)#
Set up an ACEMD equilibration simulation.
- Parameters:
builddir (Path) – The directory containing the input files. Usually the output of a builder.
outdir (Path) – The directory to write the input files and simulation output to.
run (int or str) – The number of steps to run the simulation for.
temperature (float, optional) – The temperature to equilibrate the system to.
minimize (int, optional) – The number of minimization steps to perform before starting the simulation.
extforces (list[dict], optional) – External forces to apply to the system
coordinates (Path, optional) – The coordinates file to use for the simulation. If None it will be auto-detected.
structure (Path, optional) – The structure file to use for the simulation. If None it will be auto-detected.
parameters (Path, optional) – The parameters file to use for the simulation. If None it will be auto-detected.
barostatconstratio (bool, optional) – Whether to use the barostatconstratio option. This is required for membrane simulations where the box should scale isotropically in the xy plane.
defaultrestraints (bool, optional) – Whether to use the default restraints. This will apply positional restraints to all protein CA atoms with 1 kcal/mol/A^2, all non-hydrogen protein atoms with 0.1 kcal/mol/A^2, all nucleic acid backbone atoms with 1 kcal/mol/A^2 and all nucleic acid atoms that are not part of the backbone with 0.1 kcal/mol/A^2.
restraintdecay (int or str, optional) – The restraint decay time. If set to a timestep or time, the restraints will scale to their initial value to 0 over the given restraintdecay time. Otherwise the restraints will scale to 0 over half the simulation time.
cispeptidebondcheck (bool, optional) – Whether to check for cis peptide bonds in the system. This will print a warning if any are found.
Notes
The function accepts additional keyword arguments to pass to the ACEMD input file. Please refer to the ACEMD documentation. All input file options can be used here.
Examples
>>> from acemd.protocols import setup_equilibration >>> setup_equilibration(builddir, outdir, run="10ns") >>> setup_equilibration(builddir, outdir, run="10ns", minimize=1000) In the second example we override the default minimization steps of the protocol. You can override any of the input file options of ACEMD. >>> setup_equilibration(builddir, outdir, run="10ns", extforces=[{"type": "positionalRestraint", "sel": "resname MOL", "setpoints": ["1@0"]}]) In this example we add a positional restraint to the molecule MOL during equilibration in addition to the default restraints.
- acemd.protocols.setup_production(equildir: Path, outdir: Path, run: str | int, temperature: float = 300, extforces: list[dict] | None = None, coordinates: Path | None = None, structure: Path | None = None, parameters: Path | None = None, cispeptidebondcheck: bool = True, **kwargs)#
Set up an ACEMD production simulation.
- Parameters:
equildir (Path) – The directory containing the equilibrated system
outdir (Path) – The directory to write the input files and simulation output to
run (int or str) – The number of steps to run the simulation for
temperature (float, optional) – The temperature to run the simulation at
extforces (list[dict], optional) – External forces to apply to the system
coordinates (Path, optional) – The coordinates file to use for the simulation. If None it will be auto-detected.
structure (Path, optional) – The structure file to use for the simulation. If None it will be auto-detected.
parameters (Path, optional) – The parameters file to use for the simulation. If None it will be auto-detected.
cispeptidebondcheck (bool, optional) – Whether to check for cis peptide bonds in the system. This will print a warning if any are found.
Notes
The function accepts additional keyword arguments to pass to the ACEMD input file. Please refer to the ACEMD documentation. All input file options can be used here.
Examples
>>> from acemd.protocols import setup_production >>> setup_production(equildir, outdir, run="10ns") This will autodetect the final coordinates and box size from the equilibrated system and copy them over to set up a production simulation of 10 ns.