IsomerCollection#
- class maize.utilities.chem.chem.IsomerCollection(molecules: Sequence[Isomer])[source]#
Bases:
object
Represents a collection of isomers / enumerations of a molecule.
- Parameters:
molecules – Molecules part of the collection and sharing a common topology
Methods
__init__
(molecules)embed
([n_conformers])Generate a 3D embedding of all isomers.
from_sdf
(file)Create an isomer collection from an SDF file containing different isomers or conformers.
from_smiles
(smiles[, max_isomers, sanitize, ...])Create an isomer collection from a SMILES string.
remove_isomer
(isomer)Remove isomer from collection
to_sdf
(path)Write all isomers to an SDF file.
return smiles for an isomer collection
Attributes
The best score among all isomers / conformers
Returns the InChI key for the molecule
Number of contained isomers
Whether the isomers have been scored
smiles
- classmethod from_smiles(smiles: str, max_isomers: int = 8, sanitize: bool = True, timeout: int = 10) Self [source]#
Create an isomer collection from a SMILES string.
- Parameters:
smiles – The SMILES string to initialize the collection with
max_isomers – Maximum number of isomers to generate
sanitize – Whether to sanitize the molecule
timeout – Timeout in seconds before failing stereoisomer generation
- Returns:
IsomerCollection instance
- Return type:
- Raises:
ChemistryException – If there was an error parsing the SMILES code
See also
steps.mai.molecule.Gypsum
A more advanced approach of generating any kind of isomer or high-energy conformers
- classmethod from_sdf(file: Path) Self [source]#
Create an isomer collection from an SDF file containing different isomers or conformers.
- Parameters:
file – The SDF file input
- Returns:
IsomerCollection instance
- Return type:
- Raises:
ChemistryException – If there was an error parsing the SMILES code
- to_sdf(path: Path) None [source]#
Write all isomers to an SDF file.
- Parameters:
path – Output file path
- embed(n_conformers: int = 1) None [source]#
Generate a 3D embedding of all isomers.
- Parameters:
n_conformers – Number of conformers to generate
- Raises:
ChemistryException – If there was an error generating the embeddings