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
1ece636f
Commit
1ece636f
authored
Nov 17, 2020
by
Philippe Veber
Browse files
Merge branch 'simulation-dataset-refactoring'
parents
a2508335
5eba3f41
Changes
36
Hide whitespace changes
Inline
Side-by-side
Showing
20 changed files
with
112 additions
and
203 deletions
+112
-203
app/diffseldsparse_benchmark.ml
app/diffseldsparse_benchmark.ml
+0
-31
app/dune
app/dune
+0
-8
app/lmm_benchmark.ml
app/lmm_benchmark.ml
+14
-51
lib/convergence_detection.ml
lib/convergence_detection.ml
+5
-4
lib/convergence_detection.mli
lib/convergence_detection.mli
+19
-19
lib/detection_pipeline.ml
lib/detection_pipeline.ml
+18
-23
lib/detection_pipeline.mli
lib/detection_pipeline.mli
+17
-17
lib/diffsel.ml
lib/diffsel.ml
+1
-1
lib/diffsel.mli
lib/diffsel.mli
+1
-1
lib/diffseldsparse.ml
lib/diffseldsparse.ml
+1
-1
lib/diffseldsparse.mli
lib/diffseldsparse.mli
+2
-2
lib/file_formats.ml
lib/file_formats.ml
+22
-14
lib/gemma.mli
lib/gemma.mli
+1
-1
lib/identical.ml
lib/identical.ml
+1
-1
lib/inhouse_lmm.mli
lib/inhouse_lmm.mli
+1
-1
lib/msd.ml
lib/msd.ml
+1
-1
lib/multinomial.ml
lib/multinomial.ml
+2
-14
lib/orthomam.ml
lib/orthomam.ml
+2
-2
lib/orthomam.mli
lib/orthomam.mli
+3
-10
lib/pcoc.ml
lib/pcoc.ml
+1
-1
No files found.
app/diffseldsparse_benchmark.ml
deleted
100644 → 0
View file @
a2508335
open
Core
open
Codepi
let
main
~
n_h0
~
n_ha
~
seed
:
i
()
=
let
open
Simulation_dataset
in
let
sim
=
bppseqgen_mixed
~
tree
:
(
NHX
(
Bistro
.
Workflow
.
input
"example/trees_analyses/cyp_coding.Chrysithr_root.nhx"
))
~
profiles
:
"example/aa_fitness/263SelectedProfiles.tsv"
~
n_h0
~
n_ha
~
ne_s
:
4
.
~
seed
:
i
()
in
let
w
=
benchmark
sim
in
Bistro_engine
.
Scheduler
.
simple_eval_exn
~
np
:
4
~
mem
:
(
`GB
4
)
(
Bistro
.
Workflow
.
path
w
)
|>
print_endline
let
command
=
let
open
Command
.
Let_syntax
in
Command
.
basic
~
summary
:
"Run diffseldsparse bench"
[
%
map_open
let
n_ha
=
flag
"--n-ha"
(
required
int
)
~
doc
:
"INT Number of Ha sites"
and
n_h0
=
flag
"--n-h0"
(
required
int
)
~
doc
:
"INT Number of H0 sites"
and
seed
=
flag
"--seed"
(
required
int
)
~
doc
:
"INT Global seed"
in
main
~
n_ha
~
n_h0
~
seed
]
let
()
=
Command
.
run
command
app/dune
View file @
1ece636f
...
...
@@ -6,14 +6,6 @@
(preprocess
(pps ppx_jane)))
(executable
(name diffseldsparse_benchmark)
(public_name diffseldsparse_benchmark)
(modules diffseldsparse_benchmark)
(libraries codepi)
(preprocess
(pps ppx_jane)))
(executable
(name orthomam_app)
(public_name orthomam_convergence)
...
...
app/lmm_benchmark.ml
View file @
1ece636f
...
...
@@ -3,6 +3,8 @@ open Bistro
open
Codepi
open
Codepi
.
File_formats
module
Pipeline
=
Simulation_pipeline
.
Mutsel
type
dataset
=
{
label
:
string
;
tree
:
nhx
file
;
...
...
@@ -49,18 +51,17 @@ let orthomam_echolocation = {
}
type
detection_method
=
{
result
:
Simulation_dataset
.
t
->
text
file
;
col
:
int
;
result
:
Pipeline
.
query
->
cpt
file
;
label
:
string
;
requires_rooted_tree
:
bool
;
}
let
meth
?
(
col
=
1
)
?
(
requires_rooted_tree
=
false
)
result
label
=
{
result
;
col
;
label
;
requires_rooted_tree
}
let
meth
?
(
requires_rooted_tree
=
false
)
result
label
=
{
result
;
label
;
requires_rooted_tree
}
let
methods
=
Simulation_dataset
.[
let
methods
=
Pipeline
.[
meth
tdg09
"tdg09"
;
meth
pcoc
~
col
:
3
"pcoc"
;
meth
pcoc
"pcoc"
;
(* meth pcoc_v2 ~col:3 "pcoc v2" ; *)
meth
(
gemma
~
lmm_test
:
`Score
~
relatedness_mode
:
`Standardized
)
"gemma"
;
meth
inhouse_lmm
"LMM"
;
...
...
@@ -68,65 +69,27 @@ let methods = Simulation_dataset.[
meth
topological
"topological"
~
requires_rooted_tree
:
true
;
]
let
benchmark
{
tree
=
t
;
rooted
;
ne_s
;
branch_scale
;
_
}
=
let
open
Simulation_dataset
in
let
sim
=
convdet_simulation
~
seed
:
42
~
tree
:
(
NHX
t
)
~
branch_scale
~
ne_s
~
profiles
:
"example/aa_fitness/263SelectedProfiles.tsv"
~
n_h0
:
900
~
n_ha
:
100
()
in
let
results
,
labels
=
List
.
filter_map
methods
~
f
:
(
fun
m
->
if
not
m
.
requires_rooted_tree
||
rooted
then
Some
((
m
.
result
sim
,
m
.
col
)
,
m
.
label
)
else
None
)
|>
List
.
unzip
in
Utils
.
average_precision_plot
~
oracle
:
(
oracle
sim
)
~
labels
~
results
let
benchmark_rds
?
(
seed
=
42
)
{
tree
=
t
;
rooted
;
ne_s
;
branch_scale
;
_
}
=
let
open
Simulation_dataset
in
let
param
=
Convdet_simulation_param
.
make
~
seed
~
tree
:
(
NHX
t
)
~
branch_scale
~
ne_s
let
q
=
Pipeline
.
query
~
seed
~
tree
:
(
NHX
t
)
~
branch_scale
~
ne_s
~
profiles
:
"example/aa_fitness/263SelectedProfiles.tsv"
~
n_h0
:
900
~
n_ha
:
100
()
in
let
sim
=
convdet_simulation_of_param
param
in
let
simulation
=
Convdet_simulation_param
.
simulation
param
in
let
results
,
labels
=
let
simulation
=
Pipeline
.
simulation
q
in
let
results
=
List
.
filter_map
methods
~
f
:
(
fun
m
->
if
not
m
.
requires_rooted_tree
||
rooted
then
Some
(
(
m
.
result
sim
,
m
.
col
)
,
m
.
label
)
Some
(
m
.
result
q
)
else
None
)
|>
List
.
unzip
in
benchmark_statistics
simulation
~
labels
~
results
let
report
=
let
module
H
=
Bistro_utils
.
Html_report
in
H
.
make
~
title
:
"Codepi benchmark"
[
H
.
section
"Besnard 2009 dataset"
;
H
.
pdf
(
benchmark
besnard2009
)
;
H
.
section
"Rubisco dataset"
;
H
.
pdf
(
benchmark
rubisco
)
;
H
.
section
"Rodent dataset"
;
H
.
pdf
(
benchmark
oneline_rodent
)
;
H
.
section
"Orthomam/echolocation dataset"
;
H
.
pdf
(
benchmark
orthomam_echolocation
)
;
]
|>
H
.
render
Pipeline
.
benchmark_statistics
simulation
~
results
let
()
=
let
open
Bistro_utils
.
Repo
in
let
datasets
=
[
besnard2009
;
rubisco
;
oneline_rodent
;
orthomam_echolocation
]
in
let
repo
=
item
[
"report.html"
]
report
::
List
.
map
datasets
~
f
:
(
fun
d
->
List
.
map
datasets
~
f
:
(
fun
d
->
item
[
d
.
label
^
".rds"
]
(
benchmark_rds
d
)
)
in
...
...
lib/convergence_detection.ml
View file @
1ece636f
open
Core
open
Bistro
.
Shell_dsl
open
Bistro
open
File_formats
type
result
=
[
|
`Pcoc
of
[
`pcoc
]
directory
...
...
@@ -12,7 +13,7 @@ type result = [
|
`Topological_LG
of
[
`topological
]
directory
|
`Topological_WAG
of
[
`topological
]
directory
|
`Tdg09
of
[
`tdg09
]
directory
|
`Multinomial
of
tex
t
file
|
`Multinomial
of
cp
t
file
|
`Msd
of
[
`msd
]
directory
*
float
]
...
...
@@ -34,11 +35,11 @@ type dataset_res = {
tree_prefix
:
string
;
dataset
:
Dataset
.
t
;
res_by_tools
:
result
list
;
merged_results
:
tex
t
file
;
merged_results
:
cp
t
file
;
plot_merged_results
:
svg
file
;
}
let
merge_results
?
fna_infos
~
(
res_by_tools
:
result
list
)
()
:
tex
t
file
=
let
merge_results
?
fna_infos
~
(
res_by_tools
:
result
list
)
()
:
cp
t
file
=
let
command
=
List
.
map
res_by_tools
~
f
:
(
fun
res
->
let
w
=
match
res
with
|
`Pcoc
d
->
Pcoc
.
results
d
...
...
@@ -78,7 +79,7 @@ let merge_results ?fna_infos ~(res_by_tools : result list) () : text file =
]
;
]
let
merge_result_tables
?
fna_infos
?
oracle
?
multinomial
?
tdg09
?
identical
?
topological
?
pcoc
?
pcoc_v2
?
pcoc_pcp
?
diffsel
?
diffseldsparse
()
:
tex
t
file
=
let
merge_result_tables
?
fna_infos
?
oracle
?
multinomial
?
tdg09
?
identical
?
topological
?
pcoc
?
pcoc_v2
?
pcoc_pcp
?
diffsel
?
diffseldsparse
()
:
cp
t
file
=
Workflow
.
shell
~
descr
:
"convergence_detection.merge_results"
~
img
:
Env
.
env_py
[
cmd
"python"
[
file_dump
(
string
Scripts
.
merge_det_results
)
;
...
...
lib/convergence_detection.mli
View file @
1ece636f
...
...
@@ -11,7 +11,7 @@ type result = [
|
`Topological_LG
of
[
`topological
]
directory
|
`Topological_WAG
of
[
`topological
]
directory
|
`Tdg09
of
[
`tdg09
]
directory
|
`Multinomial
of
tex
t
file
|
`Multinomial
of
cp
t
file
|
`Msd
of
[
`msd
]
directory
*
float
]
...
...
@@ -22,7 +22,7 @@ type dataset_res = {
tree_prefix
:
string
;
dataset
:
Dataset
.
t
;
res_by_tools
:
result
list
;
merged_results
:
tex
t
file
;
merged_results
:
cp
t
file
;
plot_merged_results
:
svg
file
}
...
...
@@ -30,22 +30,22 @@ val merge_results :
?
fna_infos
:
text
file
->
res_by_tools
:
result
list
->
unit
->
tex
t
file
cp
t
file
val
merge_result_tables
:
?
fna_infos
:
text
file
->
?
oracle
:
tex
t
file
->
?
multinomial
:
tex
t
file
->
?
tdg09
:
tex
t
file
->
?
identical
:
tex
t
file
->
?
topological
:
tex
t
file
->
?
pcoc
:
tex
t
file
->
?
pcoc_v2
:
tex
t
file
->
?
pcoc_pcp
:
tex
t
file
->
?
diffsel
:
tex
t
file
->
?
diffseldsparse
:
tex
t
file
->
?
oracle
:
cp
t
file
->
?
multinomial
:
cp
t
file
->
?
tdg09
:
cp
t
file
->
?
identical
:
cp
t
file
->
?
topological
:
cp
t
file
->
?
pcoc
:
cp
t
file
->
?
pcoc_v2
:
cp
t
file
->
?
pcoc_pcp
:
cp
t
file
->
?
diffsel
:
cp
t
file
->
?
diffseldsparse
:
cp
t
file
->
unit
->
tex
t
file
cp
t
file
val
plot_merge_results
:
?
t_choices
:
text
file
->
...
...
@@ -53,27 +53,27 @@ val plot_merge_results :
res_by_tools
:
result
list
->
tree
:
nhx
file
->
faa
:
aminoacid_fasta
file
->
tsv
:
tex
t
file
->
tsv
:
cp
t
file
->
unit
->
svg
file
val
plot_convergent_sites
:
?
plot_all_sites
:
bool
->
alignment
:
aminoacid_fasta
file
->
detection_results
:
tex
t
file
->
detection_results
:
cp
t
file
->
tree
:
nhx
file
->
unit
->
svg
file
val
recall_precision_curve
:
tex
t
file
->
cp
t
file
->
svg
file
val
oracle
:
n_h0
:
int
->
n_ha
:
int
->
tex
t
file
cp
t
file
val
recall_precision_auc_table
:
tex
t
file
->
cp
t
file
->
(
string
*
float
)
list
workflow
lib/detection_pipeline.ml
View file @
1ece636f
...
...
@@ -15,9 +15,11 @@ end
module
type
S
=
sig
type
query
include
Query
with
type
t
:=
query
val
amino_acid_alignment
:
query
->
aminoacid_fasta
file
val
gene_tree
:
query
->
n
w
file
val
gene_tree
:
query
->
n
ewick
file
val
dn_tree
:
query
->
text
file
...
...
@@ -25,52 +27,50 @@ module type S = sig
val
dnds_tree
:
query
->
text
file
val
identical
:
query
->
text
file
val
topological
:
query
->
text
file
val
identical
:
query
->
cpt
file
val
multinomi
al
:
query
->
tex
t
file
val
topologic
al
:
query
->
cp
t
file
val
multinomial_simulation_lrt
:
query
->
tex
t
file
val
multinomial_simulation_lrt
:
query
->
cp
t
file
val
multinomial_simulation_sparse
:
query
->
tex
t
file
val
multinomial_simulation_sparse
:
query
->
cp
t
file
val
multinomial_asymptotic_lrt
:
query
->
tex
t
file
val
multinomial_asymptotic_lrt
:
query
->
cp
t
file
val
multinomial_asymptotic_sparse
:
query
->
tex
t
file
val
multinomial_asymptotic_sparse
:
query
->
cp
t
file
val
tdg09
:
query
->
tex
t
file
val
tdg09
:
query
->
cp
t
file
val
failsafe_tdg09
:
query
->
tex
t
file
val
failsafe_tdg09
:
query
->
cp
t
file
val
pcoc
:
?
gamma
:
bool
->
?
ncat
:
int
->
query
->
tex
t
file
val
pcoc
:
?
gamma
:
bool
->
?
ncat
:
int
->
query
->
cp
t
file
val
pcoc_v2
:
?
gamma
:
bool
->
?
aa_profiles
:
Pcoc
.
aa_profiles
->
query
->
tex
t
file
?
gamma
:
bool
->
?
aa_profiles
:
Pcoc
.
aa_profiles
->
query
->
cp
t
file
val
gemma
:
query
->
lmm_test
:
[
`All
|
`LRT
|
`Score
|
`Wald
]
->
relatedness_mode
:
[
`Centered
|
`Standardized
]
->
tex
t
file
cp
t
file
val
inhouse_lmm
:
query
->
tex
t
file
val
inhouse_lmm
:
query
->
cp
t
file
val
diffsel
:
query
->
tex
t
file
val
diffsel
:
query
->
cp
t
file
val
diffseldsparse
:
?
pi
:
float
->
?
shiftprob
:
float
*
float
->
?
eps
:
float
->
query
->
tex
t
file
cp
t
file
val
view_site
:
query
->
convergent_species
:
string
list
->
site_pos
:
int
->
pdf
file
end
module
Make
(
Q
:
Query
)
=
struct
open
Q
include
Q
let
amino_acid_alignment
d
=
Utils
.
amino_acid_fasta_of_nucleotide_fasta
(
nucleotide_alignment
d
)
...
...
@@ -119,11 +119,6 @@ module Make (Q : Query) = struct
Topological
.
topological
~
faa
~
tree
~
tree_conv
~
prot_model
:
"LG08"
()
|>
Topological
.
results
let
multinomial
d
=
Multinomial
.
multinomial
~
tree_sc
:
(
tree
~
branch_length_unit
:
`Amino_acid
d
)
~
faa
:
(
amino_acid_alignment
d
)
()
let
multinomial_asymptotic_lrt
d
=
Multinomial
.
multinomial_asymptotic_lrt
~
tree_sc
:
(
tree
~
branch_length_unit
:
`Amino_acid
d
)
...
...
lib/detection_pipeline.mli
View file @
1ece636f
...
...
@@ -15,9 +15,11 @@ end
module
type
S
=
sig
type
query
include
Query
with
type
t
:=
query
val
amino_acid_alignment
:
query
->
aminoacid_fasta
file
val
gene_tree
:
query
->
n
w
file
val
gene_tree
:
query
->
n
ewick
file
val
dn_tree
:
query
->
text
file
...
...
@@ -25,45 +27,43 @@ module type S = sig
val
dnds_tree
:
query
->
text
file
val
identical
:
query
->
text
file
val
topological
:
query
->
text
file
val
identical
:
query
->
cpt
file
val
multinomi
al
:
query
->
tex
t
file
val
topologic
al
:
query
->
cp
t
file
val
multinomial_simulation_lrt
:
query
->
tex
t
file
val
multinomial_simulation_lrt
:
query
->
cp
t
file
val
multinomial_simulation_sparse
:
query
->
tex
t
file
val
multinomial_simulation_sparse
:
query
->
cp
t
file
val
multinomial_asymptotic_lrt
:
query
->
tex
t
file
val
multinomial_asymptotic_lrt
:
query
->
cp
t
file
val
multinomial_asymptotic_sparse
:
query
->
tex
t
file
val
multinomial_asymptotic_sparse
:
query
->
cp
t
file
val
tdg09
:
query
->
tex
t
file
val
tdg09
:
query
->
cp
t
file
val
failsafe_tdg09
:
query
->
tex
t
file
val
failsafe_tdg09
:
query
->
cp
t
file
val
pcoc
:
?
gamma
:
bool
->
?
ncat
:
int
->
query
->
tex
t
file
val
pcoc
:
?
gamma
:
bool
->
?
ncat
:
int
->
query
->
cp
t
file
val
pcoc_v2
:
?
gamma
:
bool
->
?
aa_profiles
:
Pcoc
.
aa_profiles
->
query
->
tex
t
file
?
gamma
:
bool
->
?
aa_profiles
:
Pcoc
.
aa_profiles
->
query
->
cp
t
file
val
gemma
:
query
->
lmm_test
:
[
`All
|
`LRT
|
`Score
|
`Wald
]
->
relatedness_mode
:
[
`Centered
|
`Standardized
]
->
tex
t
file
cp
t
file
val
inhouse_lmm
:
query
->
tex
t
file
val
inhouse_lmm
:
query
->
cp
t
file
val
diffsel
:
query
->
tex
t
file
val
diffsel
:
query
->
cp
t
file
val
diffseldsparse
:
?
pi
:
float
->
?
shiftprob
:
float
*
float
->
?
eps
:
float
->
query
->
tex
t
file
cp
t
file
val
view_site
:
query
->
convergent_species
:
string
list
->
site_pos
:
int
->
pdf
file
...
...
lib/diffsel.ml
View file @
1ece636f
...
...
@@ -106,7 +106,7 @@ let check_conv run_diffsel : [`diffsel_check_conv] directory =
]
]
let
selector
run_diffsel
:
tex
t
file
=
let
selector
run_diffsel
:
cp
t
file
=
let
env
=
Env
.
env_diffsel
in
let
package
=
tmp
//
"diffsel_script_utils.py"
in
let
script
=
tmp
//
"diffsel_analyze_result.py"
in
...
...
lib/diffsel.mli
View file @
1ece636f
...
...
@@ -13,7 +13,7 @@ val diffsel :
val
selector
:
[
`diffsel
]
directory
->
tex
t
file
cp
t
file
val
check_conv
:
[
`diffsel
]
directory
->
...
...
lib/diffseldsparse.ml
View file @
1ece636f
...
...
@@ -117,7 +117,7 @@ let readdiffseldsparse run =
]
]
let
posterior_probabilities
run_diffseldsparse
:
tex
t
file
=
let
posterior_probabilities
run_diffseldsparse
:
cp
t
file
=
let
tmp_tree
=
tmp
//
"myrun.tree"
in
let
tmp_ali
=
tmp
//
"myrun.ali"
in
let
dep_tree
=
(
dep
run_diffseldsparse
)
//
"myrun.tree"
in
...
...
lib/diffseldsparse.mli
View file @
1ece636f
...
...
@@ -14,7 +14,7 @@ val diffseldsparse :
val
posterior_probabilities
:
[
`diffseldsparse
]
directory
->
tex
t
file
cp
t
file
val
readdiffseldsparse
:
[
`diffseldsparse
]
directory
->
...
...
@@ -26,4 +26,4 @@ val check_conv :
val
results
:
[
`readdiffseldsparse
]
directory
->
tex
t
file
cp
t
file
lib/file_formats.ml
View file @
1ece636f
...
...
@@ -5,24 +5,19 @@ class type bimbam = object
method
format
:
[
`bimbam
]
end
class
type
nhx
=
object
inherit
text
method
format
:
[
`nhx
]
end
class
type
newick
=
object
inherit
text
method
format
:
[
`newick
]
end
class
type
phylip
=
object
inherit
text
method
format
:
[
`phylip
]
class
type
nhx
=
object
inherit
newick
method
newick_variant
:
[
`nhx
]
end
class
type
nw
=
object
class
type
phylip
=
object
inherit
text
method
format
:
[
`
nw
]
method
format
:
[
`
phylip
]
end
class
type
diffsel_tree
=
object
...
...
@@ -46,10 +41,23 @@ class type aminoacid_fasta = object
end
class
type
nucleotide_phylip
=
object
inherit
text
method
forma
t
:
[
`Nucleotide
]
inherit
phylip
method
alphabe
t
:
[
`Nucleotide
]
end
class
type
aminoacid_phylip
=
object
inherit
text
method
format
:
[
`Aminoacid
]
inherit
phylip
method
alphabet
:
[
`Aminoacid
]
end
class
type
rds
=
object
inherit
binary_file
method
format
:
[
`rds
]
end
(** Convergence Prediction Table *)
class
type
cpt
=
object
inherit
tsv
method
header
:
[
`Yes
]
method
fields
:
[
`Site_then_scores
]
end
lib/gemma.mli
View file @
1ece636f
...
...
@@ -33,4 +33,4 @@ val univariate_lmm :
univariate_lmm_output
file
val
result_table_of_output
:
aminoacid_fasta
file
->
univariate_lmm_output
file
->
tex
t
file
aminoacid_fasta
file
->
univariate_lmm_output
file
->
cp
t
file
lib/identical.ml
View file @
1ece636f
...
...
@@ -105,5 +105,5 @@ let identical ?(descr="") ~(tree_id:_ file) ~(tree_sc:_ file) ~(faa:aminoacid_fa
]
]
let
results
run_identical
:
tex
t
file
=
let
results
run_identical
:
cp
t
file
=
Workflow
.
select
run_identical
[
"out1.tsv"
]
lib/inhouse_lmm.mli
View file @
1ece636f
...
...
@@ -4,4 +4,4 @@ open File_formats
val
test
:
aminoacid_fasta
file
->
nhx
file
->
tex
t
file
cp
t
file
lib/msd.ml
View file @
1ece636f
...
...
@@ -42,7 +42,7 @@ let msd ?(descr="") ~e ~(faa : aminoacid_fasta file) ~(tree_sc : _ file) : [`msd
];
]
let
results
run_msd
:
tex
t
file
=
let
results
run_msd
:
cp
t
file
=
Workflow
.
shell
~
descr
:
"convergence_detection.parse_msd"
~
img
[
cmd
"python"
[
file_dump
(
string
Scripts
.
parse_output_msd
)
;
...
...
lib/multinomial.ml
View file @
1ece636f
open
Core
open
Bistro
open
Bistro
.
Shell_dsl
open
File_formats
let
multinomial
?
(
descr
=
""
)
~
(
tree_sc
:_
file
)
~
(
faa
:
aminoacid_fasta
file
)
()
:
text
file
=
let
img
=
Env
.
env_py
in
Workflow
.
shell
~
descr
:
(
"calc_multinomial."
^
descr
)
~
img
[
cmd
"python"
[
file_dump
(
string
Scripts
.
calc_multinomial
)
;
opt
"-t"
dep
tree_sc
;
opt
"-a"
dep
faa
;
opt
"-o"
ident
dest
;
]
]
let
%
pworkflow
multinomial_ocaml_implementation
~
meth
~
(
tree_sc
:_
file
)
~
(
faa
:
aminoacid_fasta
file
)
(* : text file *)
=
let
%
pworkflow
multinomial_ocaml_implementation
~
meth
~
(
tree_sc
:_
file
)
~
(
faa
:
aminoacid_fasta
file
)
(* : cpt file *)
=
let
open
Phylogenetics
in
let
open
Phylogenetics_convergence
in
let
module
MT
=
Multinomial_test
in
...
...
@@ -79,7 +67,7 @@ let%pworkflow multinomial_ocaml_implementation ~meth ~(tree_sc:_ file) ~(faa:ami
sprintf
"%d
\t
%f
\t
%f"
(
i
+
1
)
(
1
.
-.
pval
)
lr
)
in
let
header
=
"Sites
\t
1MinusLRT
\t
LikelihoodRatio"
in
let
header
=
"Sites
\t
Multinomial_1mp
\t
Multinomial_
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
...
...
lib/orthomam.ml
View file @
1ece636f
...
...
@@ -3,7 +3,7 @@ open Bistro
open
File_formats
open
Codepitk
let
ensembl