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
8ff45c6f
Commit
8ff45c6f
authored
May 01, 2019
by
Philippe Veber
Browse files
full multinomial benchmark
parent
1894f40b
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
34 additions
and
5 deletions
+34
-5
lib/multinomial.ml
lib/multinomial.ml
+15
-4
lib/pipeline2.ml
lib/pipeline2.ml
+19
-1
No files found.
lib/multinomial.ml
View file @
8ff45c6f
...
...
@@ -14,9 +14,17 @@ let multinomial ~(tree_sc:_ pworkflow) ~(faa:aminoacid_fasta pworkflow) : text_f
]
]
let
%
pworkflow
multinomial_
asymptotic_lrt
~
(
tree_sc
:_
pworkflow
)
~
(
faa
:
aminoacid_fasta
pworkflow
)
(* : text_file pworkflow *)
=
let
%
pworkflow
multinomial_
ocaml_implementation
~
meth
~
(
tree_sc
:_
pworkflow
)
~
(
faa
:
aminoacid_fasta
pworkflow
)
(* : text_file pworkflow *)
=
let
open
Phylogenetics
in
let
open
Convdet
in
let
module
MT
=
Multinomial_test
in
let
meth
=
[
%
param
meth
]
in
let
test
=
match
meth
with
|
`Asymptotic_LRT
->
MT
.
LRT
.
asymptotic_test
|
`Simulation_LRT
->
MT
.
LRT
.
simulation_test
~
sample_size
:
10_000
|
`Asymptotic_sparse
->
MT
.
Sparse
.
asymptotic_test
|
`Simulation_sparse
->
MT
.
Sparse
.
simulation_test
~
sample_size
:
10_000
in
let
fold_leaves
(
root
:
_
Tree
.
t
)
~
init
~
f
=
let
open
Tree
in
let
rec
node
acc
branch_data
n
=
...
...
@@ -56,12 +64,10 @@ let%pworkflow multinomial_asymptotic_lrt ~(tree_sc:_ pworkflow) ~(faa:aminoacid_
)
in
let
site
i
=
let
module
MT
=
Multinomial_test
in
let
c0
=
(
counts
seqs0
i
:>
int
array
)
in
let
c1
=
(
counts
seqs1
i
:>
int
array
)
in
let
d
=
MT
.
data
~
x1
:
c0
~
x2
:
c1
in
let
r
=
MT
.
LRT
.
asymptotic_
test
d
in
let
r
=
test
d
in
r
._
T_
,
r
.
pvalue
in
let
n
=
Alignment
.
ncols
alignment
in
...
...
@@ -73,3 +79,8 @@ let%pworkflow multinomial_asymptotic_lrt ~(tree_sc:_ pworkflow) ~(faa:aminoacid_
in
let
header
=
"Sites
\t
1MinusLRT
\t
LikelihoodRatio"
in
Out_channel
.
write_lines
[
%
dest
]
(
header
::
res_lines
)
let
multinomial_asymptotic_lrt
~
tree_sc
~
faa
=
multinomial_ocaml_implementation
~
meth
:
`Asymptotic_LRT
~
tree_sc
~
faa
let
multinomial_simulation_lrt
~
tree_sc
~
faa
=
multinomial_ocaml_implementation
~
meth
:
`Simulation_LRT
~
tree_sc
~
faa
let
multinomial_asymptotic_sparse
~
tree_sc
~
faa
=
multinomial_ocaml_implementation
~
meth
:
`Asymptotic_sparse
~
tree_sc
~
faa
let
multinomial_simulation_sparse
~
tree_sc
~
faa
=
multinomial_ocaml_implementation
~
meth
:
`Simulation_sparse
~
tree_sc
~
faa
lib/pipeline2.ml
View file @
8ff45c6f
...
...
@@ -154,6 +154,21 @@ let multinomial_asymptotic_lrt d =
~
tree_sc
:
(
tree
d
)
~
faa
:
(
amino_acid_alignment
d
)
let
multinomial_asymptotic_sparse
d
=
Multinomial
.
multinomial_asymptotic_sparse
~
tree_sc
:
(
tree
d
)
~
faa
:
(
amino_acid_alignment
d
)
let
multinomial_simulation_lrt
d
=
Multinomial
.
multinomial_simulation_lrt
~
tree_sc
:
(
tree
d
)
~
faa
:
(
amino_acid_alignment
d
)
let
multinomial_simulation_sparse
d
=
Multinomial
.
multinomial_simulation_sparse
~
tree_sc
:
(
tree
d
)
~
faa
:
(
amino_acid_alignment
d
)
let
diffseldsparse
?
pi
?
shiftprob
?
eps
d
=
Diffseldsparse
.
diffseldsparse
?
pi
?
shiftprob
?
eps
...
...
@@ -188,9 +203,12 @@ let oracle d =
let
multinomial_benchmark
d
=
Utils
.
rp_curve
~
oracle
:
(
oracle
d
)
~
labels
:
[
|
"LRT"
|
]
~
labels
:
[
|
"LRT"
;
"LRTsim"
;
"sparse"
;
"sparse_sim"
|
]
~
results
:
[
multinomial_asymptotic_lrt
d
;
multinomial_simulation_lrt
d
;
multinomial_asymptotic_sparse
d
;
multinomial_simulation_sparse
d
;
]
let
benchmark
d
=
...
...
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