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
aff077d9
Commit
aff077d9
authored
Nov 23, 2020
by
Philippe Veber
Browse files
tk: moved pair_tree generation to Convergence_tree
parent
09144976
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
24 additions
and
11 deletions
+24
-11
lib/tk/convergence_tree.ml
lib/tk/convergence_tree.ml
+12
-0
lib/tk/convergence_tree.mli
lib/tk/convergence_tree.mli
+8
-0
lib/tk/tdg09.ml
lib/tk/tdg09.ml
+4
-11
No files found.
lib/tk/convergence_tree.ml
View file @
aff077d9
...
...
@@ -237,3 +237,15 @@ let alignment_counts_map tree alignment f =
let
site
i
=
f
(
counts
seqs0
i
)
(
counts
seqs1
i
)
in
let
n
=
Alignment
.
ncols
alignment
in
List
.
init
n
~
f
:
site
let
pair_tree
~
node_info
~
leaf_info
~
branch_length1
~
branch_length2
~
npairs
=
let
leaf
i
cond
=
Tree
.
Leaf
(
leaf_info
i
cond
)
in
let
branch
length
condition
tip
=
Tree
.
branch
{
length
;
condition
}
tip
in
let
tree
=
Tree
.
binary_node
node_info
in
let
make_pair
i
=
tree
(
branch
branch_length2
`Ancestral
(
leaf
(
2
*
i
)
`Ancestral
))
(
branch
branch_length2
`Convergent
(
leaf
(
2
*
i
+
1
)
`Convergent
))
|>
branch
branch_length1
`Ancestral
in
Tree
.
node
node_info
(
List1
.
init
npairs
~
f
:
make_pair
)
lib/tk/convergence_tree.mli
View file @
aff077d9
...
...
@@ -41,3 +41,11 @@ val alignment_counts_map :
Alignment
.
t
->
(
int
Amino_acid
.
table
->
int
Amino_acid
.
table
->
'
a
)
->
'
a
list
val
pair_tree
:
node_info
:
'
n
->
leaf_info
:
(
int
->
condition
->
'
l
)
->
branch_length1
:
float
->
branch_length2
:
float
->
npairs
:
int
->
(
'
n
,
'
l
,
branch_info
)
Phylogenetics
.
Tree
.
t
lib/tk/tdg09.ml
View file @
aff077d9
...
...
@@ -442,17 +442,10 @@ module Pack = struct
Owl
.
Stats
.
dirichlet_rvs
~
alpha
:
(
Array
.
create
~
len
:
Amino_acid
.
card
alpha
)
|>
Amino_acid
.
Vector
.
of_array_exn
let
pair_tree
~
branch_length1
~
branch_length2
~
npairs
=
let
leaf
i
cond
=
Tree
.
Leaf
(
i
,
cond
)
in
let
branch
length
condition
tip
=
Tree
.
branch
{
Convergence_tree
.
length
;
condition
}
tip
in
let
tree
=
Tree
.
binary_node
()
in
let
make_pair
i
=
tree
(
branch
branch_length2
`Ancestral
(
leaf
(
2
*
i
)
`Ancestral
))
(
branch
branch_length2
`Convergent
(
leaf
(
2
*
i
+
1
)
`Convergent
))
|>
branch
branch_length1
`Ancestral
in
Tree
.
node
()
(
List1
.
init
npairs
~
f
:
make_pair
)
let
pair_tree
=
let
leaf_info
i
cond
=
(
i
,
cond
)
in
let
node_info
=
()
in
Convergence_tree
.
pair_tree
~
leaf_info
~
node_info
end
module
Implementation_check
=
struct
...
...
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