Permalink
Browse files

Avoid warning from partial codon translation

  • Loading branch information...
1 parent 4cf57cc commit 58c2d3b6479e1ea995bde2a74c61df39a2d3f873 @peterjc peterjc committed Mar 23, 2013
Showing with 3 additions and 2 deletions.
  1. +3 −2 Bio/SeqUtils/__init__.py
View
@@ -353,8 +353,9 @@ def six_frame_translations(seq, genetic_code=1):
length = len(seq)
frames = {}
for i in range(0, 3):
- frames[i+1] = translate(seq[i:], genetic_code)
- frames[-(i+1)] = translate(anti[i:], genetic_code)[::-1]
+ fragment_length = 3 * ((length-i) // 3)
+ frames[i+1] = translate(seq[i:i+fragment_length], genetic_code)
+ frames[-(i+1)] = translate(anti[i:i+fragment_length], genetic_code)[::-1]
# create header
if length > 20:

0 comments on commit 58c2d3b

Please sign in to comment.