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

separate diffsel module

parent 17572c94
......@@ -24,76 +24,13 @@ type dataset_res = {
plot_merged_results : svg workflow ;
}
let diffsel ~(phy_n:nucleotide_phylip workflow) ~(tree: _ workflow) ~(w_every:int) ~(n_cycles: int) : [`diffsel] directory workflow =
let env = docker_image ~account:"vlanore" ~name:"diffsel" ~tag:"v1.0" () in
let tmp_tree = tmp // "myrun.tree" in
let tmp_ali = tmp // "myrun.ali" in
let dest_tree = dest // "myrun.tree" in
let dest_ali = dest // "myrun.ali" in
let chainname = dest // "myrun" in
(*_build/diffsel -t data/samhd1.tree -d data/samhd1.ali -ncond 3 -x 1 10000 myrun*)
workflow ~descr:"convergence_detection.run_diffsel" [
docker env (
and_list [
mkdir_p dest;
cmd "cp" [dep phy_n; dest_ali]; (* required dep to link the file in the env *)
cmd "cp" [dep tree; dest_tree]; (* required dep to link the file in the env *)
cmd "cp" [dep phy_n; tmp_ali]; (* required dep to link the file in the env *)
cmd "cp" [dep tree; tmp_tree]; (* required dep to link the file in the env *)
cmd "/diffsel/_build/diffsel" [
opt "-t" ident tmp_tree;
opt "-d" ident tmp_ali ;
opt "-ncond" int 2 ;
opt "-x" seq [ int w_every; string " "; int n_cycles];
ident chainname ;
];
]
)
]
let diffsel_selector run_diffsel : text_file workflow =
let env = docker_image ~account:"vlanore" ~name:"diffsel" ~tag:"v1.0" () in
let package = tmp // "diffsel_script_utils.py" in
let script = tmp // "diffsel_analyze_result.py" in
let tmp_tree = tmp // "myrun.tree" in
let tmp_ali = tmp // "myrun.ali" in
let dep_tree = (dep run_diffsel) // "myrun.tree" in
let dep_ali = (dep run_diffsel) // "myrun.ali" in
let chainname = (dep run_diffsel) // "myrun" in
let out = dest in
workflow ~descr:"convergence_detection.parse_diffsel" [
docker env (
and_list [
mkdir_p tmp ;
cd tmp ;
cmd "ls" [dep run_diffsel];
cmd "cp" [dep_ali; tmp_ali]; (* required dep to link the file in the env *)
cmd "cp" [dep_tree; tmp_tree]; (* required dep to link the file in the env *)
(*python diffsel_analyze_result.py [-r /path/to/readdiffsel] [-o output_file] chainname *)
cmd "cp" [ file_dump (string Scripts.diffsel_script_utils) ; package] ;
cmd "cp" [ file_dump (string Scripts.diffsel_analyze_result) ; script] ;
cmd "python" [
string "diffsel_analyze_result.py" ;
opt "-r" string "/diffsel/_build/readdiffsel" ;
opt "-o" ident out ;
ident chainname ;
]
]
)
]
let merge_results ~res_by_tools : text_file workflow =
let env = docker_image ~account:"carinerey" ~name:"ete3" ~tag:"3.0.0b35" () in
let command = List.map res_by_tools ~f:(fun res ->
let w = match res with
| `Pcoc d
| `Pcoc_gamma d -> Pcoc.results d
| `Diffsel d -> diffsel_selector d
| `Diffsel d -> Diffsel.selector d
in
let opt = match res with
| `Pcoc _ -> string "--pcoc"
......
......@@ -22,17 +22,6 @@ type dataset_res = {
plot_merged_results : svg workflow
}
val diffsel :
phy_n : nucleotide_phylip workflow ->
tree : _ workflow ->
w_every : int ->
n_cycles: int ->
[`diffsel] directory workflow
val diffsel_selector :
[`diffsel] directory workflow ->
text_file workflow
val merge_results :
res_by_tools : result list ->
text_file workflow
......
open Core_kernel
open Bistro.Std
open Bistro.EDSL
open File_formats
let diffsel ~(phy_n:nucleotide_phylip workflow) ~(tree: _ workflow) ~(w_every:int) ~(n_cycles: int) : [`diffsel] directory workflow =
let env = docker_image ~account:"vlanore" ~name:"diffsel" ~tag:"v1.0" () in
let tmp_tree = tmp // "myrun.tree" in
let tmp_ali = tmp // "myrun.ali" in
let dest_tree = dest // "myrun.tree" in
let dest_ali = dest // "myrun.ali" in
let chainname = dest // "myrun" in
(*_build/diffsel -t data/samhd1.tree -d data/samhd1.ali -ncond 3 -x 1 10000 myrun*)
workflow ~descr:"convergence_detection.run_diffsel" [
docker env (
and_list [
mkdir_p dest;
cmd "cp" [dep phy_n; dest_ali]; (* required dep to link the file in the env *)
cmd "cp" [dep tree; dest_tree]; (* required dep to link the file in the env *)
cmd "cp" [dep phy_n; tmp_ali]; (* required dep to link the file in the env *)
cmd "cp" [dep tree; tmp_tree]; (* required dep to link the file in the env *)
cmd "/diffsel/_build/diffsel" [
opt "-t" ident tmp_tree;
opt "-d" ident tmp_ali ;
opt "-ncond" int 2 ;
opt "-x" seq [ int w_every; string " "; int n_cycles];
ident chainname ;
];
]
)
]
let selector run_diffsel : text_file workflow =
let env = docker_image ~account:"vlanore" ~name:"diffsel" ~tag:"v1.0" () in
let package = tmp // "diffsel_script_utils.py" in
let script = tmp // "diffsel_analyze_result.py" in
let tmp_tree = tmp // "myrun.tree" in
let tmp_ali = tmp // "myrun.ali" in
let dep_tree = (dep run_diffsel) // "myrun.tree" in
let dep_ali = (dep run_diffsel) // "myrun.ali" in
let chainname = (dep run_diffsel) // "myrun" in
let out = dest in
workflow ~descr:"convergence_detection.parse_diffsel" [
docker env (
and_list [
mkdir_p tmp ;
cd tmp ;
(* cmd "ls" [dep run_diffsel]; (\* FIXME: PV ça sert à quoi ? *\) *)
cmd "cp" [dep_ali; tmp_ali]; (* required dep to link the file in the env *)
cmd "cp" [dep_tree; tmp_tree]; (* required dep to link the file in the env *)
(*python diffsel_analyze_result.py [-r /path/to/readdiffsel] [-o output_file] chainname *)
cmd "cp" [ file_dump (string Scripts.diffsel_script_utils) ; package] ;
cmd "cp" [ file_dump (string Scripts.diffsel_analyze_result) ; script] ;
cmd "python" [
string "diffsel_analyze_result.py" ;
opt "-r" string "/diffsel/_build/readdiffsel" ;
opt "-o" ident out ;
ident chainname ;
]
]
)
]
open Bistro.Std
open File_formats
val diffsel :
phy_n : nucleotide_phylip workflow ->
tree : _ workflow ->
w_every : int ->
n_cycles: int ->
[`diffsel] directory workflow
val selector :
[`diffsel] directory workflow ->
text_file workflow
......@@ -47,7 +47,7 @@ let repo_of_detection_result res =
match res with
| `Pcoc w -> item ["pcoc.results.tsv"] (Pcoc.results w)
| `Pcoc_gamma w -> item ["pcoc_gamma.results.tsv"] (Pcoc.results w)
| `Diffsel w -> item ["diffsel.results.tsv"] (diffsel_selector w)
| `Diffsel w -> item ["diffsel.results.tsv"] (Diffsel.selector w)
) ;
(
match res with
......@@ -88,7 +88,7 @@ let derive_from_det_meth ~det_meth ~(dataset : Dataset.t) ~preview =
match det_meth with
| `Pcoc -> `Pcoc (Pcoc.pcoc ~plot_complete:true ~gamma:false ~faa ~tree:pcoc_tree)
| `Pcoc_gamma -> `Pcoc_gamma (Pcoc.pcoc ~plot_complete: true ~gamma:true ~faa ~tree:pcoc_tree)
| `Diffsel -> `Diffsel (Convergence_detection.diffsel ~phy_n ~tree:diffsel_tree ~w_every ~n_cycles)
| `Diffsel -> `Diffsel (Diffsel.diffsel ~phy_n ~tree:diffsel_tree ~w_every ~n_cycles)
......
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