Permalink
Browse files

Check BiopythonWarning messages in test_SeqIO.py

Partly due to previous commit to the Bio/SeqIO/InsdcIO.py annotation
'too long' warning where I switched it from a generic UserWarning
to a BiopythonWarning, but also a good idea in general I hope.
  • Loading branch information...
1 parent 4b7a6f1 commit e5b65184cb2af08f8789c19c6c6306ac7f25ccbf @peterjc peterjc committed Jan 8, 2013
Showing with 6 additions and 2 deletions.
  1. +4 −1 Tests/output/test_SeqIO
  2. +2 −1 Tests/test_SeqIO.py
View
@@ -2190,7 +2190,7 @@ Testing reading embl format file EMBL/epo_prt_selection.embl
Checking can write/read as 'fastq-solexa' format
Failed: No suitable quality scores found in letter_annotations of SeqRecord (id=CQ797900.1).
Checking can write/read as 'genbank' format
-UserWarning - Annotation 'flavin-adenine-dinucleotide-dependent-d-erythronate-4-phosphate-dehydrogena' too long for line
+BiopythonWarning - Annotation 'flavin-adenine-dinucleotide-dependent-d-erythronate-4-phosphate-dehydrogena' too long for '' line
Checking can write/read as 'imgt' format
Checking can write/read as 'phd' format
Failed: No suitable quality scores found in letter_annotations of SeqRecord (id=CQ797900.1).
@@ -3030,7 +3030,9 @@ Testing reading phd format file Phd/phd1
Checking can write/read as 'embl' format
Checking can write/read as 'fastq' format
Checking can write/read as 'fastq-illumina' format
+BiopythonWarning - Data loss - max PHRED quality 62 in Illumina FASTQ
Checking can write/read as 'fastq-solexa' format
+BiopythonWarning - Data loss - max Solexa quality 62 in Solexa FASTQ
Checking can write/read as 'genbank' format
Failed: Locus identifier '425_7_(71-A03-19).b.ab1' is too long
Checking can write/read as 'imgt' format
@@ -3178,6 +3180,7 @@ Testing reading ace format file Ace/seq.cap.ace
Checking can write/read as 'phylip-relaxed' format
Checking can write/read as 'embl' format
Checking can write/read as 'fastq' format
+BiopythonWarning - Data loss - max PHRED quality 93 in Sanger FASTQ
Checking can write/read as 'fastq-illumina' format
Checking can write/read as 'fastq-solexa' format
Checking can write/read as 'genbank' format
View
@@ -5,6 +5,7 @@
import os
+from Bio import BiopythonWarning
from Bio import SeqIO
from Bio import AlignIO
from Bio.SeqRecord import SeqRecord
@@ -25,7 +26,7 @@
def send_warnings_to_stdout(message, category, filename, lineno,
file=None, line=None):
#TODO - Have Biopython DataLossWarning?
- if category in [UserWarning]:
+ if category in [UserWarning, BiopythonWarning]:
print "%s - %s" % (category.__name__, message)
warnings.showwarning = send_warnings_to_stdout

0 comments on commit e5b6518

Please sign in to comment.