Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Open sidebar
VEBER Philippe
codepi
Commits
5b243643
Commit
5b243643
authored
Jul 17, 2018
by
Carine Rey
Browse files
add a post analyse : simu_infos
parent
bfeb4be8
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
62 additions
and
11 deletions
+62
-11
lib/convergence_detection.ml
lib/convergence_detection.ml
+1
-0
lib/convergence_detection.mli
lib/convergence_detection.mli
+1
-1
lib/dataset.ml
lib/dataset.ml
+2
-2
lib/pipeline.ml
lib/pipeline.ml
+1
-1
lib/post_analyses.ml
lib/post_analyses.ml
+57
-7
No files found.
lib/convergence_detection.ml
View file @
5b243643
...
...
@@ -33,6 +33,7 @@ let meth_string_of_result = function
type
dataset_res
=
{
model_prefix
:
string
;
tree_prefix
:
string
;
dataset
:
Dataset
.
t
;
res_by_tools
:
result
list
;
merged_results
:
text_file
workflow
;
plot_merged_results
:
svg
workflow
;
...
...
lib/convergence_detection.mli
View file @
5b243643
...
...
@@ -5,7 +5,6 @@ open Bistro_bioinfo.Std
open
File_formats
open
Defs
type
result
=
[
|
`Pcoc
of
[
`pcoc
]
directory
workflow
|
`Pcoc_gamma
of
[
`pcoc
]
directory
workflow
...
...
@@ -24,6 +23,7 @@ val meth_string_of_result : result -> string
type
dataset_res
=
{
model_prefix
:
string
;
tree_prefix
:
string
;
dataset
:
Dataset
.
t
;
res_by_tools
:
result
list
;
merged_results
:
text_file
workflow
;
plot_merged_results
:
svg
workflow
...
...
lib/dataset.ml
View file @
5b243643
...
...
@@ -15,8 +15,8 @@ let repo ~preview dataset_l =
let
repo_ready_data
=
Ready_dataset
.
repo
dataset
.
dataset
in
let
repo_raw_data
=
if
preview
then
Raw_dataset
.
repo
~
prefix
:
model_prefix
(
Ready_dataset
.
to_raw
dataset
.
dataset
)
else
[]
in
List
.
concat
[
Repo
.
shift
"data"
(
Repo
.
shift
(
tree_prefix
^
"_"
^
model_prefix
)
repo_raw_data
);
Repo
.
shift
"debug
_data
"
(
Repo
.
shift
tree_prefix
(
Repo
.
shift
model_prefix
repo_ready_data
));
Repo
.
shift
"
simulated_
data"
(
Repo
.
shift
(
tree_prefix
^
"_"
^
model_prefix
)
repo_raw_data
);
Repo
.
shift
"
simulated_data_
debug"
(
Repo
.
shift
tree_prefix
(
Repo
.
shift
model_prefix
repo_ready_data
));
]
)
|>
List
.
concat
lib/pipeline.ml
View file @
5b243643
...
...
@@ -217,7 +217,7 @@ let derive_from_dataset ~dataset ~preview ~no_diffsel=
let
plot_merged_results
=
plot_merge_results
~
plot_all_sites
~
res_by_tools
~
tsv
~
faa
~
tree
in
let
model_prefix
=
dataset
.
model_prefix
in
let
tree_prefix
=
dataset
.
tree_prefix
in
{
model_prefix
;
tree_prefix
;
res_by_tools
;
merged_results
;
plot_merged_results
}
{
model_prefix
;
tree_prefix
;
dataset
;
res_by_tools
;
merged_results
;
plot_merged_results
}
let
derive_det
~
dataset_l
~
preview
~
no_diffsel
=
List
.
map
dataset_l
~
f
:
(
fun
dataset
->
...
...
lib/post_analyses.ml
View file @
5b243643
...
...
@@ -8,15 +8,25 @@ open Convergence_detection
type
post_analyses_dir
type
post_analys
es
=
{
type
t_choic
es
=
{
t_choices_complete
:
text_file
workflow
;
t_choices_max
:
text_file
workflow
;
t_choices_plot
:
text_file
workflow
;
}
let
is_hyp
~
hyp
dataset_results
=
type
simu_infos
=
{
simu_infos
:
text_file
workflow
option
;
model_prefix
:
string
;
}
type
post_analyses
=
{
t_choices
:
t_choices
option
;
simu_infos_l
:
simu_infos
list
;
}
let
is_hyp
~
hyp
(
dataset_results
:
dataset_res
)
=
let
model_prefix
=
dataset_results
.
model_prefix
in
let
merged_results
=
dataset_results
.
merged_results
in
model_prefix
=
hyp
let
make_t_choices
~
h0_merged_results
~
ha_merged_results
:
post_analyses_dir
directory
workflow
=
...
...
@@ -35,7 +45,19 @@ let make_t_choices ~h0_merged_results ~ha_merged_results : post_analyses_dir dir
])
]
let
post_analyses_of_dataset_results_l
~
dataset_results_l
=
let
make_simu_infos
?
(
descr
=
""
)
?
(
fna_infos
)
~
faa
~
tree_sc
:
text_file
workflow
=
let
env
=
docker_image
~
account
:
"carinerey"
~
name
:
"pcoc"
~
tag
:
"07022018"
()
in
workflow
~
descr
:
(
"post_analyses.simu_infos."
^
descr
)
[
cmd
"python"
~
env
[
file_dump
(
string
Scripts
.
calc_simu_infos
)
;
opt
"--faa"
dep
faa
;
opt
"--tree"
dep
tree_sc
;
option
(
opt
"--fna_infos"
dep
)
fna_infos
;
opt
"--output "
ident
dest
;
];
]
let
get_t_choices
~
(
dataset_results_l
:
dataset_res
list
)
:
t_choices
option
=
let
h0_res
=
List
.
find
dataset_results_l
(
is_hyp
~
hyp
:
"H0"
)
in
let
ha_res
=
List
.
find
dataset_results_l
(
is_hyp
~
hyp
:
"HaPCOC"
)
in
match
(
h0_res
,
ha_res
)
with
...
...
@@ -47,14 +69,42 @@ let post_analyses_of_dataset_results_l ~dataset_results_l =
let
t_choices_complete
=
t_choices_dir
/
selector
[
"out.complete.tsv"
]
in
let
t_choices_plot
=
t_choices_dir
/
selector
[
"out.pdf"
]
in
Some
{
t_choices_max
;
t_choices_complete
;
t_choices_plot
}
|
_
->
failwith
{
|
tata
|
}
|
_
->
None
let
get_simu_infos
~
dataset_results
=
let
model_prefix
=
dataset_results
.
dataset
.
model_prefix
in
let
ready_dataset
=
dataset_results
.
dataset
.
dataset
in
let
faa
=
ready_dataset
.
faa
in
let
tree_sc
=
Tree_dataset
.
tree
ready_dataset
.
tree_dataset
`Detection
in
let
fna_infos
=
ready_dataset
.
fna_infos
in
match
fna_infos
with
|
Some
w
->
Some
(
make_simu_infos
~
descr
:
model_prefix
~
faa
~
tree_sc
~
fna_infos
:
w
)
|
None
->
None
(*make_simu_infos ~faa ~tree_sc*)
let
post_analyses_of_dataset_results_l
~
dataset_results_l
=
let
t_choices
=
get_t_choices
~
dataset_results_l
in
let
simu_infos_l
=
List
.
map
dataset_results_l
~
f
:
(
fun
dataset_results
->
{
simu_infos
=
(
get_simu_infos
~
dataset_results
);
model_prefix
=
dataset_results
.
model_prefix
}
)
in
{
t_choices
;
simu_infos_l
}
let
repo_of_post_analyses
~
prefix
~
post_analyses
=
match
post_analyses
with
[
(
match
post_analyses
.
t_choices
with
|
None
->
[]
|
Some
w
->
|
Some
w
->
Repo
.[
item
[
prefix
^
".t_choices.max_mcc_per_meth.tsv"
]
w
.
t_choices_max
;
item
[
prefix
^
".t_choices.complete.tsv"
]
w
.
t_choices_complete
;
item
[
prefix
^
".t_choices.pdf"
]
w
.
t_choices_plot
;
]
|>
Repo
.
shift
"t_choices"
);
List
.
map
post_analyses
.
simu_infos_l
~
f
:
(
fun
simu_infos
->
match
simu_infos
.
simu_infos
with
|
None
->
[]
|
Some
w
->
Repo
.[
item
[
prefix
^
"."
^
simu_infos
.
model_prefix
^
".tsv"
]
w
]
|>
Repo
.
shift
"simu_infos"
)
|>
List
.
concat
]
|>
List
.
concat
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment