On Thu, Mar 26, 2009 at 7:26 PM, Brent Pedersen <bpede...@gmail.com> wrote: > hi, with the script pasted here: > http://pastebin.ca/1373633 > > everything runs fine when i dont pull the data loaded from pygr.Data, > and instead get it by building the NLMSA. > when i do try to get from pygr.Data, i get the error pasted at the end > of this email (and in the script). > how can i stop that error from occurring? (and use pygr.Data) > > also, i have a couple of questions labelled "Q:" in the script, where > i'm not sure if i'm using pygr to full advantage. > so any pointers on that, and in general would be appreciated. > > eventually, i want to use the items in the sorghum_anno (an > AnnotationDB) to query the NLMSA (named msa). > are the last 2 lines of the script the proper way to do that? it > works, but i think i need to use msa.addAnnotation() > to get sorghum/maize genes for a particular region as well--is that true? > so the specific question there is can i add annotations to the NLMSA > which i've created using NLMSA.add_aligned_intervals? > > thanks, > -brent > > > =========================================== > > Traceback (most recent call last): > File "msorg.py", line 96, in <module> > for item, edge in msa[union_seq['sorghum.10'][1:40400]].items(): > File "cnestedlist.pyx", line 1658, in pygr.cnestedlist.NLMSA.__getitem__ > File "/usr/lib/python2.5/site-packages/pygr/nlmsa_utils.py", line > 127, in __getitem__ > seqID=self.getSeqID(seq) # USE SEQ ID TO LOOK UP... > File "/usr/lib/python2.5/site-packages/pygr/nlmsa_utils.py", line > 139, in getSeqID > return (~(self.nlmsa.seqDict))[seq] > File "/usr/lib/python2.5/site-packages/pygr/seqdb.py", line 570, in > __getitem__ > if anno_seq_attr.db in self.db.dicts: > AttributeError: 'NoneType' object has no attribute 'db' >
hi, this error occurs because of this: http://repo.or.cz/w/pygr.git?a=blob;f=pygr/seqdb.py;h=f02ee0fb786bed01d58b8e6c5c813c34639b5027;hb=HEAD#l569 where it uses: anno_seq_attr = getattr(seq, '_anno_seq', None) if anno_seq_attr.db in self.db.dicts: where .db is undefined if the getattr() call returns None. i think that the None case should be handled or raise an informative error as currently, it's "AttributeError: 'NoneType' object has no attribute 'db'" i'm still not aware of how to fix this, or why it occurs only when i reload data from pygr.Data, and not when i create the MSA from scratch. i'll create a self-contained case if it helps. thanks, -brent --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "pygr-dev" group. To post to this group, send email to pygr-dev@googlegroups.com To unsubscribe from this group, send email to pygr-dev+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/pygr-dev?hl=en -~----------~----~----~----~------~----~------~--~---