Classes#
- class cgbind.Linker(arch_name, smiles=None, name='linker', charge=0, n_confs=300, filename=None, use_etdg_confs=False)#
- __init__(arch_name, smiles=None, name='linker', charge=0, n_confs=300, filename=None, use_etdg_confs=False)#
Metallocage Linker. Inherits from cgbind.molecule.Molecule
- Parameters:
arch_name – (str) Name of the architecture
smiles – (str) SMILES string
name – (str) Linker name
charge – (int)
n_confs – (int) Number of initial conformers to search through
filename – (str)
use_etdg_confs – (bool) Use a different, sometimes better, conformer generation algorithm
- arch#
(Arch object) Metallocage architecture
- cage_template#
(Template object) Metallocage template
- dr#
(float) Template shift distance
- get_xmotif_coordinates()#
Return a numpy array of all the coordinates in the Xmotifs
- set_ranked_linker_possibilities(metal=None, n=0)#
For this linker, return a list of Linker objects with appropriate .xyzs, .dr and .x_motifs attributes ordered by their cost function low -> high i.e. good to bad. This will loop through all the possibilities and the possible combinations of x motifs in the linker. Linker.dr controls how large the template needs to be to make the best fit
- Parameters:
metal – (str) Atomic symbol of the metal
n – (int) linker number in the template
- Returns:
(list(Linker))
- x_atoms#
(list(int)) List of donor atom ids
- x_motifs#
(list(Xmotif object))
- class cgbind.Cage(linker=None, metal='M', metal_charge=0, linkers=None, solvent=None, mult=1, name='cage', max_cost=5)#
- __init__(linker=None, metal='M', metal_charge=0, linkers=None, solvent=None, mult=1, name='cage', max_cost=5)#
Metallocage object. Inherits from cgbind.molecule.BaseStruct
- Variables:
self.metal – (str)
self.linkers – (list(Linker object))
self.dr – (float)
self.arch – (Arch object)
self.cage_template – (Template object)
self.m_ids – (list(int))
self.metal_charge – (int)
- Parameters:
name – (str) Name of the cage
solvent – (str)
linker – (Linker object) Linker to initialise a homoleptic metallocage
linkers – (list(Linker object)) List of Linkers to inialise a metallocage
metal – (str) Atomic symbol of the metal
metal_charge – (int) Formal charge on the metal atom/ion
mult – (int) Total spin multiplicity of the cage
max_cost – (float) Acceptable ligand-ligand repulsion to accommodate in metallocage construction
- get_cavity_vol()#
For a cage extract the cavity volume defined as the volume of the largest sphere, centered on the cage centroid that may be constructed while r < r(midpoint–closest atom)
- Returns:
(float) Cavity volume in Å^3
- get_centroid()#
Get the centroid of a metallocage. Defined as the midpoint between all self.metal atoms in the structure
- Returns:
(np.ndarray) Centroid coordinate (x, y, z)
- get_charges(estimate=False)#
Get the partial atomic charges on the cage either using XTB or estimate using no polarisation i.e. the metals retain their full charge and the linker charges are estimated using the Gasteiger scheme in RDKit
- Parameters:
estimate – (bool)
guess – (bool) Guess the charges based on the electronegativity
- Returns:
(function) calculations.get_charges(self)
- get_esp_cube(return_min_max=False)#
Get the electrostatic potential (ESP) in a Gaussian .cube format by calculating partial atomic charges using XTB (tested with v. 6.2). Calls self.get_charges() and depends on self.xyzs
- Parameters:
return_min_max – (bool) Return the minimum and maximum of the ESP along with the cube file lines evaluated roughly on the VdW surface
- Returns:
(list) .cube file lines
- get_m_m_dist()#
For a cage calculate the average M-M distance
- Returns:
(float) Distance in Å
- get_max_escape_sphere(basinh=False, max_dist_from_metals=10)#
Get the maximum radius of a sphere that can escape from the centroid of the cage – will iterate through all theta/phi
- Parameters:
basinh – (bool) Find the true maximum escape sphere by basin hopping on the surface
max_dist_from_metals –
- (float) Distance in Å on top of the
average M-M distance that will be used for
the search for the maximum escape sphere
- Returns:
(float) Volume of the maximum escape sphere in Å^3
- get_metal_atom_ids()#
Get the atom ids of the self.metal atoms in the xyzs
- Returns:
(list(int))
- get_num_h_bond_acceptors()#
Get the number of hydrogen bond acceptors in a metallocage
- Returns:
(int)
- get_num_h_bond_donors()#
Get the number of hydrogen bond donors in a metallocage
- Returns:
(int)
- get_num_rot_bonds()#
Get the number of rotatable bonds in a metallocage
- Returns:
(int)
- print_esp_cube_file()#
Print an electrostatic potential (ESP) .cube file. Prints the lines from self.get_esp_cube()
- Returns:
None
- class cgbind.Substrate(smiles=None, name='substrate', n_confs=1, charge=0, mult=1, filename=None, solvent=None)#
- __init__(smiles=None, name='substrate', n_confs=1, charge=0, mult=1, filename=None, solvent=None)#
Substrate. Inherits from cgbind.molecule.Molecule
- Parameters:
smiles – (str) SMILES string
name – (str) Molecule name
n_confs – (int) Number of conformers to initialise with
charge – (int) Charge on the molecule
mult – (int) Spin multiplicity on the molecule
filename – (str)
- gen_confs(n_confs=1)#
Populate self.conf_xyzs by calling RDKit
- class cgbind.CageSubstrateComplex(cage, substrate, solvent=None, mult=1, n_subst_confs=1, n_init_geom=50, energy_method='repulsion')#
- __init__(cage, substrate, solvent=None, mult=1, n_subst_confs=1, n_init_geom=50, energy_method='repulsion')#
Cage-substrate complex. Generated by minimising the energy given an energy method. Inherits from cgbind.molecule.BaseStruct
- Variables:
self.energy_func – (function)
self.binding_energy_kcal – (float) Binding energy of the substrate in kcal mol-1
self.n_subst_confs – (int)
self.n_init_geom – (int)
self.name – (str) cage.name + ‘_’ + substrate.name
self.cage – (Cage object)
self.substrate – (Substrate object)
- Parameters:
cage – (Cage object)
substrate – (Substrate object)
solvent – (str)
mult – (int) Spin multiplicity of the cage-substrate complex
n_subst_confs – (int) Number of substrate conformations to iterate over while minimising the energy
n_init_geom – (int) Number of initial geometries to minimise the energy from (generated by random rotation)
energy_method – (str) Name of the energy method to build the structure from
- class cgbind.molecule.BaseStruct(name='molecule', charge=0, mult=1, filename=None, solvent=None)#
- __init__(name='molecule', charge=0, mult=1, filename=None, solvent=None)#
Base structure class
- Parameters:
name – (str)
charge – (int)
mult – (int) Spin multiplicity
filename – (str)
solvent – (str)
- atoms#
(list(list)) Geometry of the structure
- centre()#
Centre the species at the centre of mass (i.e. so COM = origin)
- charge#
(int) Charge in e
- com#
(np.ndarray) Center of mass (x, y, z)
- energy#
(float) Energy in Hartrees (Ha)
- mult#
(int) Spin multiplicity 2S+1
- n_atoms#
(int) Number of atoms
- name#
(str) Name of the structure
- optimise(method, keywords=None, n_cores=1, cartesian_constraints=None)#
Perform a single-point energy evaluation using an electronic structure theory method e.g. XTB, ORCA, G09
- Parameters:
method – (autode.ElectronicStructureMethod)
keywords – (list(str)) Keywords to use for the ESM e.g. [‘Opt’, ‘PBE’, ‘def2-SVP’]
n_cores – (int) Number of cores for the calculation to use
cartesian_constraints – (list(int)) List of atom ids to constrain to their current coordinates
- Returns:
None
- print_xyz_file(filename=None)#
Print a .xyz file from self.xyzs provided self.reasonable_geometry is True
- Parameters:
filename – (str) Override the default filename
- Returns:
None
- reasonable_geometry#
(bool)
- set_atoms(atoms=None, coords=None)#
Set the xyzs of a molecular structure
- Parameters:
atoms – (list(cgbind.atoms.Atom))
coords – (np.ndarray) n_atoms x 3 positions of the atoms
- Returns:
None
- singlepoint(method, keywords=None, n_cores=None)#
Perform a single-point energy evaluation using an electronic structure theory method e.g. XTB, ORCA, G09
- Parameters:
method – (autode.ElectronicStructureMethod)
keywords – (list(str)) Keywords to use for the ESM e.g. [‘SP’, ‘PBE’, ‘def2-SVP’]
n_cores – (int) Number of cores for the calculation to use
- Returns:
None
- solvent#
(str) Name of the solvent
- class cgbind.molecule.Molecule(smiles=None, name='molecule', charge=0, mult=1, n_confs=1, filename=None, solvent=None, use_etdg_confs=False)#
- __init__(smiles=None, name='molecule', charge=0, mult=1, n_confs=1, filename=None, solvent=None, use_etdg_confs=False)#
Molecule. Inherits from cgbind.molecule.BaseStruct
- Parameters:
smiles – (str) SMILES string
name – (str) Molecule name
n_confs – (int) Number of conformers to initialise with
charge – (int) Charge on the molecule
mult – (int) Spin multiplicity on the molecule
filename – (str)
use_etdg_confs – (bool) Use an alternate conformer generation algorithm
- bonds#
(list(tuple)) List of bonds defined by atom ids
- conformers#
(list(BaseStruct)) List of conformers
- get_charges(estimate=False)#
Get the partial atomic charges using either XTB or estimate with RDKit using the Gasteiger charge scheme
- Parameters:
estimate – (bool)
guess – (bool)
- Returns:
- mol_obj#
(RDKit.mol object)
- n_confs#
(int) Number of conformers initialised with
- n_h_acceptors#
(int) Number of H-bond acceptors
- n_h_donors#
(int) Number of H-bond donors
- n_rot_bonds#
(int) Number of rotatable bonds
- smiles#
(str) SMILES string
- volume#
(float) Molecular volume in Å^3