perses.rjmc.topology_proposal.ButaneProposalEngine¶
-
class
perses.rjmc.topology_proposal.
ButaneProposalEngine
(system_generator, residue_name='MOL', atom_expr=None, bond_expr=None, proposal_metadata=None, storage=None, always_change=True)[source]¶ Custom ProposalEngine to use with ButaneTestSystem defines two “states” of butane, identified ‘butane-A’ and ‘butane-B’, which are tracked by adding a custom _state_key attribute to the topology
Generates TopologyProposal from butane to butane, only matching two carbons such that geometry must rebuild the others
Can only be used with input topology of butane
- Constructor Arguments:
- system_generator, SystemGenerator object
- SystemGenerator initialized with the appropriate forcefields
- residue_name, OPTIONAL, str
- Default = “MOL” The name that will be used for small molecule residues in the topology
- atom_expr, OPTIONAL, oechem.OEExprOpts
- Default is None Currently not implemented – would dictate how match is defined
- bond_expr, OPTIONAL, oechem.OEExprOpts
- Default is None Currently not implemented – would dictate how match is defined
- proposal_metadata, OPTIONAL, dict
- Default is None metadata for the proposal engine
- storage, OPTIONAL, NetCDFStorageView
- Default is None If specified, write statistics to this storage layer
- always_change, OPTIONAL, bool
- Default is True Currently not implemented – will always behave as True The proposal will always be from the current “state” to the other Self proposals will never be made
Attributes: - chemical_state_list
Methods
canonicalize_smiles
(smiles)Convert a SMILES string into canonical isomeric smiles clean_molecule_list
(smiles_list, atom_opts, …)A utility function to determine which molecules can be proposed from any other molecule. compute_state_key
(topology)For this test system, the topologies for the two states are identical; therefore a custom attribute _state_key has been added to the topology itself, to track whether a switch has been accepted propose
(current_system, current_topology[, …])Custom proposal for NaphthaleneTestSystem will switch from current naphthalene “state” (either ‘naphthalene-A’ or ‘naphthalene-B’) to the other -
__init__
(system_generator, residue_name='MOL', atom_expr=None, bond_expr=None, proposal_metadata=None, storage=None, always_change=True)[source]¶ Initialize self. See help(type(self)) for accurate signature.
Methods
__init__
(system_generator[, residue_name, …])Initialize self. canonicalize_smiles
(smiles)Convert a SMILES string into canonical isomeric smiles clean_molecule_list
(smiles_list, atom_opts, …)A utility function to determine which molecules can be proposed from any other molecule. compute_state_key
(topology)For this test system, the topologies for the two states are identical; therefore a custom attribute _state_key has been added to the topology itself, to track whether a switch has been accepted propose
(current_system, current_topology[, …])Custom proposal for NaphthaleneTestSystem will switch from current naphthalene “state” (either ‘naphthalene-A’ or ‘naphthalene-B’) to the other Attributes
chemical_state_list
-
static
canonicalize_smiles
(smiles)¶ Convert a SMILES string into canonical isomeric smiles
Parameters: - smiles : str
Any valid SMILES for a molecule
Returns: - iso_can_smiles : str
OpenEye isomeric canonical smiles corresponding to the input
-
static
clean_molecule_list
(smiles_list, atom_opts, bond_opts)¶ A utility function to determine which molecules can be proposed from any other molecule.
Parameters: - smiles_list
- atom_opts
- bond_opts
Returns: - safe_smiles
- removed_smiles
-
compute_state_key
(topology)¶ For this test system, the topologies for the two states are identical; therefore a custom attribute _state_key has been added to the topology itself, to track whether a switch has been accepted
compute_state_key will return topology._state_key rather than SMILES, because SMILES are identical in the two states.
-
propose
(current_system, current_topology, current_metadata=None)¶ Custom proposal for NaphthaleneTestSystem will switch from current naphthalene “state” (either ‘naphthalene-A’ or ‘naphthalene-B’) to the other
This proposal engine can only be used with input topology of naphthalene, and propose() will first confirm naphthalene is residue “MOL” The topology may have water but should not have any other carbon-containing residue.
The “new” system and topology are deep copies of the old, but the atom_map is custom defined to only match one of the two rings.