Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Open sidebar
VEBER Philippe
codepi
Commits
83620548
Commit
83620548
authored
May 09, 2020
by
Philippe Veber
Browse files
toolbox/Utils.translate_nucleotide_sequence_whatever_it_takes: more failsafe
parent
e2e6fa7b
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
2 additions
and
4 deletions
+2
-4
lib/toolbox/utils.ml
lib/toolbox/utils.ml
+2
-4
No files found.
lib/toolbox/utils.ml
View file @
83620548
...
@@ -26,7 +26,7 @@ let int_for_all a b ~f =
...
@@ -26,7 +26,7 @@ let int_for_all a b ~f =
in
in
loop
a
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
open
Phylogenetics
in
let
has_some_gaps
s
=
String
.
exists
s
~
f
:
(
Char
.(
=
)
'
-
'
)
in
let
has_some_gaps
s
=
String
.
exists
s
~
f
:
(
Char
.(
=
)
'
-
'
)
in
let
n
=
String
.
length
seq
in
let
n
=
String
.
length
seq
in
...
@@ -40,7 +40,5 @@ let translate_nucleotide_sequence_whatever_it_takes ?(unknown_char = 'X') seq =
...
@@ -40,7 +40,5 @@ let translate_nucleotide_sequence_whatever_it_takes ?(unknown_char = 'X') seq =
)
)
|
None
->
|
None
->
if
has_some_gaps
subseq
then
'
-
'
if
has_some_gaps
subseq
then
'
-
'
else
if
String
.
exists
subseq
~
f
:
(
Char
.(
=
)
'
N'
)
then
unknown_char
else
unknown_char
else
failwithf
"Sequence %s cannot be converted to aminoacid sequence because it contains %s"
seq
subseq
()
)
)
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment