def setUpClass(self): from moleculekit.home import home from moleculekit.molecule import Molecule from moleculekit.tools.preparation import proteinPrepare from moleculekit.tools.autosegment import autoSegment self.testf = os.path.join(home(), 'test-data', 'test-voxeldescriptors') mol = Molecule(os.path.join(self.testf, '3PTB.pdb')) mol.filter('protein') mol = autoSegment(mol, field='both') mol = proteinPrepare(mol) mol.bonds = mol._guessBonds() self.mol = mol
def setUpClass(self): from moleculekit.home import home from moleculekit.molecule import Molecule from moleculekit.tools.preparation import systemPrepare from moleculekit.tools.autosegment import autoSegment self.testf = os.path.join(home(), "test-data", "test-voxeldescriptors") mol = Molecule(os.path.join(self.testf, "3PTB.pdb")) mol.filter("protein") mol = autoSegment(mol, field="both") mol = systemPrepare(mol, pH=7.0) mol.bonds = mol._guessBonds() self.mol = mol
def test_metricsphericalcoordinate(self): from moleculekit.molecule import Molecule from moleculekit.home import home from os import path mol = Molecule( path.join(home(dataDir='test-projections'), 'trajectory', 'filtered.pdb')) ref = mol.copy() mol.read( path.join(home(dataDir='test-projections'), 'trajectory', 'traj.xtc')) mol.bonds = mol._guessBonds() res = MetricSphericalCoordinate(ref, 'resname MOL', 'within 8 of resid 98').project(mol) _ = MetricSphericalCoordinate(ref, 'resname MOL', 'within 8 of resid 98').getMapping(mol) ref_array = np.load( path.join(home(dataDir='test-projections'), 'metricsphericalcoordinate', 'res.npy')) assert np.allclose(res, ref_array, rtol=0, atol=1e-04)