benchmate.molecule
benchmate.molecule.molecule
MoleculeInfo Objects
@dataclass(slots=True)
class MoleculeInfo()
Molecule info to store all the information related to a small molecule
get_ecfp4_fp
def get_ecfp4_fp()
get ecfp4 fingerprint for a given fingerprint radius and dimensions
Returns:
the fingerpring attribute filled in returns nothing
get_fcfp4_fp
def get_fcfp4_fp()
same as above but with fcfp
get_maccs_fp
def get_maccs_fp()
same as above but with open source maccs
Molecule Objects
class Molecule()
Molecule class to represent chemical structures using SMILES or InChI. this will include methods for different property calculations and structure comparisons using usearch molecules.
__init__
def __init__(name, smiles, fingerprint_dim=2048, radius=2)
Arguments:
name: name of the moleculesmiles: the smiles of the moleculefingerprint_dim: the dimension of the fingerprint to generate all 3 fingerprints will use the same dimradius: the radius (in terms of graph distance, not angstroms) to use for fingerprinting
similarity
def similarity(other, fingerprint)
get the similarity betweek two molecule instances
Arguments:
other: other molecule instancefingerprint: what kind of fingerprint to use
Returns:
returns the tanimoto similarity between to molecules
generate_conformers
def generate_conformers(n, prune_thres=0.5, optimize_geom=True)
generate conformers
Arguments:
n: number of conformers to try to generate, based on pruning they number can be smalledprune_thres: remove any conformer that has this much rmsd or less. So lower values will give more conformersoptimize_geom: whether to optimize the geometry, this will also get rid of some comformers
Returns:
returns a hydrogenated mol with all the conformers that you can get with mol.GetConformers(
inchikey
def inchikey() -> str
generate the inchi key for the molecule
Returns:
inchikey
__eq__
def __eq__(other)
using inchi key because the molecules might not be in canonical smiles, it’s not perfect but close