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

utils: added utility to concat Fasta horizontally

parent 0d244e52
......@@ -16,3 +16,15 @@ let bash_script args code =
let script_dump xs =
file_dump (string (String.concat ~sep:"\n" xs))
let%pworkflow fasta_cappend fa1 fa2 =
let read fn =
Biocaml_ez.Fasta.with_file fn ~f:(fun _ -> CFStream.Stream.to_list)
in
let fa1 = read [%path fa1] in
let fa2 = read [%path fa2] in
List.map2_exn fa1 fa2 ~f:(fun it1 it2 ->
(it1.description, it1.sequence ^ it2.sequence)
)
|> List.map ~f:(fun (d, s) -> sprintf ">%s\n%s" d s)
|> Out_channel.write_lines [%dest]
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