[pygr-notify] Issue 116 in pygr: schema binding gives an integer key error

codesite-noreply at google.com codesite-noreply at google.com
Mon Sep 7 06:21:59 PDT 2009


Status: New
Owner: pygr-bug... at googlegroups.com
Labels: Type-Defect Priority-Low

New issue 116 by deepreds: schema binding gives an integer key error
http://code.google.com/p/pygr/issues/detail?id=116

1. create directory "ucsc1"
2. get refGene.txt.gz at  
http://hgdownload.cse.ucsc.edu/goldenPath/hg18/database/ and save
into "ucsc1"
3. modify hg18 SequenceFileDB path in make_test.py (attached script)
4. run make_test.py in current directory (not "ucsc1" directory)

As far as I know, if we call attribute bound to SequenceFileDB (slice1.tu,  
bindAttrs = ('tu',)), it will
retrieve all annotations. it gives integer key error.

>>> import os
>>> os.environ['WORLDBASEPATH'] = '.'
>>> from pygr import worldbase
>>> worldbase.dir()
['0root', '0version', 'Bio.Annotation.UCSC.refGene.HUMAN.hg18.tus',
'Bio.MSA.UCSC.refGene.HUMAN.hg18.tus', 'Bio.Seq.Genome.HUMAN.hg18',
'SCHEMA.Bio.Annotation.UCSC.refGene.HUMAN.hg18.tus',
'SCHEMA.Bio.Seq.Genome.HUMAN.hg18',
'__doc__.Bio.Annotation.UCSC.refGene.HUMAN.hg18.tus',
'__doc__.Bio.MSA.UCSC.refGene.HUMAN.hg18.tus', '__doc__.Bio.Seq.Genome.HUMAN.hg18']
>>> hg18 = worldbase.Bio.Seq.Genome.HUMAN.hg18()
>>> tus = worldbase.Bio.Annotation.UCSC.refGene.HUMAN.hg18.tus()
>>> msa = worldbase.Bio.MSA.UCSC.refGene.HUMAN.hg18.tus()
>>> slice1 = hg18['chrY'][:500000]
>>> edges = msa[slice1].edges()
>>> len(edges)
4
>>> edges
[(chrY[138060:160020], annot31862[0:21960], <pygr.sequence.Seq2SeqEdge  
object at
0x9ec4d0>), (chrY[161425:170887], -annot16267[0:9462],  
<pygr.sequence.Seq2SeqEdge
object at 0x9ec750>), (chrY[214969:222590], -annot2893[0:7621],
<pygr.sequence.Seq2SeqEdge object at 0x9ec810>), (chrY[214969:267627], -
annot3680[0:52658], <pygr.sequence.Seq2SeqEdge object at 0x9ec850>)]
>>> tus[31862]
annot31862[0:21960]
>>> slice1.tu
Traceback (most recent call last):
   File "<stdin>", line 1, in <module>
   File "/data/server/pygr/build/lib.linux-x86_64-2.5/pygr/metabase.py",  
line 61, in __get__
     result=targetDict[obj] # NOW PERFORM MAPPING IN THAT RESOURCE...
   File "/data/server/pygr/build/lib.linux-x86_64-2.5/pygr/annotation.py",  
line 167, in
__getitem__
     return self.sliceAnnotation(k,self.sliceDB[k])
   File "/data/server/pygr/build/lib.linux-x86_64-2.5/pygr/mapping.py", line  
395, in __getitem__
     return self.d[self.saveKey(k)]
   File "/data/server/pygr/build/lib.linux-x86_64-2.5/pygr/mapping.py", line  
387, in saveKey
     raise KeyError('IntShelve can only save int or str as key')
KeyError: 'IntShelve can only save int or str as key'



Attachments:
	make_test.py  2.3 KB

--
You received this message because you are listed in the owner
or CC fields of this issue, or because you starred this issue.
You may adjust your issue notification preferences at:
http://code.google.com/hosting/settings



More information about the pygr-notify mailing list