File: test_geo.py

package info (click to toggle)
python-biopython 1.64%2Bdfsg-5
  • links: PTS, VCS
  • area: main
  • in suites: jessie, jessie-kfreebsd
  • size: 44,416 kB
  • ctags: 12,472
  • sloc: python: 153,759; xml: 67,286; ansic: 9,003; sql: 1,488; makefile: 144; sh: 59
file content (39 lines) | stat: -rw-r--r-- 1,235 bytes parent folder | download
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
# 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.
#

"""Tests the basic functionality of the GEO parsers.
"""

from __future__ import print_function

import os
import sys

import Bio.Geo

testfiles = ['GSE16.txt', 'GSM645.txt', 'GSM691.txt', 'GSM700.txt', 'GSM804.txt']

#Five additional files from the NCBI to document the GEO SOFT file format
#changes made in 2005.  Note the new table_begin and table_end lines.
testfiles.extend(['soft_ex_affy.txt',
                  'soft_ex_affy_chp.txt',
                  'soft_ex_dual.txt',
                  'soft_ex_family.txt',
                  'soft_ex_platform.txt',
                  'soft_ex_series.txt'])

for file in testfiles:
    if sys.version_info[0] >= 3:
        #Python 3 problem: Can't use utf8 on Tests/Geo/soft_ex_*.txt
        #due to micro (\xb5) and degrees (\xb0) symbols
        fh = open(os.path.join("Geo", file), encoding="latin")
    else:
        fh = open(os.path.join("Geo", file))
    print("Testing Bio.Geo on " + file + "\n\n")
    records = Bio.Geo.parse(fh)
    for record in records:
        print(record)
    print("\n")
    fh.close()