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
eb0e6316
Commit
eb0e6316
authored
Nov 09, 2020
by
Philippe Veber
Browse files
RP curve: allow to choose column in result file
parent
702df100
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
25 additions
and
23 deletions
+25
-23
app/lmm_benchmark.ml
app/lmm_benchmark.ml
+10
-9
lib/simulation_dataset.ml
lib/simulation_dataset.ml
+9
-9
lib/utils.ml
lib/utils.ml
+6
-5
No files found.
app/lmm_benchmark.ml
View file @
eb0e6316
...
...
@@ -4,23 +4,24 @@ let benchmark d =
let
open
Simulation_dataset
in
Utils
.
recall_precision_curve
~
oracle
:
(
oracle
d
)
~
labels
:
[
|
"topological"
;
"multinomial"
;
"gemma_score"
;
"inhouse"
;
"tdg09"
|
]
~
labels
:
[
|
"topological"
;
"multinomial"
;
"gemma_score"
;
"inhouse"
;
"pcoc"
;
(* "pcocv2" ; *)
"tdg09"
|
]
~
results
:
[
topological
d
;
multinomial_asymptotic_lrt
d
;
gemma
~
lmm_test
:
`Score
~
relatedness_mode
:
`Standardized
d
;
inhouse_lmm
d
;
tdg09
d
;
topological
d
,
1
;
multinomial_asymptotic_lrt
d
,
1
;
gemma
~
lmm_test
:
`Score
~
relatedness_mode
:
`Standardized
d
,
1
;
inhouse_lmm
d
,
1
;
pcoc
d
,
3
;
(* pcoc_v2 d ; *)
tdg09
d
,
1
;
]
let
()
=
let
sim
=
let
open
Simulation_dataset
in
convdet_simulation
(* ~tree:(NHX "example/trees4analyses_db/cyp_coding.Chrysithr_root.nhx") *)
~
tree
:
(
NHX
"example/trees_test/orthomam_rooted.nhx"
)
~
tree
:
(
NHX
"data/besnard2009/besnard2009.nhx"
)
~
profiles
:
"example/aa_fitness/263SelectedProfiles.tsv"
~
n_h0
:
900
~
n_ha
:
100
~
ne_s
:
(
2
.,
2
.
)
()
~
n_h0
:
900
~
n_ha
:
100
~
branch_scale
:
3
.
~
ne_s
:
(
2
.,
2
.
)
()
in
let
w
=
benchmark
sim
in
let
loggers
=
[
Bistro_utils
.
Console_logger
.
create
()
]
in
...
...
lib/simulation_dataset.ml
View file @
eb0e6316
...
...
@@ -164,10 +164,10 @@ let multinomial_benchmark d =
~
oracle
:
(
oracle
d
)
~
labels
:
[
|
"LRT"
;
"LRTsim"
;
"sparse"
;
"sparse_sim"
|
]
~
results
:
[
multinomial_asymptotic_lrt
d
;
multinomial_simulation_lrt
d
;
multinomial_asymptotic_sparse
d
;
multinomial_simulation_sparse
d
;
multinomial_asymptotic_lrt
d
,
1
;
multinomial_simulation_lrt
d
,
1
;
multinomial_asymptotic_sparse
d
,
1
;
multinomial_simulation_sparse
d
,
1
;
]
...
...
@@ -199,11 +199,11 @@ let benchmark2 d =
~
oracle
:
(
oracle
d
)
~
labels
:
[
|
"identical"
;
"topological"
;
"multinomial"
;
"pcoc"
;
"tdg09"
|
]
~
results
:
[
identical
d
;
topological
d
;
multinomial_asymptotic_lrt
d
;
pcoc
d
;
tdg09
d
;
identical
d
,
1
;
topological
d
,
1
;
multinomial_asymptotic_lrt
d
,
1
;
pcoc
d
,
3
;
tdg09
d
,
1
;
]
(* param exploration for SMBE paper *)
...
...
lib/utils.ml
View file @
eb0e6316
...
...
@@ -37,11 +37,11 @@ let%pworkflow recall_precision_curve ~labels ~oracle ~results : pdf file =
let
open
Codepitk
in
let
n
=
Array
.
length
labels
in
assert
(
n
=
List
.
length
results
)
;
let
colors
=
Array
.
sub
[
|
"blue"
;
"green"
;
"red"
;
"tan1"
;
"royalblue4"
;
"darkorchid"
|
]
~
pos
:
0
~
len
:
n
in
let
colors
=
Array
.
sub
[
|
"blue"
;
"green"
;
"red"
;
"tan1"
;
"royalblue4"
;
"darkorchid"
;
"yellow"
|
]
~
pos
:
0
~
len
:
n
in
let
labels
=
[
%
param
labels
]
in
let
load_results
fn
=
let
load_results
fn
col
=
let
df
=
Dataframe
.
from_file
fn
|>
Rresult
.
R
.
failwith_error_msg
in
match
Dataframe
.
get_col
df
1
with
match
Dataframe
.
get_col
df
col
with
|
Some
(
Floats
xs
)
->
Array
.
map
xs
~
f
:
Option
.
some
|
Some
(
Float_opts
xs
)
->
xs
|
Some
(
Ints
xs
)
->
Array
.
map
xs
~
f
:
(
fun
i
->
Some
(
Float
.
of_int
i
))
...
...
@@ -49,10 +49,11 @@ let%pworkflow recall_precision_curve ~labels ~oracle ~results : pdf file =
|
_
->
failwith
"expected a numeric column at pos 1"
in
let
oracle
=
load_results
[
%
path
oracle
]
load_results
[
%
path
oracle
]
1
|>
Array
.
map
~
f
:
(
Option
.
map
~
f
:
Float
.((
<>
)
0
.
))
in
let
results
=
List
.
map
~
f
:
load_results
[
%
eval
Bistro
.
Workflow
.
path_list
results
]
in
let
result_paths
=
[
%
eval
Bistro
.
Workflow
.
path_list
(
List
.
map
~
f
:
fst
results
)]
in
let
results
=
List
.
map2_exn
result_paths
(
List
.
map
~
f
:
snd
results
)
~
f
:
load_results
in
let
filter_table
x
y
=
Array
.
filter_mapi
x
~
f
:
(
fun
i
x_i
->
match
x_i
,
y
.
(
i
)
with
...
...
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