public
Description: repository for the code featured in the blog
Homepage: http://python.genedrift.org
Clone URL: git://github.com/nuin/beginning-python-for-bioinformatics.git
100755 18 lines (15 sloc) 0.361 kb
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
import sys
 
gbfile = open(sys.argv[1], 'r').readlines()
 
locus = ''
organism = ''
accession = ''
for line in gbfile:
    if line.find('LOCUS') >= 0:
        locus = line
    elif line.find('ACCESSION') >= 0:
        accession = line
    elif line.find('ORGANISM') >= 0:
        organism = line
 
print locus.strip()
print organism.strip()
print accession.strip()