load_molecules
#
Helpers for loading molecules from parameterisation inputs.
Functions:
-
load_smiles_molecules–Load a single OpenFF Molecule from a SMILES string.
-
load_sdf_molecules–Load one or more unique OpenFF Molecules from an SDF file.
-
load_conformers_for_molecule–Load the conformers of
moleculefrom an SDF, aligned to its atom ordering.
load_smiles_molecules
#
Load a single OpenFF Molecule from a SMILES string.
Source code in presto/load_molecules.py
load_sdf_molecules
#
Load one or more unique OpenFF Molecules from an SDF file.
Source code in presto/load_molecules.py
load_conformers_for_molecule
#
Load the conformers of molecule from an SDF, aligned to its atom ordering.
Every record in the SDF that is graph-isomorphic to molecule is treated as a
conformer of it. Because the atom ordering in the SDF need not match molecule,
each matching record is remapped onto molecule's atom ordering before its
coordinates are extracted, guaranteeing the returned conformers are valid starting
positions for a topology built from molecule. Records that do not match are
ignored (they may belong to another molecule in a multi-molecule SDF).
Parameters:
-
molecule(Molecule) –The molecule whose conformers should be loaded. Defines the canonical atom ordering the returned conformers are aligned to.
-
sdf_path(PathLike) –Path to an SDF file containing one or more conformers of
molecule(and, optionally, of other molecules).
Returns:
list[openff.units.Quantity]
The matching conformers, each aligned to molecule's atom ordering.
Raises:
ValueError
If the path does not exist, does not end in .sdf, or contains no record
matching molecule.