Skip to content

Commit 8e1a21b

Browse files
author
Jon Palmer
committed
fix for #193
1 parent 574d271 commit 8e1a21b

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

lib/library.py

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1752,6 +1752,8 @@ def updateTBL(input, annotDict, output):
17521752
with open(input, 'rU') as infile:
17531753
with open(output, 'w') as outfile:
17541754
for gene in readBlocks2(infile, '>Feature', '\tgene\n'):
1755+
transcriptsSeen = []
1756+
#transcriptNum = 0
17551757
if gene[0].startswith('>Feature'):
17561758
outfile.write(''.join(gene))
17571759
else:
@@ -1780,7 +1782,11 @@ def updateTBL(input, annotDict, output):
17801782
elif line.startswith('\t\t\ttranscript_id\t'):
17811783
ID = line.split('|')[-1]
17821784
ID = ID.split('_mrna')[0]
1783-
transcriptNum = int(ID.split('-T')[-1])
1785+
#transcriptNum = int(ID.split('-T')[-1])
1786+
#transcriptNum += 1
1787+
if not ID in transcriptsSeen:
1788+
transcriptsSeen.append(ID)
1789+
transcriptNum = len(transcriptsSeen)
17841790
if ID in annotDict:
17851791
transcriptAnnot = annotDict.get(ID)
17861792
if 'product' in geneAnnot:

0 commit comments

Comments
 (0)