Commit 4c569e33 authored by Philippe Veber's avatar Philippe Veber
Browse files

alistats mode: computation of mean number of residues per column

parent 6bc754e8
......@@ -6,5 +6,6 @@ let () =
"simulation", Pipeline.simulation_command ;
"detection", Pipeline.detection_command ;
"validation", Pipeline.validation_command ;
"alistats", Alistats.command ;
]
|> Command.run
......@@ -8,9 +8,11 @@ type t = {
seqs : string array ;
}
let fmt = Biocaml_ez.Fasta.{ default_fmt with allow_empty_lines = true }
let from_fasta fn =
match
Biocaml_ez.Fasta.with_file fn ~f:(fun _ items ->
Biocaml_ez.Fasta.with_file ~fmt fn ~f:(fun _ items ->
Stream.map items ~f:(fun i -> i.description, i.sequence)
|> Stream.to_array
|> Array.unzip
......
open Core
let main ~alignment () =
match Alignment.from_fasta alignment with
| Ok al ->
let mu, sigma = Alignment.number_of_residues_per_column_stats al in
printf "%f %f\n" mu sigma
| Error (`Msg msg) -> failwith msg
let command =
let open Command.Let_syntax in
Command.basic
~summary:"Computes stats on alignments"
[%map_open
let alignment =
flag "--alignment" (required string) ~doc:"PATH Output directory"
in
main ~alignment
]
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