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
2d8a6de2
Commit
2d8a6de2
authored
Dec 16, 2018
by
Philippe Veber
Browse files
started alternative pipeline formulation
parent
8f0b1627
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
80 additions
and
0 deletions
+80
-0
lib/pipeline2.ml
lib/pipeline2.ml
+80
-0
No files found.
lib/pipeline2.ml
0 → 100644
View file @
2d8a6de2
open
Base
open
Printf
open
Bistro
.
EDSL
open
File_formats
type
dataset
=
|
Simulation
of
simulation
and
simulation
=
{
hypothesis
:
Convergence_hypothesis
.
t
;
tree
:
[
`NHX
of
string
]
;
profiles
:
string
;
nb_sites
:
int
;
seed
:
int
;
}
let
calc_fixed_seed
~
(
str
:
string
)
(
seed
:
int
)
:
int
=
let
str_hash
=
Hashtbl
.
hash
str
in
Hashtbl
.
hash
(
str_hash
+
seed
)
let
simulation
~
hyp
~
tree
~
profiles
~
nb_sites
~
seed
=
Simulation
{
hypothesis
=
hyp
;
tree
=
`NHX
tree
;
profiles
;
nb_sites
;
seed
;
}
let
tree_prefix
=
function
|
Simulation
{
tree
=
`NHX
path
}
->
Caml
.
Filename
.
chop_extension
path
let
tree_dataset
=
function
|
Simulation
{
tree
=
`NHX
tree
}
as
sim
->
Tree_dataset
.
prepare
~
descr
:
(
"simulated_data."
^
(
tree_prefix
sim
))
(
input
tree
)
let
tree
=
function
|
Simulation
{
tree
=
`NHX
path
}
->
input
path
let
profile
sim
=
Profile
.
profile_l_of_splitted_profile
~
nb_cat
:
All
~
nb_sites
:
sim
.
nb_sites
sim
.
profiles
~
seed
:
(
Random
.
int
Int
.
max_value
)
let
bppseqgen
(
Simulation
sim
as
d
)
=
let
model_prefix
=
Convergence_hypothesis
.
string_of_model
sim
.
hypothesis
in
let
descr
=
sprintf
".%s.%s"
model_prefix
(
tree_prefix
d
)
in
let
profile
=
profile
sim
in
let
profile_f
=
profile
.
profile_f
in
let
profile_c
=
profile
.
profile_c
in
let
seed
=
calc_fixed_seed
~
str
:
descr
sim
.
seed
in
Bppsuite
.
Bppseqgen
.
multi_profiles
~
descr
~
tree_dataset
:
(
tree_dataset
d
)
~
hypothesis
:
sim
.
hypothesis
~
profile_f
~
profile_c
~
seed
let
nucleotide_alignment
(
Simulation
sim
as
d
)
=
bppseqgen
d
|>
Bppsuite
.
Bppseqgen
.
alignment
let
phylip_nucleotide_alignment
d
=
Bppsuite
.
fna2phy
(
nucleotide_alignment
d
)
(* let diffseldsparse d =
* Diffseldsparse.diffseldsparse
* ~alignment:(phylip_nucleotide_alignment d)
* ~tree:(tree d)
* ~w_every:1
* ~n_cycles:2
* () *)
let
eval
x
=
Bistro_utils
.
Term
.(
run
~
np
:
8
~
mem
:
(
`GB
8
)
~
logger
:
(
Bistro_utils
.
Console_logger
.
create
()
)
(
pureW
x
)
)
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