Mercurial > repos > davidvanzessen > mutation_analysis
comparison gene_identification.py @ 64:0fdd90f7c654 draft
Uploaded
author | davidvanzessen |
---|---|
date | Fri, 01 Apr 2016 08:54:24 -0400 |
parents | 4262e880472d |
children | b869a126e2c4 |
comparison
equal
deleted
inserted
replaced
63:a7381fd96dad | 64:0fdd90f7c654 |
---|---|
23 seqIndex = 0 | 23 seqIndex = 0 |
24 | 24 |
25 with open(infile, 'r') as f: #read all sequences into a dictionary as key = ID, value = sequence | 25 with open(infile, 'r') as f: #read all sequences into a dictionary as key = ID, value = sequence |
26 for line in f: | 26 for line in f: |
27 total += 1 | 27 total += 1 |
28 linesplt = line.split("\t") | |
28 if first: | 29 if first: |
29 linesplt = line.split("\t") | 30 print "linesplt", linesplt |
30 IDIndex = linesplt.index("Sequence ID") | 31 IDIndex = linesplt.index("Sequence ID") |
31 seqIndex = linesplt.index("Sequence") | 32 seqIndex = linesplt.index("Sequence") |
32 first = False | 33 first = False |
33 continue | 34 continue |
34 linesplt = line.split("\t") | 35 |
35 ID = linesplt[IDIndex] | 36 ID = linesplt[IDIndex] |
36 if len(linesplt) < 28: #weird rows without a sequence | 37 if len(linesplt) < 28: #weird rows without a sequence |
37 dic[ID] = "" | 38 dic[ID] = "" |
38 else: | 39 else: |
39 dic[ID] = linesplt[seqIndex] | 40 dic[ID] = linesplt[seqIndex] |