コード例 #1
0
ファイル: test_cphasematch.py プロジェクト: tiger-tiger/ample
    def test_merge_mtz2(self):
        os.chdir(
            self.thisd
        )  # Need as otherwise tests that happen in other directories change os.cwd()
        mtz1 = os.path.join(self.ample_share, "examples", 'toxd-example',
                            'input', '1dtx.mtz')
        mtz1_labels = ['FP', 'SIGFP']
        mtz2 = os.path.join(self.ample_share, "examples", 'toxd-example',
                            'input', '1dtx.mtz')
        mtz2_labels = ['FP', 'SIGFP']

        merged_mtz, mtz_labels = cphasematch.merge_mtz(mtz1, mtz1_labels, mtz2,
                                                       mtz2_labels)

        # Get all the labels
        miller_dict = iotbx.mtz.object(
            file_name=merged_mtz).as_miller_arrays_dict()
        merged_labels = set([d[2] for d in miller_dict.keys()])

        # An integer equal to the file number should have been added
        ref_labels = set(['FP', 'SIGFP', 'FP2', 'SIGFP2'])

        self.assertEqual(len(merged_labels - ref_labels), 0,
                         "Labels were not identical")
        os.unlink(merged_mtz)

        return
コード例 #2
0
    def test_merge_mtz(self):
        os.chdir(self.thisd) # Need as otherwise tests that happen in other directories change os.cwd()
        mtz1 =  os.path.join(self.ample_share, "examples", 'toxd-example', 'input', '1dtx.mtz')
        mtz1_labels = ['FP', 'SIGFP']
        mtz2 =  os.path.join(self.testfiles_dir, "phaser_loc0_ALL_c1_tl49_r1_allatom_UNMOD.1.mtz")
        mtz2_labels = ['FC', 'PHIC']
        merged_mtz, mtz_labels = cphasematch.merge_mtz(mtz1, mtz1_labels, mtz2, mtz2_labels)

        input_labels = set(mtz1_labels + mtz2_labels)
        # Get all the labels
        miller_dict = iotbx.mtz.object(file_name=merged_mtz).as_miller_arrays_dict()
        ref_labels = set([d[2] for d in miller_dict.keys()])

        self.assertEqual(len(input_labels - ref_labels), 0, "Labels were not identical")
        os.unlink(merged_mtz)

        return
コード例 #3
0
    def test_merge_mtz2(self):
        os.chdir(self.thisd) # Need as otherwise tests that happen in other directories change os.cwd()
        mtz1 =  os.path.join(self.ample_share, "examples", 'toxd-example', 'input', '1dtx.mtz')
        mtz1_labels = ['FP', 'SIGFP']
        mtz2 =  os.path.join(self.ample_share, "examples", 'toxd-example', 'input', '1dtx.mtz')
        mtz2_labels = ['FP', 'SIGFP']

        merged_mtz, mtz_labels = cphasematch.merge_mtz(mtz1, mtz1_labels, mtz2, mtz2_labels)

        # Get all the labels
        miller_dict = iotbx.mtz.object(file_name=merged_mtz).as_miller_arrays_dict()
        merged_labels = set([d[2] for d in miller_dict.keys()])

        # An integer equal to the file number should have been added
        ref_labels = set(['FP','SIGFP','FP2', 'SIGFP2'])

        self.assertEqual(len(merged_labels - ref_labels), 0, "Labels were not identical")
        os.unlink(merged_mtz)

        return
コード例 #4
0
ファイル: test_cphasematch.py プロジェクト: tiger-tiger/ample
    def test_merge_mtz(self):
        os.chdir(
            self.thisd
        )  # Need as otherwise tests that happen in other directories change os.cwd()
        mtz1 = os.path.join(self.ample_share, "examples", 'toxd-example',
                            'input', '1dtx.mtz')
        mtz1_labels = ['FP', 'SIGFP']
        mtz2 = os.path.join(self.testfiles_dir,
                            "phaser_loc0_ALL_c1_tl49_r1_allatom_UNMOD.1.mtz")
        mtz2_labels = ['FC', 'PHIC']
        merged_mtz, mtz_labels = cphasematch.merge_mtz(mtz1, mtz1_labels, mtz2,
                                                       mtz2_labels)

        input_labels = set(mtz1_labels + mtz2_labels)
        # Get all the labels
        miller_dict = iotbx.mtz.object(
            file_name=merged_mtz).as_miller_arrays_dict()
        ref_labels = set([d[2] for d in miller_dict.keys()])

        self.assertEqual(len(input_labels - ref_labels), 0,
                         "Labels were not identical")
        os.unlink(merged_mtz)

        return