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
8f0b1627
Commit
8f0b1627
authored
Dec 16, 2018
by
Philippe Veber
Browse files
further refactoring bppseqgen
parent
5dae0406
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
8 additions
and
23 deletions
+8
-23
lib/bppsuite.ml
lib/bppsuite.ml
+7
-11
lib/bppsuite.mli
lib/bppsuite.mli
+0
-2
lib/pipeline.ml
lib/pipeline.ml
+1
-10
No files found.
lib/bppsuite.ml
View file @
8f0b1627
...
...
@@ -89,7 +89,7 @@ rate_distribution=Constant()
let
conf_file_bppseqgen_multi_profiles
~
tree
~
profile_f
~
ne_c
~
ne_a
~
hypothesis
~
nb_sites_per_profile
=
seq
~
sep
:
"
\n
"
(
[
bpp_config_F
hypothesis
@
[
assign
"input.tree.file"
(
dep
tree
)
;
assign
"input.tree.scale"
(
int
3
)
;
assign
"PROFILE_F"
(
dep
profile_f
)
;
...
...
@@ -97,8 +97,8 @@ rate_distribution=Constant()
assign
"NE_1"
(
float
ne_a
)
;
assign
"NE_C"
(
float
ne_c
)
;
assign
"NE_T"
(
float
ne_c
)
;
string
""
;
(* finish with carriage return *)
]
@
bpp_config_F
hypothesis
)
let
bppseqgen_multi_profiles_script
~
config
~
out
~
profile_c
~
seed
=
...
...
@@ -130,31 +130,27 @@ rate_distribution=Constant()
|
}
let
multi_profiles
?
(
descr
=
""
)
~
profile_f
~
profile_c
~
tree_dataset
~
hypothesis
~
ne_c
~
ne_a
~
seed
=
let
multi_profiles
?
(
descr
=
""
)
~
profile_f
~
profile_c
~
tree_dataset
~
hypothesis
~
seed
=
let
nb_sites_per_profile
=
1
in
(* let nb_combis = Pervasives.(nb_sites / nb_sites_per_profile) in *)
let
config_f
=
dest
//
"config.bpp"
in
(* let profile_c_ok = tmp // "profiles_c.tsv" in *)
let
profile_c_ok
=
dep
profile_c
in
let
out
=
dest
//
"seq.fa"
in
let
tree
=
Tree_dataset
.
tree
tree_dataset
`Simulation
in
let
nodes
=
Tree_dataset
.
nodes
tree_dataset
hypothesis
in
let
ne_g
=
Convergence_hypothesis
.
neg_of_model
hypothesis
in
let
ne_c
=
Convergence_hypothesis
.
nec_of_model
hypothesis
in
let
ne_a
=
ne_g
in
workflow
~
descr
:
(
"bppsuite.bppseqgen"
^
descr
)
[
docker
env
(
and_list
[
mkdir_p
dest
;
mkdir_p
tmp
;
cd
tmp
;
(*cmd "head" ~stdout:profile_c_ok [
opt "-n" int nb_sites;
dep profile_c
];*)
cmd
"cat"
~
stdout
:
config_f
[
file_dump
(
conf_file_bppseqgen_multi_profiles
~
tree
~
profile_f
~
hypothesis
~
ne_c
~
ne_a
~
nb_sites_per_profile
)
;
file_dump
(
seq
~
sep
:
"
\n
"
[
string
"
\n
"
])
;
dep
nodes
;
];
cmd
"bash"
[
(
file_dump
(
bppseqgen_multi_profiles_script
~
config
:
config_f
~
out
~
profile_c
:
profile_c_ok
~
seed
)
)
];
cmd
"bash"
[
file_dump
(
bppseqgen_multi_profiles_script
~
config
:
config_f
~
out
~
profile_c
:
profile_c_ok
~
seed
)];
]
)
]
...
...
lib/bppsuite.mli
View file @
8f0b1627
...
...
@@ -9,8 +9,6 @@ module Bppseqgen : sig
profile_c
:
text_file
workflow
->
tree_dataset
:
[
`tree_dataset
]
directory
workflow
->
hypothesis
:
Convergence_hypothesis
.
t
->
ne_c
:
float
->
ne_a
:
float
->
seed
:
int
->
[
`bppseqgen
]
directory
workflow
...
...
lib/pipeline.ml
View file @
8f0b1627
...
...
@@ -54,22 +54,13 @@ let calc_fixed_seed ~(str:string) (seed:int) : int =
let
derive_from_model
~
model
~
input_tree
~
tree_dataset
~
tree_prefix
~
profile
~
preview
~
ns
~
seed
=
let
model_prefix
=
Convergence_hypothesis
.
string_of_model
model
in
let
descr
=
"."
^
model_prefix
^
"."
^
tree_prefix
in
(* only 1 profile or 1 couple of profiles*)
(*let config = Convergence_hypothesis.bpp_config nodes model in
let fna = Bppsuite.bppseqgen ~descr ~nb_sites ~tree ~config in
*)
(* with several profiles or couples of profiles *)
let
ne_g
=
neg_of_model
model
in
let
ne_c
=
nec_of_model
model
in
let
ne_a
=
ne_g
in
let
profile_f
=
profile
.
profile_f
in
let
profile_c
=
profile
.
profile_c
in
(*let seed = Random.int Int.max_value in*)
let
seed
=
calc_fixed_seed
~
str
:
descr
seed
in
let
run_fna
=
Bppsuite
.
Bppseqgen
.
multi_profiles
~
descr
~
tree_dataset
~
hypothesis
:
model
~
profile_f
~
profile_c
~
ne_c
~
ne_a
~
seed
in
let
run_fna
=
Bppsuite
.
Bppseqgen
.
multi_profiles
~
descr
~
tree_dataset
~
hypothesis
:
model
~
profile_f
~
profile_c
~
seed
in
let
fna
=
Bppsuite
.
Bppseqgen
.
alignment
run_fna
in
let
fna_infos
=
Some
(
Bppsuite
.
Bppseqgen
.
info
run_fna
)
in
let
faa
=
Bppsuite
.
fna2faa
~
fna
in
let
ready_dataset
=
{
Ready_dataset
.
input_tree
=
input_tree
;
tree_dataset
;
fna
;
faa
;
fna_infos
}
in
{
Dataset
.
model_prefix
;
is_real
=
false
;
tree_prefix
;
dataset
=
ready_dataset
;
seed
}
...
...
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