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

__init__(molecules: Sequence[Isomer]) None[source]#

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.

to_smiles()

return smiles for an isomer collection

Attributes

best_score

The best score among all isomers / conformers

inchi

Returns the InChI key for the molecule

n_isomers

Number of contained isomers

scored

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:

IsomerCollection

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:

IsomerCollection

Raises:

ChemistryException – If there was an error parsing the SMILES code

property n_isomers: int#

Number of contained isomers

property scored: bool#

Whether the isomers have been scored

property best_score: float#

The best score among all isomers / conformers

property inchi: str#

Returns the InChI key for the molecule

to_sdf(path: Path) None[source]#

Write all isomers to an SDF file.

Parameters:

path – Output file path

to_smiles() List[str][source]#

return smiles for an isomer collection

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

remove_isomer(isomer: Isomer) None[source]#

Remove isomer from collection