Skip to content

utils

Functions:

paths_from_glob

paths_from_glob(path_pattern)

Evaluate the pattern and extract the paths

Source code in ties/docking/utils.py
 7
 8
 9
10
11
def paths_from_glob(path_pattern):
    """
    Evaluate the pattern and extract the paths
    """
    return [Path(p) for p in glob.glob(path_pattern)]

load_conformers

load_conformers(sdf) -> Mol

Load the SDF as one mol with many conformers

Source code in ties/docking/utils.py
20
21
22
23
24
25
26
27
28
29
30
31
def load_conformers(sdf) -> Chem.Mol:
    """
    Load the SDF as one mol with many conformers
    """
    mol = None
    for conf in Chem.SDMolSupplier(sdf, removeHs=False):
        if mol is None:
            mol = conf

        mol.AddConformer(conf.GetConformer(), assignId=True)

    return mol