perses.rjmc.topology_proposal.SmallMoleculeSetProposalEngine

class perses.rjmc.topology_proposal.SmallMoleculeSetProposalEngine(list_of_smiles, system_generator, residue_name='MOL', atom_expr=None, bond_expr=None, proposal_metadata=None, storage=None, always_change=True, atom_map=None)[source]

This class proposes new small molecules from a prespecified set. It uses uniform proposal probabilities, but can be extended. The user is responsible for providing a list of smiles that can be interconverted! The class includes extra functionality to assist with that (it is slow).

Parameters:
list_of_smiles : list of string

list of smiles that will be sampled

system_generator : SystemGenerator object

SystemGenerator initialized with the appropriate forcefields

residue_name : str

The name that will be used for small molecule residues in the topology

proposal_metadata : dict

metadata for the proposal engine

storage : NetCDFStorageView, optional, default=None

If specified, write statistics to this storage

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) Given a topology, come up with a state key string.
propose(current_system, current_topology[, …]) Propose the next state, given the current state
__init__(list_of_smiles, system_generator, residue_name='MOL', atom_expr=None, bond_expr=None, proposal_metadata=None, storage=None, always_change=True, atom_map=None)[source]

Initialize self. See help(type(self)) for accurate signature.

Methods

__init__(list_of_smiles, system_generator[, …]) 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) Given a topology, come up with a state key string.
propose(current_system, current_topology[, …]) Propose the next state, given the current state

Attributes

chemical_state_list
static canonicalize_smiles(smiles)[source]

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)[source]

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)[source]

Given a topology, come up with a state key string. For this class, the state key is an isomeric canonical SMILES.

Parameters:
topology : app.Topology object

The topology object in question.

Returns:
chemical_state_key : str

isomeric canonical SMILES

propose(current_system, current_topology, current_mol=None, proposed_mol=None, current_metadata=None)[source]

Propose the next state, given the current state

Parameters:
current_system : openmm.System object

the system of the current state

current_topology : app.Topology object

the topology of the current state

current_metadata : dict

dict containing current smiles as a key

current_mol : OEMol, optional, default=None

If specified, use this OEMol instead of converting from topology

proposed_mol : OEMol, optional, default=None

If specified, use this OEMol instead of converting from topology

Returns:
proposal : TopologyProposal object

topology proposal object