smores.Molecule#
- class smores.Molecule(atoms, positions, dummy_index, attached_index, excluded_indices=None, radii=None)[source]#
Bases:
objectCalculates
StericParametersfrom STREUSEL radii.See also
EspMolecule: For calculating steric parameters from electrostatic potentials.
Examples
Calculate steric parameters
>>> import smores >>> molecule = smores.Molecule.from_smiles("Cl", dummy_index=0, attached_index=1) >>> molecule.get_steric_parameters() StericParameters(L=3.57164113574581, B1=1.9730970556668774, B5=2.320611610648539)
Tip
There are many different way to initialize a
Molecule, for examplefrom_mol_file()orfrom_xyz_file(). See the list of methods below.Use custom atomic radii
If we want to use custom atomic radii, we can simply make use of the radii parameter, where we provide the desired radius of each atom
>>> import smores >>> molecule = smores.Molecule.from_smiles("Cl", dummy_index=0, attached_index=1, radii=[1.75, 1.2]) >>> molecule.get_steric_parameters() StericParameters(L=3.57164113574581, B1=1.9730970556668774, B5=2.320611610648539)
Initialize a
Molecule.- Parameters:
atoms (list[str]) – The elemental symbol of each atom of the molecule.
positions (list[list[float]]) – The coordinates of each atom of the molecule, provided as an N x 3 matrix.
dummy_index (int) – The index of the dummy atom.
attached_index (int) – The index of the attached atom of the substituent.
excluded_indices (list[int]) – The indices of atoms which are not included in the parameter calculation.
radii (list[float]) – The radius of each atom of the molecule. If
Nonethe STREUSEL radii will be used.
Methods
Get a molecule from a
Combination.Get a molecule from a
.molfile.Get a molecule from an
rdkitmolecule.Get a molecule from a SMILES string.
Get a molecule from a
.xyzfile.Get the index of the atom attached to the substituent.
Get the index of the dummy atom.
Yield indices of atoms excluded from the parameter calculation.
Get the steric paramters from STREUSEL radii.
- classmethod from_combination(combination, radii=None)[source]#
Get a molecule from a
Combination.The molecule will automatically use the dummy and attached index defined in combination and set all the
core_indicesas excluded indices.- Parameters:
combination (Combination) – A combination of a core and substituent molecule.
radii (list[float]) – The radius of each atom of the molecule. If
Nonethe STREUSEL radii will be used.
- Returns:
The molecule.
- Return type:
- classmethod from_mol_file(path, dummy_index, attached_index, excluded_indices=None, radii=None)[source]#
Get a molecule from a
.molfile.- Parameters:
dummy_index (int) – The index of the dummy atom.
attached_index (int) – The index of the attached atom of the substituent.
excluded_indices (list[int]) – The indices of atoms which are not included in the parameter calculation.
radii (list[float]) – The radius of each atom of the molecule. If
Nonethe STREUSEL radii will be used.
- Returns:
The molecule.
- Return type:
- classmethod from_rdkit(molecule, dummy_index, attached_index, excluded_indices=None, radii=None, conformer_id=0)[source]#
Get a molecule from an
rdkitmolecule.- Parameters:
molecule (Mol) – The
rdkitmolecule. It must have at least one conformer.dummy_index (int) – The index of the dummy atom.
attached_index (int) – The index of the attached atom of the substituent.
excluded_indices (list[int]) – The indices of atoms which are not included in the parameter calculation.
radii (list[float]) – The radius of each atom of the molecule. If
Nonethe STREUSEL radii will be used.conformer_id (int) – The id of the conformer to use.
- Returns:
The
smoresmolecule.- Return type:
- classmethod from_smiles(smiles, dummy_index, attached_index, excluded_indices=None, positions=None, radii=None)[source]#
Get a molecule from a SMILES string.
- Parameters:
smiles (str) – The SMILES of the molecule.
dummy_index (int) – The index of the dummy atom.
attached_index (int) – The index of the attached atom of the substituent.
excluded_indices (list[int]) – The indices of atoms which are not included in the parameter calculation.
positions (list[list[float]]) – The coordinates of each atom of the molecule provided as an N x 3 matrix. If
Nonethen the molecule will have its coordinates calculated with ETKDG.radii (list[float]) – The radius of each atom of the molecule. If
Nonethe STREUSEL radii will be used.
- Returns:
The molecule.
- Return type:
- classmethod from_xyz_file(path, dummy_index, attached_index, excluded_indices=None, radii=None)[source]#
Get a molecule from a
.xyzfile.- Parameters:
dummy_index (int) – The index of the dummy atom.
attached_index (int) – The index of the attached atom of the substituent.
excluded_indices (list[int]) – The indices of atoms which are not included in the parameter calculation.
radii (list[float]) – The radius of each atom of the molecule. If
Nonethe STREUSEL radii will be used.
- Returns:
The molecule.
- Return type:
- get_attached_index()[source]#
Get the index of the atom attached to the substituent.
- Returns:
The index of the atom attached to the substituent.
- Return type:
- get_dummy_index()[source]#
Get the index of the dummy atom.
- Returns:
The index of the dummy atom.
- Return type: