Commit 82c33888 authored by Louis Duchemin's avatar Louis Duchemin
Browse files

Implements Gemma output to Result_table workflow

parent 868cfd29
......@@ -31,6 +31,13 @@ let%pworkflow phenotype_of_tree nhx =
let template_of_lmm lmm =
int (match lmm with `Wald -> 1 | `LRT -> 2 | `Score -> 3 | `All -> 4)
class type univariate_lmm_output =
object
inherit tsv
method format : [ `gemma_test_output ]
end
let univariate_lmm ~lmm ~genotype ~phenotype ~relatedness_matrix =
Workflow.shell ~descr:"gemma.univariate_lmm"
[
......@@ -63,3 +70,15 @@ let calculate_relatedness_matrix ~mode ~genotype ~phenotype =
];
cmd "cp" [ tmp // relatedness_filename mode; dest ];
]
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)
|> Reviewphiltrans_toolbox.Result_table.to_file ~output:[%dest]
......@@ -18,10 +18,20 @@ val calculate_relatedness_matrix :
phenotype:bimbam file ->
relatedness_matrix file
class type univariate_lmm_output =
object
inherit tsv
method format : [ `gemma_test_output ]
end
val univariate_lmm :
lmm:[ `Wald | `LRT | `Score | `All ] ->
genotype:bimbam file ->
phenotype:bimbam file ->
relatedness_matrix:relatedness_matrix file ->
text file
univariate_lmm_output file
val result_table_of_output :
univariate_lmm_output file ->
text file
\ No newline at end of file
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