Aldehyde

class Aldehyde(carbon, oxygen, hydrogen, atom, bonders, deleters, placers=None)[source]

Bases: GenericFunctionalGroup

Represents an aldehyde functional group.

The structure of the functional group is given by the pseudo-SMILES [atom][carbon](=[oxygen])[hydrogen].

Methods

clone()

Return a clone.

get_atom()

Get the atom to which the functional group is attached.

get_atom_ids()

Yield the ids of all atoms in the functional group.

get_atoms()

Yield all the atoms in the functional group.

get_bonder_ids()

Yield the ids of bonder atoms.

get_bonders()

Yield bonder atoms in the functional group.

get_carbon()

Get the carbon atom.

get_core_atom_ids()

Yield the ids of core atoms held by the functional group.

get_deleter_ids()

Yield the ids of deleter atoms.

get_deleters()

Yield the deleter atoms in the functional group.

get_hydrogen()

Get the hydrogen atom.

get_num_bonders()

Get the number of bonder atoms.

get_oxygen()

Get the oxygen atom.

get_placer_ids()

Yield the ids of placer atoms.

with_atoms(atom_map)

Return a clone holding different atoms.

with_ids(id_map)

Return a clone holding different atom ids.

__init__(carbon, oxygen, hydrogen, atom, bonders, deleters, placers=None)[source]

Initialize a Aldehyde instance.

Parameters:
  • carbon (C) – The carbon atom.

  • oxygen (O) – The oxygen atom.

  • hydrogen (H) – The hydrogen atom.

  • atom (Atom) – The atom to which the functional group is attached.

  • bonders (tuple[Atom, ...]) – The bonder atoms.

  • deleters (tuple[Atom, ...]) – The deleter atoms.

  • placers (Optional[tuple[Atom, ...]]) – The placer atoms. If None the bonders will be used.

clone()[source]

Return a clone.

Return type:

Aldehyde

Returns:

A clone.

get_atom()[source]

Get the atom to which the functional group is attached.

Return type:

Atom

Returns:

The atom to which the functional group is attached.

get_atom_ids()

Yield the ids of all atoms in the functional group.

Yields:

The id of an Atom.

Return type:

Iterator[int]

get_atoms()

Yield all the atoms in the functional group.

Yields:

An atom in the functional group.

Return type:

Iterator[Atom]

get_bonder_ids()

Yield the ids of bonder atoms.

Yields:

The id of a bonder Atom.

Return type:

Iterator[int]

get_bonders()

Yield bonder atoms in the functional group.

These are atoms which have bonds added during ConstructedMolecule construction.

Yields:

A bonder atom.

Return type:

Iterator[Atom]

get_carbon()[source]

Get the carbon atom.

Return type:

C

Returns:

The carbon atom.

get_core_atom_ids()

Yield the ids of core atoms held by the functional group.

Yields:

The id of an Atom.

Return type:

Iterator[int]

get_deleter_ids()

Yield the ids of deleter atoms.

Yields:

The id of a deleter Atom.

Return type:

Iterator[int]

get_deleters()

Yield the deleter atoms in the functional group.

These are atoms which are removed during ConstructedMolecule construction.

Yields:

A deleter atom.

Return type:

Iterator[Atom]

get_hydrogen()[source]

Get the hydrogen atom.

Return type:

H

Returns:

The hydrogen atom.

get_num_bonders()

Get the number of bonder atoms.

Return type:

int

Returns:

The number of bonder atoms.

get_oxygen()[source]

Get the oxygen atom.

Return type:

O

Returns:

The oxygen atom.

get_placer_ids()

Yield the ids of placer atoms.

Placer atoms are those, which should be used to calculate the position of the functional group.

Yields:

The id of an Atom.

Return type:

Iterator[int]

with_atoms(atom_map)

Return a clone holding different atoms.

Parameters:

atom_map (dict[int, Atom]) – Maps the id of an atom in the functional group to the new atom the clone should hold. If the id of an atom in the functional group is not found in atom_map, the atom will not be replaced in the clone.

Return type:

GenericFunctionalGroup

Returns:

The clone.

with_ids(id_map)[source]

Return a clone holding different atom ids.

Parameters:

id_map (dict[int, int]) – Maps the id of an atom in the functional group to the new id the clone should hold. If the id of an atom in the functional group is not found in id_map, the atom will not be replaced in the clone.

Return type:

Aldehyde

Returns:

The clone.