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

use custom ocaml workflow for nucleotide sequence translation

instead of bppseqman, because it's slow to invoke a container for such
a fast operation.
parent 22663c89
......@@ -44,7 +44,7 @@ module Make(Q : Query) = struct
open Q
let amino_acid_alignment d =
Bppsuite.fna2faa (nucleotide_alignment d)
Utils.amino_acid_fasta_of_nucleotide_fasta (nucleotide_alignment d)
let phylip_nucleotide_alignment d =
Bppsuite.fna2phy ~fna:(nucleotide_alignment d)
......
open Core_kernel
open Bistro
open Bistro.Shell_dsl
open Biotope.Formats
open File_formats
let assign k v =
seq ~sep:"=" [ string k ; v ]
......@@ -68,3 +68,17 @@ let%pworkflow [@version 2] newick_of_nhx (t : nhx file) : newick file =
let tree = Newick.from_file tree_file in
let tree = Newick.map_inner_tree tree ~f:(Tree.map ~leaf:Fn.id ~node:Fn.id ~branch:(fun bi -> { bi with Newick.tags = [] })) in
Newick.to_file tree [%dest]
let%pworkflow amino_acid_fasta_of_nucleotide_fasta (fa : nucleotide_fasta file) =
let fa = [%path fa] in
match Biotk.Fasta.from_file fa with
| Error e -> failwith e
| Ok (_, items) ->
List.map items ~f:(fun it ->
let sequence =
it.sequence
|> Reviewphiltrans_toolbox.Utils.translate_nucleotide_sequence_whatever_it_takes
in
{ it with Biotk.Fasta.sequence }
)
|> Biotk.Fasta.to_file [%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