def test_cphasematch_mtz(self): os.chdir(self.thisd) # Need as otherwise tests that happen in other directories change os.cwd() native_mtz_phased = os.path.join(self.testfiles_dir, "toxd_59.1.mtz") mr_mtz = os.path.join(self.testfiles_dir, "phaser_loc0_ALL_c1_tl49_r1_allatom_UNMOD.1.mtz") before_origin, after_origin, change_of_hand, origin_shift = cphasematch.calc_phase_error_mtz(native_mtz_phased, mr_mtz, f_label='FP', sigf_label='SIGFP') self.assertEqual(88.8476, before_origin) self.assertEqual(62.4833, after_origin) self.assertEqual([0.0, 0.5, 0.0], origin_shift) return
def test_cphasematch_mtz_origin(self): os.chdir(self.thisd) # Need as otherwise tests that happen in other directories change os.cwd() native_mtz_phased = os.path.join(self.testfiles_dir, "toxd_59.1.mtz") mr_mtz = os.path.join(self.testfiles_dir, "phaser_loc0_ALL_c1_tl49_r1_allatom_UNMOD.1.mtz") origin = [0.0, 0.5, 0.0] before_origin, after_origin, change_of_hand, origin_shift = cphasematch.calc_phase_error_mtz(native_mtz_phased, mr_mtz, origin=origin) # Can't test exact equality as cphasematch and cctbx return slightly different errors self.assertAlmostEqual(88.8476, before_origin, 0) self.assertAlmostEqual(62.4833, after_origin, 0) self.assertEqual([0.0, 0.5, 0.0], origin_shift) return
def test_cphasematch_mtz(self): os.chdir( self.thisd ) # Need as otherwise tests that happen in other directories change os.cwd() native_mtz_phased = os.path.join(self.testfiles_dir, "toxd_59.1.mtz") mr_mtz = os.path.join( self.testfiles_dir, "phaser_loc0_ALL_c1_tl49_r1_allatom_UNMOD.1.mtz") before_origin, after_origin, change_of_hand, origin_shift = cphasematch.calc_phase_error_mtz( native_mtz_phased, mr_mtz, f_label='FP', sigf_label='SIGFP') self.assertEqual(88.8476, before_origin) self.assertEqual(62.4833, after_origin) self.assertEqual([0.0, 0.5, 0.0], origin_shift) return
def test_cphasematch_shelxe(self): os.chdir( self.thisd ) # Need as otherwise tests that happen in other directories change os.cwd() native_mtz_phased = os.path.join(self.testfiles_dir, "toxd_59.1.mtz") shelxe_mtz = os.path.join( self.testfiles_dir, "shelxe_phaser_loc0_ALL_c1_t49_r1_polyAla_UNMOD.mtz") origin = [0.0, 0.0, 0.0] before_origin, after_origin, change_of_hand, origin_shift = cphasematch.calc_phase_error_mtz( native_mtz_phased, shelxe_mtz, origin=origin) # Can't test exact equality as cphasematch and cctbx return slightly different errors self.assertAlmostEqual(88.8476, before_origin, 0) self.assertAlmostEqual(62.4833, after_origin, 0) self.assertEqual([0.0, 0.5, 0.0], origin_shift) return