Back to index

python-biopython  1.60
test_geo.py
Go to the documentation of this file.
00001 """Tests the basic functionality of the GEO parsers.
00002 """
00003 
00004 import os, sys
00005 
00006 import Bio.Geo
00007 
00008 testfiles   = [  'GSE16.txt', 'GSM645.txt', 'GSM691.txt', 'GSM700.txt', 'GSM804.txt'  ]
00009 
00010 #Five additional files from the NCBI to document the GEO SOFT file format
00011 #changes made in 2005.  Note the new table_begin and table_end lines.
00012 testfiles.extend(['soft_ex_affy.txt',
00013                   'soft_ex_affy_chp.txt',
00014                   'soft_ex_dual.txt',
00015                   'soft_ex_family.txt',
00016                   'soft_ex_platform.txt',
00017                   'soft_ex_series.txt'])
00018 
00019 for file in testfiles:
00020     if sys.version_info[0] >= 3:
00021         #Python 3 problem: Can't use utf8 on Tests/Geo/soft_ex_*.txt
00022         #due to micro (\xb5) and degrees (\xb0) symbols
00023         fh = open(os.path.join("Geo", file), encoding="latin")
00024     else:
00025         fh = open(os.path.join("Geo", file))
00026     print "Testing Bio.Geo on " + file + "\n\n"
00027     records = Bio.Geo.parse(fh)
00028     for record in records:
00029         print record
00030     print "\n"
00031 
00032 
00033 
00034 
00035