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
1b83c56f
Commit
1b83c56f
authored
Sep 04, 2018
by
Carine Rey
Browse files
refactoring in profile.ml
parent
708615e3
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
19 additions
and
12 deletions
+19
-12
lib/pipeline.ml
lib/pipeline.ml
+2
-2
lib/profile.ml
lib/profile.ml
+17
-10
No files found.
lib/pipeline.ml
View file @
1b83c56f
...
...
@@ -375,7 +375,7 @@ let detection_main ~outdir ~indir ?(np = 2) ?(mem = 2) ~preview ~fast_mode ?(see
let
simulation_main
~
outdir
?
(
ns
=
0
)
?
(
np
=
2
)
?
(
mem
=
2
)
~
tree_dir
~
profile_fn
~
preview
~
use_concat
~
no_Ne
~
no_HaPC
~
add_indels
?
(
seed
=
Random
.
int
Int
.
max_value
)
()
=
let
nb_sites
=
if
ns
=
0
then
(
if
preview
then
20
else
50
)
else
ns
in
let
profile
=
Profile
.
profile_l_of_splitted_profile
~
nb_cat
:
1
~
nb_sites
profile_fn
~
seed
:
(
Random
.
int
Int
.
max_value
)
in
let
profile
=
Profile
.
profile_l_of_splitted_profile
~
nb_cat
:
All
~
nb_sites
profile_fn
~
seed
:
(
Random
.
int
Int
.
max_value
)
in
let
trees
=
Array
.
to_list
@@
Sys
.
readdir
tree_dir
in
let
dataset_l
=
derive_sim
~
tree_dir
~
trees
~
profile
~
preview
~
use_concat
~
ns
~
no_Ne
~
no_HaPC
~
ne_test
:
false
~
add_indels
~
seed
in
...
...
@@ -388,7 +388,7 @@ let validation_main ~outdir ?(indir = "") ?(ns = 0) ?(np = 2) ?(mem = 2) ~previe
(* simulated trees *)
Random
.
init
seed
;
let
nb_sites
=
if
ns
=
0
then
(
if
preview
then
20
else
50
)
else
ns
in
let
profile
=
Profile
.
profile_l_of_splitted_profile
~
nb_cat
:
3
~
nb_sites
profile_fn
~
seed
:
(
Random
.
int
Int
.
max_value
)
in
let
profile
=
Profile
.
profile_l_of_splitted_profile
~
nb_cat
:
Dist
~
nb_sites
profile_fn
~
seed
:
(
Random
.
int
Int
.
max_value
)
in
let
sim_repo_l
=
derive_profile
~
indir
~
ns
~
preview
~
fast_mode
~
no_Ne
~
ne_test
~
no_HaPC
~
tree_dir
~
profile
~
use_concat
~
add_indels
~
only_simu
~
seed
()
in
(* real trees *)
let
indir_dataset_l
=
if
indir
=
""
then
[]
else
parse_input_data
~
seed
indir
in
...
...
lib/profile.ml
View file @
1b83c56f
...
...
@@ -47,24 +47,31 @@ let cat_file ~(f_l: text_file workflow list) : text_file workflow =
])
]
type
profile_choice
=
|
All
|
Dist
|
Unif_3
let
profile_l_of_splitted_profile
~
nb_cat
~
nb_sites
profile_fn
~
seed
=
let
profile_f
=
input
profile_fn
in
let
prefix
=
Filename
.
chop_extension
(
Filename
.
basename
profile_fn
)
in
let
dist_bins
=
match
nb_cat
with
|
3
->
"[0.01,0.4],[0.4,0.6],[0.6,2]"
|
1
->
"[0.
01,0.7
]"
|
_
->
failwith
{
|
nbcat
must
be
1
or
3
|
}
|
Unif_
3
->
"[0.01,0.4],[0.4,0.6],[0.6,2]"
|
Dist
->
"[0.
6,2
]"
|
All
->
"[0.01,2]"
in
let
splitted_profile
=
split_profile
~
nb_sites
~
dist_bins
profile_f
~
seed
in
match
nb_cat
with
|
3
->
(
let
_
p0
=
splitted_profile
/
selector
[
"profile_0.tsv"
]
in
let
_
p1
=
splitted_profile
/
selector
[
"profile_1.tsv"
]
in
|
Unif_
3
->
(
let
p0
=
splitted_profile
/
selector
[
"profile_0.tsv"
]
in
let
p1
=
splitted_profile
/
selector
[
"profile_1.tsv"
]
in
let
p2
=
splitted_profile
/
selector
[
"profile_2.tsv"
]
in
(*{profile_c=cat_file [p0;p1;p2] ; profile_n=prefix ^ "_3categories" ; profile_f}*)
{
profile_c
=
p2
;
profile_n
=
prefix
^
"_1categorie_max_dist"
;
profile_f
};
{
profile_c
=
cat_file
[
p0
;
p1
;
p2
]
;
profile_n
=
prefix
^
"_3categories"
;
profile_f
}
)
|
Dist
->
(
let
p0
=
splitted_profile
/
selector
[
"profile_0.tsv"
]
in
{
profile_c
=
p0
;
profile_n
=
prefix
^
"_1categorie_max_dist"
;
profile_f
};
)
|
1
->
(
let
p0
=
splitted_profile
/
selector
[
"profile_0.tsv"
]
in
|
All
->
(
let
p0
=
splitted_profile
/
selector
[
"profile_0.tsv"
]
in
{
profile_c
=
p0
;
profile_n
=
prefix
;
profile_f
})
|
_
->
failwith
{
|
nbcat
must
be
1
or
3
|
}
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