Generic Functional Group
- class GenericFunctionalGroup(atoms, bonders, deleters, placers=None)[source]
Bases:
FunctionalGroup
A functional group which defines general atomic classes.
Bonders are atoms which should have bonds added by a
Reaction
. Deleters are atoms which should be removed by aReaction
.This interface allows the same reactions to be carried out across different functional groups, without knowing which specific elements it holds.
Methods
clone
()Return a clone.
Yield the ids of all atoms in the functional group.
Yield all the atoms in the functional group.
Yield the ids of bonder atoms.
Yield bonder atoms in the functional group.
Yield the ids of core atoms held by the functional group.
Yield the ids of deleter atoms.
Yield the deleter atoms in the functional group.
Get the number of bonder atoms.
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__(atoms, bonders, deleters, placers=None)[source]
Initialize a
GenericFunctionalGroup
.- Parameters:
atoms (
tuple
[Atom
,...
]) – The atoms in the functional group.bonders (
tuple
[Atom
,...
]) – The bonder atoms in the functional group.deleters (
tuple
[Atom
,...
]) – The deleter atoms in the functional group.placers (
Optional
[tuple
[Atom
,...
]]) – The placer atoms of the functional group. IfNone
, the bonders will be used.
- get_atom_ids()
Yield the ids of all atoms in the functional group.
- get_atoms()
Yield all the atoms in the functional group.
- get_bonders()[source]
Yield bonder atoms in the functional group.
These are atoms which have bonds added during
ConstructedMolecule
construction.
- get_core_atom_ids()
Yield the ids of core atoms held by the functional group.
See also
- get_deleters()[source]
Yield the deleter atoms in the functional group.
These are atoms which are removed during
ConstructedMolecule
construction.
- get_num_bonders()[source]
Get the number of bonder atoms.
- Return type:
- Returns:
The number of bonder atoms.
- 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.
- with_atoms(atom_map)[source]
Return a clone holding different atoms.
- with_ids(id_map)[source]
Return a clone holding different atom ids.