Пример #1
0
def molecules(request):
    system = request.param

    fref = os.path.join(molpath, system, f"{system}_ligand.sdf")
    fmols = os.path.join(molpath, system, f"{system}_dock.sdf")

    ref = io.load(os.path.join(molpath, fref))
    mols = io.loadall(os.path.join(molpath, fmols))

    ref = io.to_molecule(ref)
    mols = [io.to_molecule(mol) for mol in mols]

    ref.strip()
    for mol in mols:
        mol.strip()

    return ref, mols, system
Пример #2
0
def load(fname: str) -> Tuple[Any, molecule.Molecule]:
    """
    Load molecule from file.

    Parameters
    ----------
    fname: str
        Input file name

    Returns
    -------
    Tuple[Any, molecule.Molecule]
        Loaded molecule as `pybel.Molecule` or `rdkit.Chem.rdkem.Mol` and
        `pyrmsd.molecule.Molecule`
    """

    fname = os.path.join(molpath, fname)

    m = io.load(fname)

    mol = io.to_molecule(m, adjacency=True)

    return m, mol
Пример #3
0
def test_load_pdb(molfile, natoms: int, nbonds: int) -> None:

    m = io.load(os.path.join(molpath, molfile))

    assert io.numatoms(m) == natoms
    assert io.numbonds(m) == nbonds