def test_superpose(self): npdb1 = numpdb.NumPdb(data("1U19.pdb")) npdb2 = numpdb.NumPdb(data("3DQB.pdb")) sele = numpdb.numsele("1-326:A") sp, msg = numpdb.superpose(npdb1, npdb2, sele, sele, align=False) np.testing.assert_almost_equal(sp.rmsd, 2.8033625498819172)
def test_tmscore(self): npdb1 = numpdb.NumPdb(data("trajec_1.pdb")) coords1 = npdb1.get('xyz', atomname='CA') npdb2 = numpdb.NumPdb(data("trajec_2.pdb")) coords2 = npdb2.get('xyz', atomname='CA') result = tmscore(coords1, coords2) np.testing.assert_almost_equal(result, 0.780818185612)
def test_info(self): npdb = numpdb.NumPdb( data("1CRN.pdb"), { "phi_psi": False, "sstruc": True, "backbone_only": False, "protein_only": False, "detect_incomplete": False, "configuration": False, "info": True }) self.assertDictEqual( npdb._info, { "title": "WATER STRUCTURE OF A HYDROPHOBIC PROTEIN AT ATOMIC " "RESOLUTION. PENTAGON RINGS OF WATER MOLECULES IN CRYSTALS " "OF CRAMBIN", 'header': ['PLANT PROTEIN', '30-APR-81', '1CRN'], "obsolete": [], "model_type": {}, "experiment": "X-RAY DIFFRACTION", "keywords": ["PLANT SEED PROTEIN", "PLANT PROTEIN"], "splited_entry": [], "resolution": 1.5 })
def test_secondary_structure(self): npdb = numpdb.NumPdb( data("1CRN.pdb"), { "phi_psi": False, "sstruc": True, "backbone_only": False, "protein_only": False, "detect_incomplete": False, "configuration": False }) self.assertEquals(npdb._sstruc[0].resname1, "THR")
def test_missing(self): npdb = numpdb.NumPdb( data("3SN6.pdb"), { "phi_psi": False, "sstruc": True, "backbone_only": False, "protein_only": False, "detect_incomplete": False, "configuration": False, "detect_missing": True }) self.assertEqual( str(npdb._missing[7]), "MissingRecord(type='Residue', model=' ', " + "resname='MET', chain=' A', ssseqi=1, identifier=' ', " + "atoms=None)")