Commit 6145bbaf authored by Carine Rey's avatar Carine Rey
Browse files

update tdg09 FDR -> LRT + plot

parent 89eb09e8
......@@ -99,7 +99,7 @@ let plot_merge_results ?t_choices ~plot_all_sites ~(res_by_tools:result list) ~t
| `Identical_WAG _ -> "Identical_WAG01"
| `Topological_LG _ -> "Topological_LG08"
| `Topological_WAG _ -> "Topological_WAG01"
| `Tdg09 _ -> "Tdg09_1MinusFDR,Tdg09_prob_post"
| `Tdg09 _ -> "Tdg09_1MinusFDR,Tdg09_1MinusLRT,Tdg09_prob_post"
| `Multinomial _ -> "Mutinomial_1MinusLRT"
| `Msd _ -> "Msd_0.05_1MinusP"
in
......@@ -116,7 +116,7 @@ let plot_merge_results ?t_choices ~plot_all_sites ~(res_by_tools:result list) ~t
| `Identical_WAG _ -> "Identical_WAG01:0.9"
| `Topological_LG _ -> "Topological_LG08:0.9"
| `Topological_WAG _ -> "Topological_WAG01:0.9"
| `Tdg09 _ -> "Tdg09_1MinusFDR:0.99,Tdg09_prob_post:0.99"
| `Tdg09 _ -> "Tdg09_1MinusFDR:0.99,Tdg09_prob_post:0.99,Tdg09_1MinusLRT:0.99"
| `Multinomial _ -> "Mutinomial_1MinusLRT:0.95"
| `Msd _ -> "Msd_0.05_1MinusP:0.95"
......
......@@ -16,6 +16,7 @@ type t_choices = {
t_choices_recall09: text_file workflow ;
t_choices_plot: text_file workflow ;
t_choices_condensed_plot: text_file workflow ;
t_choices_condensed_plot_png: text_file workflow ;
rp_plot: text_file workflow ;
tree_prefix: string;
}
......@@ -288,9 +289,10 @@ let get_t_choices ~tree_prefix ~(dataset_results_l: dataset_res list) : t_choice
let t_choices_complete = t_choices_dir / selector ["out.complete.tsv"] in
let t_choices_plot = t_choices_dir / selector ["out.pdf"] in
let t_choices_condensed_plot = t_choices_dir / selector ["out_condensed.pdf"] in
let t_choices_condensed_plot_png = t_choices_dir / selector ["out_condensed.png"] in
let rp_plot = t_choices_dir / selector ["out_condensed.recall_precision_ok.pdf"] in
let tree_prefix = ha_PCOC.tree_prefix in
Some {t_choices_max; t_choices_recall09; t_choices_complete ; t_choices_plot; t_choices_condensed_plot; rp_plot; tree_prefix}
Some {t_choices_max; t_choices_recall09; t_choices_complete ; t_choices_plot; t_choices_condensed_plot;t_choices_condensed_plot_png;rp_plot; tree_prefix}
| _ -> None
......@@ -441,6 +443,7 @@ let repo_of_post_analyses_res ~prefix ~post_analyses_res =
Repo.[
item [prefix ^ ".t_choices.pdf"] w.t_choices_plot ;
item [prefix ^ ".t_choices.condensed.pdf"] w.t_choices_condensed_plot ;
item [prefix ^ ".t_choices.condensed.png"] w.t_choices_condensed_plot_png ;
item [prefix ^ ".recall_precision_ok.pdf"] w.rp_plot ;
]
] |> List.concat
......
......@@ -587,6 +587,7 @@ plot_out = function(df_out, df_d , df_recall_sup09_per_meth, meths = NULL, suffi
limitsize = FALSE
)
plot_value_JSD = NULL
if ( all( c("P_JSD","P_ED", "C1", "C2", "entropy_C1","entropy_C2") %in% colnames(df_d))){
print("plot value/distance")
......@@ -673,23 +674,42 @@ plot_out = function(df_out, df_d , df_recall_sup09_per_meth, meths = NULL, suffi
}
plot = plot_grid(plot_recall_precision,plot_max_MCC,plot_value_JSD,plot_value_ED,plot_entropy_C2_C1,plot_entropy_C1,plot_entropy_C2,
labels = c("A", "B","C","D","E","F"),
rel_heights = c(length(unique(df_out$couple))*0.8,3,length(unique(df_out$couple))*0.8,length(unique(df_out$couple))*0.8,length(unique(df_out$couple))*0.8,length(unique(df_out$couple))*0.8,length(unique(df_out$couple))*0.8),
nrow=7
)
#plot = plot_grid(plot_recall_precision,plot_recall_precision_papier,plot_max_MCC,plot_FPR,plot_FPR2,
# labels = c("A", "A'", "B","B'","B''"),
# rel_heights = c(length(unique(df_out$couple))*0.8,2,4,2,2),
# nrow=5
#plot = plot_grid(plot_recall_precision,plot_max_MCC,plot_value_JSD,plot_value_ED,plot_entropy_C2_C1,plot_entropy_C1,plot_entropy_C2,
# labels = c("A", "B","C","D","E","F"),
# rel_heights = c(length(unique(df_out$couple))*0.8,length(unique(df_out$couple))*0.8,length(unique(df_out$couple))*0.8,length(unique(df_out$couple))*0.8,length(unique(df_out$couple))*0.8,length(unique(df_out$couple))*0.8,length(unique(df_out$couple))*0.8),
# nrow=7
# )
plot = plot_grid(plot_recall_precision,plot_recall_precision_papier,plot_max_MCC,plot_FPR,plot_FPR2,
labels = c("A", "A'", "B","B'","B''"),
rel_heights = c(length(unique(df_out$couple))*0.8,2,4,2,2),
nrow=5)
if (is.null(plot_value_JSD)) {
plot_png = plot_grid(plot_recall_precision,plot_max_MCC,
labels = c("A", "B"),
rel_heights = c(1,1),
nrow=2
)
} else {
plot_png = plot_grid(plot_recall_precision,plot_max_MCC,plot_value_JSD,
labels = c("A", "B","C"),
rel_heights = c(0.5,0.5,1),
nrow=3
)
}
save_plot(paste0(opt$out,suffix,".pdf"),
plot,
ncol = 0.4* length(unique(df_out_melt$methode)),
nrow = length(unique(df_out$couple)) * 0.5 + 1 + 1 +1 +1,
nrow = length(unique(df_out$couple)) * 0.5 + 2 + 1 +1 +1,
base_aspect_ratio = 1,
limitsize = FALSE
)
save_plot(paste0(opt$out,suffix,".png"),
plot_png,
ncol = 0.4* length(unique(df_out_melt$methode)),
nrow = length(unique(df_out$couple)) * 1.5,
base_aspect_ratio = 1,
limitsize = FALSE
)
......@@ -698,7 +718,7 @@ plot_out = function(df_out, df_d , df_recall_sup09_per_meth, meths = NULL, suffi
plot_out(df_out, df_d, df_recall_sup09_per_meth, suffix="")
condensed_meths = c("PCOC","Diffsel_mean","Identical_LG08","Mutinomial_1MinusLRT","Tdg09_1MinusFDR","Msd_1MinusP","Msd_0.01_1MinusP","Msd_0.05_1MinusP","Msd_0.10_1MinusP","Msd_0.50_1MinusP","Msd_1.00_1MinusP","Topological_LG08")
condensed_meths = c("PCOC","Diffsel_mean","Identical_LG08","Mutinomial_1MinusLRT","Tdg09_1MinusLRT","Msd_1MinusP","Msd_0.05_1MinusP","Topological_LG08")
plot_out(df_out, df_d, df_recall_sup09_per_meth, meths=condensed_meths, suffix="_condensed")
......
......@@ -43,6 +43,7 @@ Tdg09File.close()
n_sites=int(searchlines[9].split()[1])
fdr=["NA"] * (n_sites)
lrt=["NA"] * (n_sites)
prob_post=["NA"] * (n_sites)
for i,line in enumerate(searchlines):
......@@ -69,14 +70,18 @@ for i,line in enumerate(searchlines):
lnLconv = lnLconv.strip()
lnLnoconv = lnLnoconv.strip()
FDR = FDR.strip()
LRT = LRT.strip()
if Site and FDR != "NA":
FDR = float(FDR)
LRT = float(LRT)
if FDR > 1:
FDR = 1
fdr[int(Site)-1]=1-FDR
lrt[int(Site)-1]=1-LRT
if Site and FDR == "NA":
FDR = 1
fdr[int(Site)-1]=1-FDR
lrt[int(Site)-1]=0
if Site and lnLconv != "NA" and lnLnoconv != "NA":
lnLconv = float(lnLconv)
......@@ -90,11 +95,12 @@ for i,line in enumerate(searchlines):
Sites = [i +1 for i in range(n_sites)]
df_final = pd.DataFrame({'Sites': Sites,
'Tdg09_1MinusLRT' : lrt,
'Tdg09_1MinusFDR' : fdr,
'Tdg09_prob_post' : prob_post})
df_final = df_final[["Sites","Tdg09_1MinusFDR","Tdg09_prob_post"]]
df_final = df_final[["Sites","Tdg09_1MinusFDR","Tdg09_1MinusLRT","Tdg09_prob_post"]]
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment