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
Docker-in-Docker (DinD) capabilities of public runners deactivated.
More info
Open sidebar
VEBER Philippe
codepi
Commits
a8a7d82a
Commit
a8a7d82a
authored
Nov 23, 2020
by
Philippe Veber
Browse files
moved pair_tree workflow definition to simulation dataset
parent
aff077d9
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
22 additions
and
43 deletions
+22
-43
lib/mutsel_simulator.ml
lib/mutsel_simulator.ml
+0
-24
lib/mutsel_simulator.mli
lib/mutsel_simulator.mli
+0
-5
lib/simulation_pipeline.ml
lib/simulation_pipeline.ml
+16
-9
lib/simulation_pipeline.mli
lib/simulation_pipeline.mli
+6
-5
No files found.
lib/mutsel_simulator.ml
View file @
a8a7d82a
...
...
@@ -61,27 +61,3 @@ let fitness_histogram sim =
OCamlR_grDevices
.
dev_off
()
in
Workflow
.
path_plugin
~
descr
:
"simulator.fitness_histogram"
f
let
pair_tree
~
branch_length1
~
branch_length2
~
npairs
=
let
f
=
fun
%
workflow
dest
->
let
open
Phylogenetics
in
let
branch_length1
,
branch_length2
,
npairs
=
[
%
param
branch_length1
,
branch_length2
,
npairs
]
in
let
leaf
name
=
Tree
.
leaf
{
Newick_ast
.
name
=
Some
name
}
in
let
branch
~
length
~
condition
tip
=
let
tags
=
match
condition
with
|
`Ancestral
->
[
"Condition"
,
"0"
]
|
`Convergent
->
[
"Condition"
,
"1"
;
"Transition"
,
"1"
]
in
Tree
.
branch
{
Newick_ast
.
length
=
Some
length
;
tags
}
tip
in
let
make_pair
i
=
Tree
.
binary_node
{
Newick_ast
.
name
=
None
}
(
branch
~
length
:
branch_length2
~
condition
:
`Ancestral
(
leaf
(
sprintf
"A%d"
i
)))
(
branch
~
length
:
branch_length2
~
condition
:
`Convergent
(
leaf
(
sprintf
"C%d"
i
)))
|>
branch
~
length
:
branch_length1
~
condition
:
`Ancestral
in
let
tree
=
Newick
.
Tree
(
Tree
.
node
{
Newick_ast
.
name
=
None
}
(
List1
.
init
npairs
~
f
:
make_pair
))
in
Newick
.
to_file
tree
dest
in
Workflow
.
path_plugin
~
descr
:
"simulator.pair_tree"
f
lib/mutsel_simulator.mli
View file @
a8a7d82a
...
...
@@ -21,8 +21,3 @@ val alignment_of_simulation :
val
fitness_histogram
:
Mutsel_simulator
.
Site_independent
.
simulation
workflow
->
pdf
file
val
pair_tree
:
branch_length1
:
float
->
branch_length2
:
float
->
npairs
:
int
->
nhx
file
lib/simulation_pipeline.ml
View file @
a8a7d82a
...
...
@@ -9,11 +9,7 @@ let calc_fixed_seed ~(str:string) (seed:int) : int =
type
tree
=
|
NHX
of
nhx
file
|
Pair_tree
of
{
npairs
:
int
;
branch_length1
:
float
;
branch_length2
:
float
;
}
|
Convergence_tree
of
Codepitk
.
Convergence_tree
.
t
workflow
let
nhx_of_convergence_tree
tree
=
let
f
=
fun
%
workflow
dest
->
...
...
@@ -36,6 +32,19 @@ let nhx_of_convergence_tree tree =
in
Workflow
.
path_plugin
~
descr
:
"nhx_of_convergence_tree"
f
let
pair_tree
~
branch_length1
~
branch_length2
~
npairs
=
let
leaf_info
i
c
=
sprintf
"%c%d"
(
match
c
with
`Convergent
->
'
C'
|
`Ancestral
->
'
A'
)
i
in
Convergence_tree
(
Codepitk
.
Convergence_tree
.
pair_tree
~
leaf_info
~
node_info
:
()
~
branch_length1
~
branch_length2
~
npairs
|>
Workflow
.
data
)
module
type
S
=
sig
type
query
...
...
@@ -47,10 +56,8 @@ end
let
tree_workflow
=
function
|
NHX
w
->
w
|
Pair_tree
{
branch_length1
;
branch_length2
;
npairs
}
->
Mutsel_simulator
.
pair_tree
~
branch_length1
~
branch_length2
~
npairs
|
Convergence_tree
w
->
nhx_of_convergence_tree
w
module
Make
(
Q
:
Detection_pipeline
.
Query
)
=
struct
include
Detection_pipeline
.
Make
(
Q
)
...
...
lib/simulation_pipeline.mli
View file @
a8a7d82a
...
...
@@ -3,16 +3,17 @@ open File_formats
type
tree
=
|
NHX
of
nhx
file
|
Pair_tree
of
{
npairs
:
int
;
branch_length1
:
float
;
branch_length2
:
float
;
}
|
Convergence_tree
of
Codepitk
.
Convergence_tree
.
t
workflow
val
nhx_of_convergence_tree
:
Codepitk
.
Convergence_tree
.
t
workflow
->
nhx
file
val
pair_tree
:
branch_length1
:
float
->
branch_length2
:
float
->
npairs
:
int
->
tree
module
type
S
=
sig
type
query
...
...
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