def testWrite(self): dcd = DCDFile(self.dcd, 'w') dcd.write(ENSEMBLE.getCoordsets()) dcd.close() e = parseDCD(self.dcd) assert_allclose(e._getCoordsets(), ENSEMBLE._getCoordsets(), rtol=RTOL, atol=ATOL, err_msg='failed to parse DCD file correctly')
def testWriteModeAppend(self): dcd = DCDFile(writeDCD(self.dcd, ENSEMBLE), 'a') dcd.write(ENSEMBLE.getCoordsets()) dcd.close() e = parseDCD(self.dcd) n_csets = len(ENSEMBLE) coordsets = e._getCoordsets() assert_equal(coordsets, coordsets, 'failed to parse DCD file correctly') assert_allclose(coordsets[:n_csets], ENSEMBLE._getCoordsets(), rtol=RTOL, atol=ATOL, err_msg='failed to parse DCD file correctly')
def setUp(self): self.output = join(TEMPDIR, 'test_prody_catdcd.dcd') self.dcdpath = pathDatafile('dcd') self.pdbpath = pathDatafile('multi_model_truncated') self.dcd = DCDFile(self.dcdpath) self.ag = parsePDB(self.pdbpath, model=1) self.command = 'catdcd -o ' + self.output self.tearDown()