Beispiel #1
0
def generateMap(nativePdb, nativeMtz):
    logging.debug("Parsing MTZ file %s to determine column labels", nativeMtz)
    F, SIGF, FREE = mtz_util.get_labels(nativeMtz)
    logging.debug("Generating map from: %s %s", nativeMtz, nativePdb)
    return phenixer.generateMap(nativeMtz,
                                nativePdb,
                                FP=F,
                                SIGFP=SIGF,
                                FREE=FREE)
Beispiel #2
0
    def test_process_mtz_labels2(self):
        # Get MTZ flags

        os.chdir(self.thisd) # Need as otherwise tests that happen in other directories change os.cwd()
        mtz = os.path.join( self.testfiles_dir, "1dtx.mtz" )

        FP,SIGFP,FREE=mtz_util.get_labels(mtz)
        self.assertEqual(FP,'FP')
        self.assertEqual(SIGFP,'SIGFP')
        self.assertEqual(FREE,'FreeR_flag')
Beispiel #3
0
    def test_process_mtz_labels(self):
        # Get MTZ flags

        os.chdir(
            self.thisd
        )  # Need as otherwise tests that happen in other directories change os.cwd()
        mtz = os.path.join(self.testfiles_dir, "2uui_sigmaa.mtz")

        FP, SIGFP, FREE = mtz_util.get_labels(mtz)
        self.assertEqual(FP, 'F')
        self.assertEqual(SIGFP, 'SIGF')
        self.assertEqual(FREE, None)
Beispiel #4
0
                        required=True)
    parser.add_argument('-native_pdb',
                        help="Input native PDB file",
                        required=False)
    parser.add_argument('-f_label',
                        help="F label from native MTZ file",
                        required=False)
    parser.add_argument('-sigf_label',
                        help="SIGF label from native MTZ file",
                        required=False)

    args = parser.parse_args()

    # Extract F & SIGF from file if not give on command-line
    if args.f_label and args.sigf_label:
        f_label, sigf_label = args.f_label, args.sigf_label
    else:
        f_label, sigf_label, _ = mtz_util.get_labels(args.native_mtz)
    _logger.info("Using F, SIGF labels from mtz file: {0}, {1} ".format(
        f_label, sigf_label))

    if args.native_pdb:
        before_origin, after_origin, change_of_hand, origin_shift = calc_phase_error_pdb(
            args.native_pdb, args.native_mtz, args.mr_mtz, f_label, sigf_label)
    else:
        before_origin, after_origin, change_of_hand, origin_shift = calc_phase_error_mtz(
            args.native_mtz, args.mr_mtz, f_label, sigf_label)

    print "Calculated phase error: {0}".format(after_origin)
    print "Calculated origin shift: {0}".format(origin_shift)
Beispiel #5
0
    import argparse
    parser = argparse.ArgumentParser(description='Run cphasematch on two mtz files', prefix_chars="-")

    parser.add_argument('-native_mtz', help="Input native MTZ file", required=True)
    parser.add_argument('-mr_mtz', help="Input MTZ file from Molecular Replacement", required=True)
    parser.add_argument('-native_pdb', help="Input native PDB file", required=False)
    parser.add_argument('-f_label', help="F label from native MTZ file", required=False)
    parser.add_argument('-sigf_label', help="SIGF label from native MTZ file", required=False)

    args = parser.parse_args()

    # Extract F & SIGF from file if not give on command-line
    if args.f_label and args.sigf_label:
        f_label, sigf_label = args.f_label, args.sigf_label
    else:
        f_label, sigf_label, _ = mtz_util.get_labels(args.native_mtz)
    logger.info("Using F, SIGF labels from mtz file: {0}, {1} ".format(f_label, sigf_label))

    if args.native_pdb:
        before_origin, after_origin, change_of_hand, origin_shift = calc_phase_error_pdb(
            args.native_pdb, args.native_mtz, args.mr_mtz, f_label, sigf_label
        )
    else:
        before_origin, after_origin, change_of_hand, origin_shift = calc_phase_error_mtz(
            args.native_mtz, args.mr_mtz, f_label, sigf_label
        )

    print("Calculated phase error:", after_origin)
    print("Calculated origin shift:", origin_shift)