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
|> Array.map ~f:float
in
let values, counts =
Alignment.number_of_residues_per_column_stats al
|> List.unzip
in
OCamlR_grDevices.pdf [%dest] ;
OCamlR_graphics.plot
~plot_type:`Histogram
~xlab:"Number of different residues in column"
~ylab:"Counts"
~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 ->
......
(library
(name reviewphiltrans)
(libraries biocaml.ez bistro.bioinfo bistro.utils convdet)
(libraries biocaml.ez bistro.bioinfo bistro.utils convdet ocaml-r.graphics ocaml-r.grDevices)
(preprocess
(pps ppx_jane ppx_csv_conv bistro.ppx)))
(pps ppx_jane ppx_csv_conv bistro.ppx ppx_here)))
(rule
(targets scripts.ml)
......
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