Commit 6272890c authored by Louis Duchemin's avatar Louis Duchemin
Browse files

Implements Gemma.min_pvalue_aggregator

parent e7a9f864
......@@ -73,12 +73,8 @@ let calculate_relatedness_matrix ~mode ~genotype ~phenotype =
let%pworkflow[@version 3] result_table_of_output gemma_output =
let module R = Reviewphiltrans_toolbox.Gemma.Result_file in
let open Phylogenetics in
match R.of_file [%path gemma_output] with
| Error msg -> failwith msg
| Ok result_file ->
R.to_result_table result_file ~site_aggregator:(fun items ->
List1.to_list items
|> List.map ~f:R.min_pval_of_item
|> List.reduce_exn ~f:Float.min)
R.to_result_table result_file ~site_aggregator:R.min_pvalue_aggregator
|> Reviewphiltrans_toolbox.Result_table.to_file ~output:[%dest]
......@@ -147,4 +147,10 @@ module Result_file = struct
|> Array.of_list
in
{ Result_table.oracle = None; scores_per_meth = [ ("Gemma", scores) ] }
let min_pvalue_aggregator xs =
List1.to_list xs
|> List.map ~f:min_pval_of_item
|> List.reduce_exn ~f:Float.min
end
......@@ -21,4 +21,6 @@ module Result_file : sig
val to_result_table :
t -> site_aggregator:(item List1.t -> float) -> Result_table.t
val min_pvalue_aggregator : item List1.t -> float
end
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