File: test_UniGene_obsolete.py

package info (click to toggle)
python-biopython 1.54-1
  • links: PTS, VCS
  • area: main
  • in suites: squeeze
  • size: 25,400 kB
  • ctags: 10,975
  • sloc: python: 116,757; xml: 33,167; ansic: 8,622; sql: 1,488; makefile: 147
file content (38 lines) | stat: -rw-r--r-- 1,230 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
# 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.

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()