File: test_cdd.py

package info (click to toggle)
python-biopython 1.45-3
  • links: PTS, VCS
  • area: main
  • in suites: lenny
  • size: 18,192 kB
  • ctags: 12,310
  • sloc: python: 83,505; xml: 13,834; ansic: 7,015; cpp: 1,855; sql: 1,144; makefile: 179
file content (30 lines) | stat: -rw-r--r-- 774 bytes parent folder | download | duplicates (3)
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
"""Tests the basic functionality of the CDD parsers.
"""

import os
import sys

import Bio.CDD
from Bio.FilteredReader import FilteredReader
from Bio.FilteredReader import remove_empty_line
from Bio.FilteredReader import remove_leading_whitespace
from Bio.SGMLExtractor import SGMLExtractorHandle

testfiles   = [  'pfam00035', 'pfam01356', 'pfam02903', 'smart00499', 'smart00505' ]
for file in testfiles:
    fh = open(os.path.join("CDD", file + '.htm' ))
    print "Testing Bio.CDD on " + file + "\n\n"
    records = Bio.CDD.Iterator( fh, Bio.CDD.RecordParser(debug_level=0))
#    records = Bio.CDD.Iterator( fh, None)
    while 1:
        record = records.next()
        if record is not None:
            print record
        else:
            break
    print "\n"