Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -12,3 +12,4 @@ mouse.protein.faa.psq
petMar_lamp0.fasta
petMar_lamp3.fasta
petMar_mrna.lamp3.orig.fasta.gz
/.project
8 changes: 4 additions & 4 deletions annotate-seqs.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ def main():

o = ortho.get(name)
if o:
annot = namedb.mouse_names.get(transform_name(o, args.ncbi))
annot = namedb.data_names.get(transform_name(o, args.ncbi))
tr_dict[tr] = ('ortho', annot)
else:
if tr in tr_dict and tr_dict[tr][0] == 'ortho':
Expand All @@ -52,7 +52,7 @@ def main():

h, score = h[0]
score = round(float(score) / float(len(record.sequence)) * 100)
annot = namedb.mouse_names[transform_name(h, args.ncbi)]
annot = namedb.data_names[transform_name(h, args.ncbi)]

if score > oldscore:
tr_dict[tr] = (oldscore, annot)
Expand All @@ -76,7 +76,7 @@ def main():

o = ortho.get(name)
if o:
annot = namedb.mouse_names.get(transform_name(o, args.ncbi))
annot = namedb.data_names.get(transform_name(o, args.ncbi))
annot = "ortho:" + annot
annot_ortho_count += 1
else:
Expand All @@ -85,7 +85,7 @@ def main():
if h:
h, score = h[0]
score = round(float(score) / float(len(record.sequence)) * 100)
annot = namedb.mouse_names[transform_name(h, args.ncbi)]
annot = namedb.data_names[transform_name(h, args.ncbi)]
annot = "h=%d%% => " % score + annot
annot += " "
annot_homol_count += 1
Expand Down
13 changes: 8 additions & 5 deletions make-namedb.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,13 @@
import screed
import sys

outfile = sys.argv[2]
# the name-db
outfile = "names.db"
seqFile = sys.argv[1]

d = {}
e = {}
for record in screed.open(sys.argv[1]):
for record in screed.open(seqFile):
if record.name.startswith('gi|'):
ident = record.name.split('|')[3]
else:
Expand All @@ -17,7 +19,8 @@
e[ident] = record.name

fp = open(outfile, 'w')
dump(d, fp)
dump(seqFile, fp)
dump(d,fp)

fp = open(outfile + '.fullname', 'w')
dump(e, fp)
fp = open('fullnames.db', 'w')
dump(e, fp)
6 changes: 3 additions & 3 deletions namedb.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import cPickle
import screed

mouse_names = cPickle.load(open('mouse.namedb'))
mouse_fullname = cPickle.load(open('mouse.namedb.fullname'))
mouse_seqs = screed.ScreedDB('mouse.protein.faa')
data_names = cPickle.load('names.db')
data_fullname = cPickle.load(open('fullnames.db'))
data_seqs = screed.ScreedDB(cPickle.load('names.db'))