Beispiel #1
0
    def test_customDisulfideBonds(self):
        from htmd.molecule.molecule import Molecule
        from htmd.builder.solvate import solvate
        from htmd.home import home
        from htmd.util import tempname, assertSameAsReferenceDir
        import os
        import numpy as np

        # Use pre-prepared files so we can tell whether the error is in prepare or in build
        # Inputs are reference outputs of proteinprepare.
        preparedInputDir = home(dataDir='test-proteinprepare')

        pdb = '1GZM'
        inFile = os.path.join(preparedInputDir, pdb,
                              "{}-prepared.pdb".format(pdb))
        mol = Molecule(inFile)
        mol.filter('protein')  # Fix for bad proteinPrepare hydrogen placing

        np.random.seed(1)  # Needed for ions
        smol = solvate(mol)
        topos = ['top/top_all36_prot.rtf', 'top/top_water_ions.rtf']
        params = ['par/par_all36_prot_mod.prm', 'par/par_water_ions.prm']
        disu = [['segid 1 and resid 110', 'segid 1 and resid 187'],
                ['segid 0 and resid 110', 'segid 0 and resid 187']]
        tmpdir = tempname()
        _ = build(smol,
                  topo=topos,
                  param=params,
                  outdir=tmpdir,
                  disulfide=disu)

        compareDir = home(dataDir=os.path.join('test-charmm-build', pdb))
        assertSameAsReferenceDir(compareDir, tmpdir)

        # TODO: Remove this after deprecation
        from htmd.builder.builder import DisulfideBridge
        np.random.seed(1)  # Needed for ions
        disu = [
            DisulfideBridge('1', 110, '1', 187),
            DisulfideBridge('0', 110, '0', 187)
        ]
        tmpdir = tempname()
        _ = build(smol,
                  topo=topos,
                  param=params,
                  outdir=tmpdir,
                  disulfide=disu)
        compareDir = home(dataDir=os.path.join('test-charmm-build', pdb))
        assertSameAsReferenceDir(compareDir, tmpdir)
Beispiel #2
0
    def test_customDisulfideBonds(self):
        from moleculekit.molecule import Molecule
        from htmd.builder.solvate import solvate
        from htmd.home import home
        from htmd.util import tempname, assertSameAsReferenceDir
        import os
        import numpy as np

        # Use pre-prepared files so we can tell whether the error is in prepare or in build
        # Inputs are reference outputs of proteinprepare.
        preparedInputDir = home(dataDir="test-proteinprepare")

        pdb = "1GZM"
        inFile = os.path.join(preparedInputDir, pdb, "{}-prepared.pdb".format(pdb))
        mol = Molecule(inFile)
        mol.filter("protein")  # Fix for bad proteinPrepare hydrogen placing

        np.random.seed(1)  # Needed for ions
        smol = solvate(mol)
        topos = ["top/top_all36_prot.rtf", "top/top_water_ions.rtf"]
        params = ["par/par_all36_prot.prm", "par/par_water_ions.prm"]
        disu = [
            ["segid 1 and resid 110", "segid 1 and resid 187"],
            ["segid 0 and resid 110", "segid 0 and resid 187"],
        ]
        tmpdir = tempname()
        _ = build(smol, topo=topos, param=params, outdir=tmpdir, disulfide=disu)

        compareDir = home(dataDir=os.path.join("test-charmm-build", pdb))
        assertSameAsReferenceDir(compareDir, tmpdir)

        # TODO: Remove this after deprecation
        from htmd.builder.builder import DisulfideBridge

        np.random.seed(1)  # Needed for ions
        disu = [
            DisulfideBridge("1", 110, "1", 187),
            DisulfideBridge("0", 110, "0", 187),
        ]
        tmpdir = tempname()
        _ = build(smol, topo=topos, param=params, outdir=tmpdir, disulfide=disu)
        compareDir = home(dataDir=os.path.join("test-charmm-build", pdb))
        assertSameAsReferenceDir(compareDir, tmpdir)