Commit c930a6f6 authored by Philippe Veber's avatar Philippe Veber
Browse files

Alistats: nucleotide fasta GC computation

parent e32b8ace
......@@ -24,6 +24,18 @@ let%pworkflow histogram (fa : #Bistro_bioinfo.fasta Bistro.pworkflow) =
~y:(float_array_of_int_list counts) () ;
OCamlR_grDevices.dev_off ()
let nucleotide_fasta_gc fa =
match Alignment.from_fasta fa with
| Ok al ->
let comp = Alignment.composition al in
let f c = match List.Assoc.find comp c ~equal:Char.equal with
| Some x -> x
| None -> 0.
in
f 'G' +. f 'g' +. f 'c' +. f 'C'
| Error `Fasta_parser_error _ -> failwith "parsing error"
| Error `Msg msg -> failwith msg
let main ~alignment () =
match Alignment.from_fasta alignment with
| Ok al ->
......
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