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

toolbox/Utils.translate_nucleotide_sequence_whatever_it_takes: more failsafe

parent e2e6fa7b
......@@ -26,7 +26,7 @@ let int_for_all a b ~f =
in
loop a
let translate_nucleotide_sequence_whatever_it_takes ?(unknown_char = 'X') seq =
let translate_nucleotide_sequence_whatever_it_takes ?(unknown_char = '-') seq =
let open Phylogenetics in
let has_some_gaps s = String.exists s ~f:(Char.( = ) '-') in
let n = String.length seq in
......@@ -40,7 +40,5 @@ let translate_nucleotide_sequence_whatever_it_takes ?(unknown_char = 'X') seq =
)
| None ->
if has_some_gaps subseq then '-'
else if String.exists subseq ~f:(Char.( = ) 'N') then unknown_char
else
failwithf "Sequence %s cannot be converted to aminoacid sequence because it contains %s" seq subseq ()
else unknown_char
)
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