Commit 2043db3e authored by Philippe Veber's avatar Philippe Veber
Browse files

alignment stat histogram

parent 176b48d5
open Core
open Convdet
let ok_exn err = function
| Ok x -> x
| Error e -> failwith (err e)
let%pworkflow histogram (fa : #Bistro_bioinfo.fasta Bistro.pworkflow) =
let al = ok_exn Alignment.show_parsing_error @@ Alignment.from_fasta [%path fa] in
let float_array_of_int_list x =
Array.of_list x
|> ~f:float
let values, counts =
Alignment.number_of_residues_per_column_stats al
|> List.unzip
OCamlR_grDevices.pdf [%dest] ;
~xlab:"Number of different residues in column"
~x:(float_array_of_int_list values)
~y:(float_array_of_int_list counts) () ;
OCamlR_grDevices.dev_off ()
let main ~alignment () =
match Alignment.from_fasta alignment with
| Ok al ->
(name reviewphiltrans)
(libraries biocaml.ez bistro.bioinfo bistro.utils convdet)
(libraries biocaml.ez bistro.bioinfo bistro.utils convdet ocaml-r.grDevices)
(pps ppx_jane ppx_csv_conv bistro.ppx)))
(pps ppx_jane ppx_csv_conv bistro.ppx ppx_here)))
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