1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61
|
# Copyright 1999 by Jeffrey Chang. All rights reserved.
# This code is part of the Biopython distribution and governed by its
# license. Please see the LICENSE file that should have been included
# as part of this package.
import os
from Bio import ParserSupport
from Bio.Blast import NCBIWWW
# Biopython 1.40
# blast is deprecated now, and qblast only works for program=blastp or program=blastn
# Therefore, we only have two tests.
# all_tests = [
# 'bt019', 'bt020', 'bt021', 'bt022', 'bt023',
# 'bt024', 'bt025', 'bt026', 'bt027', 'bt028',
# 'bt029', 'bt030', 'bt031', 'bt032', 'bt033',
# 'bt034', 'bt035', 'bt036', 'bt037', 'bt038',
# 'bt061', 'bt064', 'bt066', 'bt069', 'bt070'
# ]
all_tests = ['bt100', 'bt101']
# In order to keep the output file sizes reasonable, only generate
# a bunch of output for a few of the tests.
#detailed_tests = [
# 'bt019', # 2.0.10 blastp
# 'bt023', # 2.0.10 blastp master-slave
# 'bt026', # 2.0.10 blastn
# 'bt028', # 2.0.10 blastx
# 'bt030', # 2.0.10 tblastn
# 'bt032', # 2.0.10 tblastx
# ]
detailed_tests = ['bt100', # blastn
'bt101'] # blastp
### _Scanner
print "Running tests on _Scanner"
scanner = NCBIWWW._Scanner()
for test in all_tests:
print "*" * 50, "TESTING %s" % test
datafile = os.path.join("Blast", test)
scanner.feed(open(datafile), ParserSupport.AbstractConsumer())
for test in detailed_tests:
print "*" * 50, "TESTING %s" % test
datafile = os.path.join("Blast", test)
scanner.feed(open(datafile), ParserSupport.TaggingConsumer())
### BlastParser
print "Running tests on BlastParser"
parser = NCBIWWW.BlastParser()
for test in all_tests:
print "*" * 50, "TESTING %s" % test
datafile = os.path.join("Blast", test)
rec = parser.parse(open(datafile))
# XXX should check this more thoroughly
|