I am having trouble looking up sequence intervals in NLMSAs, using
pygr 0.7.1. I am creating SeqPaths by blasting a BlastDB, and pickling
these objects. Then, when I use them later for indexing into an NLMSA
created with the same BlastDB, I get <type 'exceptions.KeyError'>:
'seq not in PrefixUnionDict'. I'm not even really sure how to track
down the cause of this problem. As far as I can tell, the problem is
with the getName() method of the NLMSA's seqDict and the path.db of
the SeqPath object. If I re-create the SeqPath, then it works fine
(seen in 56-58 below). Here's the events that lead me to this belief,
not sure what the corrective action is though.
In [52]: c.sequence
Out[52]: chr7[2350:2366]
In [53]: trna = pygr.Data.getResource
("Bio.Annotation.YEAST.sacCer.SGD_features.tRNA")
In [54]: c.sequence.path.db
Out[54]:
{'chr1': chr1[0:230208],
'chr10': chr10[0:745742],
'chr11': chr11[0:666454],
'chr12': chr12[0:1078175],
'chr13': chr13[0:924429],
'chr14': chr14[0:784333],
'chr15': chr15[0:1091289],
'chr16': chr16[0:948062],
'chr17': chr17[0:85779],
'chr2': chr2[0:813178],
'chr3': chr3[0:316617],
'chr4': chr4[0:1531919],
'chr5': chr5[0:576869],
'chr6': chr6[0:270148],
'chr7': chr7[0:1090947],
'chr8': chr8[0:562643],
'chr9': chr9[0:439885]}
In [55]: trna.seqDict.getName(c.sequence)
---------------------------------------------------------------------------
<type 'exceptions.KeyError'> Traceback (most recent call
last)
/home/baldig/projects/genomics/nonsvn/results/yeast/Ty3/BLAST/20090122/
clustering/20090122/<ipython console> in <module>()
/home/dock/shared_libraries/lx64/pythonpkgs/2.5.1/pygr_0_7_1/pygr/
seqdb.py in getName(self, path)
1414 "return fully qualified ID i.e. 'foo.bar'"
1415 path=path.pathForward
-> 1416 return self.dicts[path.db]+self.separator+path.id
1417
1418 def newMemberDict(self,**kwargs):
<type 'exceptions.KeyError'>: {'chr7': chr7[0:1090947], 'chr6': chr6
[0:270148], 'chr5': chr5[0:576869], 'chr4': chr4[0:1531919], 'chr3':
chr3[0:316617], 'chr2': chr2[0:813178], 'chr1': chr1[0:230208],
'chr9': chr9[0:439885], 'chr8': chr8[0:562643], 'chr13': chr13
[0:924429], 'chr12': chr12[0:1078175], 'chr11': chr11[0:666454],
'chr10': chr10[0:745742], 'chr17': chr17[0:85779], 'chr16': chr16
[0:948062], 'chr15': chr15[0:1091289], 'chr14': chr14[0:784333]}
In [56]: genome = b.pygr.Data.getResource
("Bio.Seq.Genome.YEAST.sacCer")
In [57]: s = genome[c.sequence.id][c.sequence.start:c.sequence.stop]
In [58]: trna.seqDict.getName(s)
Out[58]: 'sacCer.chr7'
In [59]: type(c.sequence)
Out[59]: <class 'pygr.seqdb.SeqDBSlice'>
In [60]: type(s)
Out[60]: <class 'pygr.seqdb.SeqDBSlice'>
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"pygr-dev" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/pygr-dev?hl=en
-~----------~----~----~----~------~----~------~--~---