Ejemplo n.º 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
Ejemplo n.º 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
Ejemplo n.º 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