Commit cf727127 authored by Philippe Veber's avatar Philippe Veber
Browse files

added oracle method

parent 4aef7ffb
......@@ -173,3 +173,18 @@ let plot_convergent_sites ?(plot_all_sites = true) ~alignment ~detection_results
)
]
|> Fn.flip Workflow.select ["plot.svg"]
let recall_precision_curve table =
Workflow.shell ~descr:"recall_precision_curve" [
cmd "Rscript" [
file_dump (string Scripts.recall_precision_curve) ;
dep table ;
dest ;
] ;
]
let%pworkflow oracle ~n_h0 ~n_ha =
"Sites\tOracle"
:: (List.init n_h0 ~f:(fun i -> sprintf "%d\t0" (i + 1)))
@ (List.init n_ha ~f:(fun i -> sprintf "%d\t1" (n_h0 + i + 1)))
|> Out_channel.write_lines [%dest]
......@@ -57,3 +57,12 @@ val plot_convergent_sites :
tree:nhx pworkflow ->
unit ->
svg pworkflow
val recall_precision_curve :
text_file pworkflow ->
svg pworkflow
val oracle :
n_h0:int ->
n_ha:int ->
text_file pworkflow
......@@ -116,3 +116,21 @@ let alignment_plot d =
~alignment:(amino_acid_alignment d)
~detection_results:(multinomial d)
()
let oracle d =
let n_h0, n_ha =
match d with
| Bppseqgen_simulation { nb_sites ; hypothesis ; _ } -> (
match hypothesis with
| H0 _ -> nb_sites, 0
| HaPC _ | HaPCOC _ -> 0, nb_sites
)
| Convdet_simulation { n_h0 ; n_ha ; _ } -> n_h0, n_ha
in
Convergence_detection.oracle ~n_h0 ~n_ha
let benchmark d =
Convergence_detection.merge_result_tables
~multinomial:(multinomial d)
~oracle:(oracle d)
()
......@@ -76,6 +76,8 @@ availableOptions.add_argument('--msd', type=str, action="append", nargs=2,
help="msd output name", default = None)
availableOptions.add_argument('--fna_infos', type=str,
help="fna_infos output name", default = None)
availableOptions.add_argument('--oracle', type=str,
help="ORACLE", default = None)
##############
......@@ -96,6 +98,7 @@ df_tdg09 = pd.DataFrame()
df_multinomial = pd.DataFrame()
df_msd = pd.DataFrame()
df_fna_infos = pd.DataFrame()
df_oracle = pd.DataFrame ()
OutName = args.output
if args.pcoc :
......@@ -124,6 +127,10 @@ if args.diffsel_bis :
if args.diffsel :
df_diffsel = pd.read_csv(args.diffsel, sep="\t")
if args.oracle:
df_oracle = pd.read_csv(args.oracle, sep="\t")
df_oracle.rename(columns={'Oracle' : 'Oracle'}, inplace=True)
if args.identical_LG :
df_identical_LG = pd.read_csv(args.identical_LG, sep="\t")
df_identical_LG.rename(columns={'Identical': 'Identical_LG08'}, inplace=True)
......@@ -165,13 +172,14 @@ if args.fna_infos :
#df_fna_infos = df_fna_infos[['Sites','P_distance']]
df_list = [df for df in [df_pcoc, df_pcoc_gamma, df_pcoc_C60,
df_diffsel, df_diffsel_bis,
df_identical_LG, df_identical_WAG,
df_topological_LG, df_topological_WAG,
df_tdg09,
df_multinomial,
df_msd,
df_fna_infos
df_diffsel, df_diffsel_bis,
df_identical_LG, df_identical_WAG,
df_topological_LG, df_topological_WAG,
df_tdg09,
df_multinomial,
df_msd,
df_fna_infos,
df_oracle
] if not df.empty ]
df_list_len = [df.shape[0] for df in df_list]
......
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