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
1894f40b
Commit
1894f40b
authored
May 01, 2019
by
Philippe Veber
Browse files
reimplemented RP curves
parent
792657df
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
36 additions
and
0 deletions
+36
-0
lib/pipeline2.ml
lib/pipeline2.ml
+8
-0
lib/utils.ml
lib/utils.ml
+28
-0
No files found.
lib/pipeline2.ml
View file @
1894f40b
...
...
@@ -185,6 +185,14 @@ let oracle d =
in
Convergence_detection
.
oracle
~
n_h0
~
n_ha
let
multinomial_benchmark
d
=
Utils
.
rp_curve
~
oracle
:
(
oracle
d
)
~
labels
:
[
|
"LRT"
|
]
~
results
:
[
multinomial_asymptotic_lrt
d
;
]
let
benchmark
d
=
Convergence_detection
.
merge_result_tables
~
multinomial
:
(
multinomial
d
)
...
...
lib/utils.ml
View file @
1894f40b
...
...
@@ -30,3 +30,31 @@ let%pworkflow fasta_cappend fa1 fa2 =
)
|>
List
.
map
~
f
:
(
fun
(
d
,
s
)
->
sprintf
">%s
\n
%s"
d
s
)
|>
Out_channel
.
write_lines
[
%
dest
]
let
%
pworkflow
rp_curve
~
labels
~
oracle
~
results
:
Bistro
.
pdf
Bistro
.
pworkflow
=
let
n
=
Array
.
length
labels
in
let
colors
=
Array
.
sub
[
|
"blue"
;
"green"
;
"red"
;
"tan1"
;
"royalblue4"
;
"darkorchid"
|
]
~
pos
:
0
~
len
:
n
in
let
labels
=
[
%
param
labels
]
in
let
load_results
fn
=
let
open
Owl
.
Dataframe
in
match
get_col
(
of_csv
~
sep
:
'\t'
fn
)
1
with
|
Float_Series
xs
->
xs
|
Int_Series
xs
->
Array
.
map
xs
~
f
:
Float
.
of_int
|
_
->
assert
false
in
let
oracle
=
load_results
[
%
path
oracle
]
|>
Array
.
map
~
f
:
((
<>
)
0
.
)
in
let
results
=
List
.
map
~
f
:
load_results
[
%
eval
Bistro
.
Workflow
.
eval_paths
results
]
in
let
result_curves
=
List
.
map
results
~
f
:
(
fun
scores
->
Biocaml_unix
.
Bin_pred
.
rp_curve
~
scores
~
labels
:
oracle
|>
Array
.
unzip
)
in
OCamlR_grDevices
.
pdf
[
%
dest
]
;
OCamlR_graphics
.
plot
~
xlab
:
"Recall"
~
ylab
:
"Precision"
~
xlim
:
(
0
.,
1
.
)
~
ylim
:
(
0
.,
1
.
)
~
x
:
[
||
]
~
y
:
[
||
]
()
;
List
.
iteri
result_curves
~
f
:
(
fun
i
(
x
,
y
)
->
OCamlR_graphics
.
lines
~
col
:
colors
.
(
i
)
~
x
~
y
()
)
;
OCamlR_graphics
.
legend
~
pch
:
[
|
19
|
]
~
col
:
colors
`bottomleft
labels
;
OCamlR_grDevices
.
dev_off
()
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