moleculekit.tools.moleculechecks module#
- moleculekit.tools.moleculechecks.areLigandsDocked(prot_file, sdf_file, threshold: float = 10, max_check: int | None = None)#
Check whether all ligands in an SDF file are docked to a protein.
Each ligand in
sdf_fileis tested against the protein withisLigandDocked().- Parameters:
prot_file (str) – Path to the protein structure file.
sdf_file (str) – Path to the SDF file containing one or more ligands.
threshold (float) – Maximum allowed closest protein-ligand distance, in Angstrom, for a ligand to count as docked.
max_check (int, optional) – If given, only the first
max_checkligands are checked.
- Returns:
all_docked (bool) – True if every checked ligand is docked, False otherwise.
not_docked (list of str) – The names of the ligands that were found not to be docked.
- moleculekit.tools.moleculechecks.areLigandsOptimized(sdf_file, max_check: int | None = None)#
Check whether all ligands in an SDF file have optimized 3D geometries.
Each ligand in
sdf_fileis tested withisLigandOptimized().- Parameters:
- Returns:
all_optimized (bool) – True if every checked ligand is optimized, False otherwise.
not_optimized (list of str) – The names of the ligands that were found to be flat (not optimized).
- moleculekit.tools.moleculechecks.closestDistance(mol1: Molecule, mol2: Molecule)#
Compute the minimum distance between the atoms of two molecules.
The two molecules are temporarily combined and the smallest pairwise distance between any atom of
mol1and any atom ofmol2is returned.- Parameters:
mol1 (moleculekit.molecule.Molecule) – The first molecule.
mol2 (moleculekit.molecule.Molecule) – The second molecule.
- Returns:
dist – The shortest distance, in Angstrom, between any atom of
mol1and any atom ofmol2.- Return type:
- moleculekit.tools.moleculechecks.isLigandDocked(prot: Molecule, lig: Molecule, threshold: float = 10) bool#
Check whether a ligand is docked close to a protein.
- Parameters:
prot (moleculekit.molecule.Molecule) – The protein molecule.
lig (moleculekit.molecule.Molecule) – The ligand molecule.
threshold (float) – Maximum allowed distance, in Angstrom, between the closest protein and ligand atoms for the ligand to be considered docked.
- Returns:
docked – True if the closest protein-ligand distance is below
threshold, False otherwise.- Return type:
- moleculekit.tools.moleculechecks.isLigandOptimized(mol: Molecule, atol: float = 1e-06) bool#
Check whether a ligand has a 3D-optimized (non-flat) geometry.
All dihedral angles being either 0 or +/-pi means the ligand is planar, which indicates that it has not been optimized into a 3D conformation. Ligands with three or fewer atoms cannot be planar and are always considered optimized.
- Parameters:
mol (moleculekit.molecule.Molecule) – The ligand molecule. If it has no bonds, they are guessed in place.
atol (float) – Absolute tolerance, in radians, for deciding whether a dihedral angle is effectively 0 or +/-pi (i.e. flat).
- Returns:
optimized – True if at least one dihedral angle deviates from a planar value (or the ligand has three or fewer atoms), False if the ligand is flat.
- Return type:
- moleculekit.tools.moleculechecks.isProteinProtonated(mol: Molecule) bool#
Heuristically check whether a protein carries its hydrogen atoms.
Counts the protein hydrogens versus protein heavy atoms and decides that the protein is protonated only if there is a significant number of hydrogens relative to the heavy atoms.
- Parameters:
mol (moleculekit.molecule.Molecule) – The molecule to inspect.
- Returns:
protonated – True if the protein appears to be protonated, False otherwise.
- Return type:
- moleculekit.tools.moleculechecks.proteinHasBonds(mol: Molecule) bool#
Check whether the protein atoms of a molecule are bonded together.
Counts the bonds whose both atoms are protein atoms and compares against the number of protein atoms. A fully connected protein chain of
natoms has at leastn - 1bonds.- Parameters:
mol (moleculekit.molecule.Molecule) – The molecule to inspect.
- Returns:
has_bonds – True if the protein atoms appear to be bonded together, False otherwise.
- Return type: