Esempio n. 1
0
def main():


    args = parse_args()

    data_dir = args.data_dir
    plot_dir = data_dir+"/plots/benchmarks/"

    if not os.path.exists(plot_dir):
        os.makedirs(plot_dir)


    # create benchmark object
    b = Benchmark(data_dir+"/pdb/")


    #specify methods to benchmark
    b.add_method("pseudo-likelihood APC", data_dir +"/predictions_pll/", "apc.mat")
    b.add_method("pseudo-likelihood raw", data_dir +"/predictions_pll/", "raw.mat")
    b.add_method("persistent contrastive divergence APC", data_dir +"/predictions_pcd/", "apc.mat")
    b.add_method("persistent contrastive divergence raw", data_dir +"/predictions_pcd/", "raw.mat")

    #add constraint that all MRF optimizations have exist status 0
    b.add_constraint("opt_code", 0, "greater_equal")

    #compute the precision of predictions
    b.compute_evaluation_statistics(seqsep=6, contact_thr=8, noncontact_thr=8)

    #generate a benchmark plot
    plot = b.plot_precision_vs_rank()

    #format that benchmark plot to resemble the one in Fig 1C
    plot_pll_vs_pcd_benchmark_figure(plot, plot_dir, height=500, width=1000)
Esempio n. 2
0
def main():

    args = parse_args()

    data_dir = args.data_dir
    plot_dir = data_dir + "/plots/benchmarks/"
    pdb_dir = data_dir + "/pdb/"

    sequence_separation = 6
    contact_thr = 8
    non_contact_thr = 8

    if not os.path.exists(plot_dir):
        os.makedirs(plot_dir)

    ### create benchmark plot for star-tree topologies

    # create benchmark object
    b = Benchmark(pdb_dir)

    #specify methods to benchmark
    b.add_method("APC", data_dir + "/recover_pcd_constrained/", "apc.star.mat")
    b.add_method("EC", data_dir + "/recover_pcd_constrained/", "ec.star.mat")
    b.add_method("no APC", data_dir + "/recover_pcd_constrained/",
                 "raw.star.mat")

    #add constraint that all MRF optimizations have exist status 0
    b.add_constraint("opt_code", 0, "greater_equal")

    #compute the precision of predictions
    b.compute_evaluation_statistics(seqsep=sequence_separation,
                                    contact_thr=contact_thr,
                                    noncontact_thr=non_contact_thr)

    #generate a benchmark plot
    benchmark_plot_star = b.plot_precision_vs_rank()
    plot_file = plot_dir + "/" + "fig_6b.html"
    plot_ccmgen_benchmark_figure(benchmark_plot_star,
                                 'star topology',
                                 plot_file,
                                 height=350,
                                 width=500)

    ### create benchmark plot for binary-tree topologies

    # create benchmark object
    b = Benchmark(pdb_dir)

    # specify methods to benchmark
    b.add_method("APC", data_dir + "/recover_pcd_constrained/",
                 "apc.binary.mat")
    b.add_method("EC", data_dir + "/recover_pcd_constrained/", "ec.binary.mat")
    b.add_method("no APC", data_dir + "/recover_pcd_constrained/",
                 "raw.binary.mat")

    # add constraint that all MRF optimizations have exist status 0
    b.add_constraint("opt_code", 0, "greater_equal")

    # compute the precision of predictions
    b.compute_evaluation_statistics(seqsep=sequence_separation,
                                    contact_thr=contact_thr,
                                    noncontact_thr=non_contact_thr)

    # generate a benchmark plot
    benchmark_plot_binary = b.plot_precision_vs_rank()
    plot_file = plot_dir + "/" + "fig_6a.html"
    plot_ccmgen_benchmark_figure(benchmark_plot_binary,
                                 'binary topology',
                                 plot_file,
                                 height=350,
                                 width=500)

    ### create qunatification of noise plot
    plot_file = plot_dir + "/" + "fig_6c.html"
    plot_ccmgen_noise_quant_figure(benchmark_plot_star,
                                   benchmark_plot_binary,
                                   plot_file,
                                   height=350,
                                   width=500)