Conformer#

class maize.utilities.chem.chem.Conformer(rd_conf: Conformer, parent: Isomer, _rd_parent: Mol | None = None)[source]#

Bases: object

Thin shim layer for rdkit conformers. Each conformer will have an Isomer as its parent.

Parameters:
  • rd_conf – RDKit conformer object

  • parentIsomer parent instance

  • _rd_parent – The actual rdkit molecule parent of the conformer

__init__(rd_conf: Conformer, parent: Isomer, _rd_parent: Mol | None = None) None[source]#

Methods

__init__(rd_conf, parent[, _rd_parent])

from_rdmol(rd_mol, parent[, renumber])

Create a conformer from an RDKit molecule.

get_tag(tag[, default])

Returns the value for the specified tag.

has_tag(tag)

Returns whether the specified tag is set.

regenerate()

Recreate the internal RDKit conformer object to avoid deallocation

set_tag(tag, value)

Sets a tag / property for the whole isomer.

Attributes

coordinates

Coordinates of the conformer

n_atoms

tags

Return all tags

classmethod from_rdmol(rd_mol: Mol, parent: Isomer, renumber: bool = True) Self[source]#

Create a conformer from an RDKit molecule.

Parameters:
  • rd_mol – RDKit molecule instance

  • parent – Parent Isomer instance

  • renumber – Ensure atom numbers of the molecule match the parent

property tags: dict[str, Any]#

Return all tags

property coordinates: ndarray[Any, dtype[float32]]#

Coordinates of the conformer

regenerate() None[source]#

Recreate the internal RDKit conformer object to avoid deallocation

set_tag(tag: str, value: bool | int | float | str | list[float | int] | ndarray[Any, dtype[float64 | int64]]) None[source]#

Sets a tag / property for the whole isomer.

Parameters:
  • tag – Tag to set

  • value – Corresponding value for all conformers

get_tag(tag: str, default: bool | int | float | str | list[float | int] | ndarray[Any, dtype[float64 | int64]] | None = None) bool | int | float | str | list[float | int] | ndarray[Any, dtype[float64 | int64]][source]#

Returns the value for the specified tag.

Parameters:
  • tag – The tag to lookup

  • default – A default value to return if the key is not found

Returns:

The value of the tag

Return type:

Any

Raises:

KeyError – If the specified tag couldn’t be found

has_tag(tag: str) bool[source]#

Returns whether the specified tag is set.

Parameters:

tag – The tag to lookup

Returns:

Whether the tag is defined

Return type:

bool