Commit 0e606449 authored by Carine Rey's avatar Carine Rey
Browse files

add detection method: Multinomila (not yet working but the pipeline compiles)

parent 4f014a6f
......@@ -16,6 +16,7 @@ type result = [
| `Topological_LG of [`topological] directory workflow
| `Topological_WAG of [`topological] directory workflow
| `Tdg09 of [`tdg09] directory workflow
| `Multinomial of [`multinomial] directory workflow
]
let meth_string_of_result = function
......@@ -29,6 +30,7 @@ let meth_string_of_result = function
| `Topological_LG _ -> "topological_LG"
| `Topological_WAG _ -> "topological_WAG"
| `Tdg09 _ -> "tdg09"
| `Multinomial _ -> "multinomial"
type dataset_res = {
model_prefix : string ;
......@@ -53,6 +55,7 @@ let merge_results ~res_by_tools : text_file workflow =
| `Topological_LG d -> Topological.results d
| `Topological_WAG d -> Topological.results d
| `Tdg09 d -> Tamuri.results d
| `Multinomial d -> Multinomial.results d
in
let opt = match res with
| `Pcoc _ -> string "--pcoc"
......@@ -65,6 +68,7 @@ let merge_results ~res_by_tools : text_file workflow =
| `Topological_LG _ -> string "--topological_LG"
| `Topological_WAG _ -> string "--topological_WAG"
| `Tdg09 _ -> string "--tdg09"
| `Multinomial _ -> string "--multinomial"
in
seq ~sep:" " [opt; dep w]
)
......@@ -93,6 +97,7 @@ let plot_merge_results ~plot_all_sites ~(res_by_tools:result list) ~tree ~faa ~t
| `Topological_LG _ -> "Topological_LG08"
| `Topological_WAG _ -> "Topological_WAG01"
| `Tdg09 _ -> "Tdg09_1-FDR,Tdg09_prob_post"
| `Multinomial _ -> ""
in
string opt
) |> seq ~sep:","
......@@ -109,6 +114,7 @@ let plot_merge_results ~plot_all_sites ~(res_by_tools:result list) ~tree ~faa ~t
| `Topological_LG _ -> "Topological_LG08:0.9"
| `Topological_WAG _ -> "Topological_WAG01:0.9"
| `Tdg09 _ -> "Tdg09_1-FDR:0.9,Tdg09_prob_post:0.9"
| `Multinomial _ -> ""
in
string opt
) |> seq ~sep:","
......
......@@ -16,6 +16,7 @@ type result = [
| `Topological_LG of [`topological] directory workflow
| `Topological_WAG of [`topological] directory workflow
| `Tdg09 of [`tdg09] directory workflow
| `Multinomial of [`multinomial] directory workflow
]
val meth_string_of_result : result -> string
......
open Core
open Bistro.Std
open Bistro.EDSL
open Bistro_bioinfo.Std
open File_formats
let multinomial ~(tree_id:_ workflow) ~(tree_sc:_ workflow) ~(faa:aminoacid_fasta workflow) : [`multinomial] directory workflow =
let env = docker_image ~account:"carinerey" ~name:"python_basics" ~tag:"07172018" () in
workflow ~descr:("calc_multinomial") [
mkdir_p dest;
cmd "python" ~env [
file_dump (string Scripts.calc_multinomial) ;
opt "-t" dep tree_sc;
opt "-a" dep faa;
opt "-o" ident (dest // "out.tsv") ;
]
]
let results w =
w / selector ["out.tsv"]
......@@ -125,6 +125,7 @@ let repo_of_detection_result res =
| `Topological_LG w -> item ["Topological_LG.results.tsv"] (Topological.results w)
| `Topological_WAG w -> item ["Topological_WAG.results.tsv"] (Topological.results w)
| `Tdg09 w -> item ["Tdg09.results.tsv"] (Tamuri.results w)
| `Multinomial w -> item ["Multinomial.results.tsv"] (Multinomial.results w)
) ;
(
match res with
......@@ -138,6 +139,7 @@ let repo_of_detection_result res =
| `Topological_LG w -> item ["raw_results"] w
| `Topological_WAG w -> item ["raw_results"] w
| `Tdg09 w -> item ["raw_results"] w
| `Multinomial w -> item ["raw_results"] w
) ;
]
|> Repo.shift det_meth_prefix
......@@ -184,6 +186,7 @@ let derive_from_det_meth ~det_meth ~(dataset : Dataset.t) ~preview =
| `Identical_WAG -> `Identical_WAG (Identical.identical ~faa ~tree_id ~tree_sc ~prot_model:"WAG01")
| `Topological_LG -> `Topological_LG (Topological.topological ~faa ~tree:tree_id ~tree_conv ~prot_model:"LG08")
| `Topological_WAG -> `Topological_WAG (Topological.topological ~faa ~tree:tree_id ~tree_conv ~prot_model:"WAG01")
| `Multinomial -> `Multinomial (Multinomial.multinomial ~faa ~tree_id ~tree_sc)
let derive_from_dataset ~dataset ~preview ~fast_mode=
......@@ -191,7 +194,8 @@ let derive_from_dataset ~dataset ~preview ~fast_mode=
[`Pcoc;
`Tdg09;
`Identical_LG;
`Topological_LG;] ;
`Topological_LG;
`Multinomial] ;
if preview then
[]
else
......
......@@ -70,6 +70,8 @@ availableOptions.add_argument('--topological_WAG', type=str,
help="topological_WAG output name", default = None)
availableOptions.add_argument('--tdg09', type=str,
help="tdg09 output name", default = None)
availableOptions.add_argument('--multinomial', type=str,
help="multinomial output name", default = None)
##############
......@@ -87,6 +89,7 @@ df_identical_WAG = pd.DataFrame()
df_topological_LG = pd.DataFrame()
df_topological_WAG = pd.DataFrame()
df_tdg09 = pd.DataFrame()
df_multinomial = pd.DataFrame()
OutName = args.output
if args.pcoc :
......@@ -134,12 +137,15 @@ if args.topological_WAG :
if args.tdg09 :
df_tdg09 = pd.read_csv(args.tdg09, sep="\t")
if args.multinomial :
df_multinomial = pd.read_csv(args.multinomial, sep="\t")
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_tdg09,
df_multinomial
] if not df.empty ]
df_list_len = [df.shape[0] for df in df_list]
......
......@@ -86,7 +86,7 @@ if methods_to_be_plotted:
threshold_by_method = args.threshold_by_method
dic_threshold_by_method = {}
if threshold_by_method:
dic_threshold_by_method = {mt.split(":")[0]:float(mt.split(":")[1]) for mt in threshold_by_method.split(",") }
dic_threshold_by_method = {mt.split(":")[0]:float(mt.split(":")[1]) for mt in threshold_by_method.split(",") if mt}
MESSAGE("Threshold by method: "+", ".join([(param(key)+": "+param(value)) for key,value in dic_threshold_by_method.items()]))
......
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