Permalink
Browse files

Make the new warning fixed text for ease of filtering.

Old version include the sequence length, making a simple
filter based on the message and warning type impossible.
  • Loading branch information...
1 parent 668b9a4 commit 69ac245fea6220e3dac3c1098dd5f2c8d9f9d5bf @peterjc peterjc committed Mar 23, 2013
Showing with 3 additions and 1 deletion.
  1. +3 −1 Bio/Seq.py
View
@@ -1958,7 +1958,9 @@ def _translate_str(sequence, table, stop_symbol="*", to_stop=False,
elif n % 3 != 0:
import warnings
from Bio import BiopythonWarning
- warnings.warn("Sequence length %i is not a multiple of three" % n,
+ warnings.warn("Partial codon, len(sequence) not a multiple of three. "
+ "Explicitly trim the sequence or add trailing N before "
+ "translation. This may become an error in future.",
BiopythonWarning)
for i in xrange(0, n-n%3, 3):
codon = sequence[i:i+3]

0 comments on commit 69ac245

Please sign in to comment.