Docker-in-Docker (DinD) capabilities of public runners deactivated. More info

Commit 5a2a7780 authored by Philippe Veber's avatar Philippe Veber
Browse files

toolbox/Result_table: handle NA

parent 13812c9c
......@@ -196,6 +196,7 @@ let%workflow recall_precision_auc_table table =
let { RT.oracle ; scores_per_meth } = RT.of_file [%path table] in
let labels = Option.value_exn oracle in
List.map scores_per_meth ~f:(fun (meth, scores) ->
let scores = Array.filter_opt scores in
let _, auc = Biocaml_unix.Bin_pred.recall_precision_curve ~labels ~scores in
meth, auc
)
......
......@@ -536,10 +536,13 @@ let%workflow ranking_of_results ~alignment_ids ~convergent_species (alignments :
end in
let module H = CCHeap.Make(S) in
let add_result_line acc ~alignment ~pos ~score =
let candidate = { S.alignment ; pos ; score } in
let acc = H.add acc candidate in
if H.size acc > ranking_size then H.take_exn acc |> fst
else acc
match score with
| None -> acc
| Some score ->
let candidate = { S.alignment ; pos ; score } in
let acc = H.add acc candidate in
if H.size acc > ranking_size then H.take_exn acc |> fst
else acc
in
let add_result_file alignment acc (rf : Result_table.t Lazy.t) =
let col = List.Assoc.find_exn (Lazy.force rf).scores_per_meth column_label ~equal:String.equal in
......
......@@ -2,7 +2,7 @@ open Core_kernel
type t = {
oracle : bool array option ;
scores_per_meth : (string * float array) list ;
scores_per_meth : (string * float option array) list ;
}
let of_file fn =
......@@ -33,7 +33,11 @@ let of_file fn =
List.filter_map cols ~f:(fun (label, values) ->
if String.(label <> "Oracle" && label <> "Sites") then
let values =
List.map values ~f:Float.of_string
List.map values ~f:(
function
| "NA" -> None
| x -> Some (Float.of_string x)
)
|> Array.of_list
in
Some (label, values)
......
......@@ -2,7 +2,7 @@
type t = {
oracle : bool array option ;
scores_per_meth : (string * float array) list ;
scores_per_meth : (string * float option array) list ;
}
val of_file : string -> t
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment