Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Mirrors
backtranslate
Commits
101b034f
Commit
101b034f
authored
Oct 30, 2016
by
Jeroen F.J. Laros
Browse files
Python3 compatibility.
parent
085e8b62
Changes
1
Hide whitespace changes
Inline
Side-by-side
backtranslate/cli.py
View file @
101b034f
...
...
@@ -25,7 +25,7 @@ def with_dna(input_handle, output_handle, offset, position, amino_acid):
:returns set: Variants that lead to the observed amino acid change.
"""
bt
=
BackTranslate
()
reference
=
str
(
SeqIO
.
parse
(
input_handle
,
'fasta'
)
.
next
(
).
seq
)
reference
=
str
(
next
(
SeqIO
.
parse
(
input_handle
,
'fasta'
)).
seq
)
codon_pos
=
offset
-
1
+
(
position
-
1
)
*
3
codon
=
reference
[
codon_pos
:
codon_pos
+
3
]
substitutions
=
bt
.
with_dna
(
codon
,
protein_letters_3to1
[
amino_acid
])
...
...
@@ -72,7 +72,7 @@ def find_stops(input_handle, output_handle, offset, compact):
:arg bool compact: Output one line per position.
"""
bt
=
BackTranslate
()
sequence
=
str
(
SeqIO
.
parse
(
input_handle
,
'fasta'
)
.
next
(
).
seq
)
sequence
=
str
(
next
(
SeqIO
.
parse
(
input_handle
,
'fasta'
)).
seq
)
for
index
,
codon
in
enumerate
(
re
.
findall
(
'...'
,
sequence
[
offset
-
1
:])):
stop_positions
=
bt
.
with_dna
(
codon
,
'*'
)
...
...
Write
Preview
Supports
Markdown
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