openmm
#
Utilities to manipulate OpenMM objects.
Functions:
-
add_barostat
–Add a barostat to a system in-place.
-
create_simulation
–Creates an OpenMM simulation object.
-
create_system_generator
–Creates a 'system generator' that can be used when setting up an alchemical
-
extract_frame
–Extracts a frame from a trajectory as an OpenMM state object.
add_barostat
#
Add a barostat to a system in-place.
Parameters:
-
system
(System
) –The system to add the barostat to.
-
temperature
(Quantity
) –The temperature to simulate at.
-
pressure
(Quantity
) –The pressure to simulate at.
-
frequency
(int
, default:25
) –The frequency at which to apply the barostat.
Source code in absolv/utils/openmm.py
create_simulation
#
create_simulation(
system: System,
topology: Topology,
coords: Quantity,
integrator: Integrator,
platform: OpenMMPlatform,
) -> Simulation
Creates an OpenMM simulation object.
Parameters:
-
system
(System
) –The system to simulate
-
topology
(Topology
) –The topology being simulated.
-
coords
(Quantity
) –The initial coordinates. Box vectors (if any) will be taken from the topology.
-
integrator
(Integrator
) –The integrator to evolve the system with.
-
platform
(OpenMMPlatform
) –The accelerator to run using.
Returns:
-
Simulation
–The created simulation.
Source code in absolv/utils/openmm.py
create_system_generator
#
create_system_generator(
force_field: ForceField,
solvent_a_nonbonded_method: int,
solvent_b_nonbonded_method: int,
nonbonded_cutoff: Quantity = 1.0 * nanometer,
constraints: int | None = None,
rigid_water: bool | None = None,
remove_cmm_motion: bool = True,
hydrogen_mass: Quantity | None = None,
switch_distance: Quantity | None = None,
) -> SystemGenerator
Creates a 'system generator' that can be used when setting up an alchemical free energy calculation from an OpenMM force field.
Parameters:
-
force_field
(ForceField
) –The OpenMM force field to parameterize the topology using.
-
solvent_a_nonbonded_method
(int
) –The non-bonded method to use in solvent a.
-
solvent_b_nonbonded_method
(int
) –The non-bonded method to use in solvent b.
-
nonbonded_cutoff
(Quantity
, default:1.0 * nanometer
) –The non-bonded cutoff to use.
-
constraints
(int | None
, default:None
) –The type of constraints to apply to the system.
-
rigid_water
(bool | None
, default:None
) –Whether to force rigid water.
-
remove_cmm_motion
(bool
, default:True
) –Whether to remove any CMM motion.
-
hydrogen_mass
(Quantity | None
, default:None
) –The mass to use for hydrogens.
-
switch_distance
(Quantity | None
, default:None
) –The switch distance to use.
Returns:
-
SystemGenerator
–A callable that will create an OpenMM system from an OpenFF topology and the name of the solvent (i.e.
"solvent-a"
or"solvent-b"
) the system will be used for.
Source code in absolv/utils/openmm.py
92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 |
|
extract_frame
#
extract_frame(trajectory: Trajectory, idx: int) -> State
Extracts a frame from a trajectory as an OpenMM state object.
Parameters:
-
trajectory
(Trajectory
) –The trajectory to extract the frame from.
-
idx
(int
) –The index of the frame to extract.
Returns:
-
State
–The extracted frame.