File: test_UniGene.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 (34 lines) | stat: -rw-r--r-- 1,064 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
from Bio import UniGene

#Start of the UniGene file for Monodelphis domestica downloaded from:
#ftp://ftp.ncbi.nih.gov/repository/UniGene/Monodelphis_domestica
handle = open("UniGene/Mdm_partial.data")

ugparser = UniGene.Iterator(handle, UniGene.RecordParser())
for record in ugparser:
    assert isinstance(record.ID, str)
    assert isinstance(record.title, str)
    assert isinstance(record.species, str)
    assert isinstance(record.express, list)
    assert isinstance(record.sequence, list)

    print record.ID
    print "Title: '%s'" % record.title
    print "Expressed:", record.express
    print "Chromosome:", record.chromosome
    if record.sequence :
        print "Sequences:"
        for s in record.sequence :
            assert isinstance(s, UniGene.UnigeneSequenceRecord)
            print s
    else :
        print "No sequences"
            
    assert record.species == "Mdm"
    #Should be no PROTSIM lines in this file!
    assert isinstance(record.protsim, list)
    assert len(record.protsim) == 0

    print
print "Done"
handle.close()