Complexes#
The complexes package provides a simple way to create complexes of multiple molecules. Specifically implemented are:
- class buildamol.extensions.complexes.metal_complexer.MetalComplexer(metal: str | Atom, geometry: Geometry)[source]#
Bases:
objectThe MetalComplexer can be used to make metal complexes by aligning ligands to a metal core.
- Parameters:
- add_ligand(ligand: Molecule, binders: list, delete: list = None, direction: str = 'planar', acceptors: list = None, optimize: bool = None, optimize_kwargs: dict = None, copy: bool = True) Molecule[source]#
Add a ligand to the metal core.
- Parameters:
ligand (Molecule) – The ligand to add.
binders (list) – A list of atom objects or other atom identifiers to get atoms from the ligand, that will bind to the metal core.
delete (list, optional) – A list of atom objects or other atom identifiers to get atoms from the ligand, that will be deleted after alignment. Each of these must be a direct neighbor of a binder atom. They must be specified in the same order as the binders, by default None, in which case a random hydrogen neighbor from each binder is deleted.
direction (str) – The direction in which to align the ligand to the metal core, if multiple binders are specified. This can be either “planar” or “axial”. To achieve a mixed alignment or specific alignment to hydrogens use the “acceptors” argument instead.
acceptors (list, optional) – A list of atom objects or other atom identifiers to get hydrogen atoms from the core. These will be used to align the ligand to the core. If specified, the “direction” argument will be ignored, by default None. The acceptors must be specified in the same order as the binders to which they should be aligned.
optimize (bool, optional) – If True, optimize the ligand after alignment, by default optimization will be performed if multiple binders are specified.
optimize_kwargs (dict, optional) – The keyword arguments to pass to the optimizer, by default None
copy (bool, optional) – If True, make a copy of the ligand, by default True
- add_ligands(ligands: list, binders: list, delete: list = None, acceptors: list = None, optimize: bool = None, optimize_kwargs: dict = None, copy: bool = True) Molecule[source]#
Add multiple ligands to the metal core. This method will only perform one optimization at the end of the alignment and should be faster than adding ligands one by one.
- Parameters:
ligands (list) – A list of ligand molecules to add.
binders (list) – Lists of atom objects or other atom identifiers to get atoms from the ligands, that will bind to the metal core. This is a list of lists where each sublist corresponds to a ligand’s binder atoms.
delete (list, optional) – Lists of atom objects or other atom identifiers to get atoms from the ligand, that will be deleted after alignment. Each of these must be a direct neighbor of a binder atom. They must be specified in the same order as the binders, by default None, in which case a random hydrogen neighbor from each binder is deleted. Similarly, this is a list of lists where each sublist corresponds to a ligand’s delete atoms.
acceptors (list, optional) – Lists of atom objects or other atom identifiers to get hydrogen atoms from the core. These will be used to align the ligands to the core. This is a list of lists where each sublist corresponds to a ligand’s acceptor atoms.
optimize (bool, optional) – If True, optimize the ligands after alignment, by default optimization will be performed if multiple binders or ligands are specified.
optimize_kwargs (dict, optional) – The keyword arguments to pass to the optimizer, by default None
copy (bool, optional) – If True, make a copy of the ligands before adding, by default True
- get_complex() Molecule[source]#
Get the current metal complex.
- Returns:
The metal complex.
- Return type:
- class buildamol.extensions.complexes.rotaxane_builder.RotaxaneBuilder[source]#
Bases:
objectA rotaxane builder class. Use this to retain more control over the rotaxane building process, compared to the toplevel rotaxane function.
- distribute_along_axle(axle: Molecule, cycles: List[Molecule])[source]#
Distribute the cycles along the axle molecule. This will spacially position the cycles in equal intervals along the longest axis of the axle molecule and rotate them perpendicular to the longest axis. No molecules will be merged at this stage.
- Parameters:
axle (core.Molecule) – The axle molecule
cycles (List[core.Molecule]) – The cyclic molecules to distribute along the axle.
- merge() Molecule[source]#
Merge the cycles and axle into a single molecule. Specifically, the cycles are merges as new chains into the axle molecule.
- optimize(translation: bool = False, rotation: bool = True, translation_bounds: tuple = (-10, 10))[source]#
Optimize the spacial arrangement of each cycle around the axle. This is helpful if you have a non-linear axle molecule that requires a positional fitting to minimize the risk of clashes.
This step requires that the cycles have been distributed along the axle using the distribute_along_axle method.
- Parameters:
translation (bool, optional) – Whether to optimize the translation of the cycles, by default False
rotation (bool, optional) – Whether to optimize the rotation of the cycles, by default True
translation_bounds (tuple, optional) – The bounds for the minimal and maximal translation and rotation values. If a tuple of length two this is interpreted as the low and high bounds for translation only. Otherwise provide a tuple of length 6 for the bounds of translation and rotation. In this case values can be either singular (int/float) in which case they are interpreted as symmetric extrama (min=-value, max=+value) or as tuples with (min=value[0], max=value[1]). Mixed inputs are allowed.
- buildamol.extensions.complexes.rotaxane_builder.rotaxane(axle: Molecule, cycles: List[Molecule], optimize: bool = True, copy_axle: bool = False, copy_cycles: bool = False) Molecule[source]#
Create a rotaxane from an axle and one or more cyclic molecules.
- Parameters:
axle (core.Molecule) – The axle molecule.
cycles (list[core.Molecule]) – One or more cyclic molecules. These will be threaded onto the axle.
optimize (bool, optional) – Whether to optimize the spacial arrangement of each cycle around the axle. This is helpful if you have a non-linear axle molecule that requires a positional fitting to minimize the risk of clashes.
copy_axle (bool, optional) – If True, the axle molecule will be copied, by default False
copy_cycles (bool, optional) – If True, the cyclic molecules will be copied, by default False
- Returns:
The rotaxane where each cycle is its own chain.
- Return type:
core.Molecule