On Tue, Jun 2, 2009 at 9:06 AM, jbiesinger <jake.biesin...@gmail.com> wrote:

>
> Hi!
>
> First of all, pygr is awesome.  Thanks heaps to the developers. It is
> a big help.
> I'm new to pygr.  I'm trying to build a pygr resource of exons over
> the entire genome.  I have a resource of all the genes, plus a
> SQLTable with the exon information in UCSC's refseq form:
>
> column exonStarts
>
> 1213042,1213331,1214185,1214333,1216053,1216285,1216467,1216790,1216945,1217383
> column exonEnds
>
> 1213278,1213396,1214280,1214485,1216222,1216416,1216717,1216888,1217103,1217466,
>
> I build a Collection of exons by zipping together each of the starts
> and ends.
> Right now, my code builds a mapping from genome to exon using
>
> annotation_db = annotation.AnnotationDB(exonCollection, genome,
> filename=opts.path_stem+'_exons',mode='cw')
> annotation_map = cnestedlist.NLMSA(pathstem=opts.path_stem,
>                                  mode='w',
>                                  pairwiseMode=True,
>                                  bidirectional=False)
>    for event in annotation_db.itervalues():
>          annotation_map.addAnnotation(event)
>
> annotation_db.__doc__ = 'annotation database for exons of %s' %
> opts.genome_resource
> annotation_map.__doc__ = 'annotation map for genome-> exons of %s' %
> opts.genome_resource
> pygr.Data.addResource(db_resource_string, annotation_db)
> pygr.Data.addResource(map_resource_string, annotation_map)
>
> pygr.Data.ManyToManyRelation(genome,annotation_db,bindAttrs=
> ('annotation_db',))


If I understand right, you can try annotation_db because you had binded your
exon collections to genome by 'annotation_db' attributes.


>
> pygr.Data.save()
>
> There is other code that creates the OneToMany Mapping of gene->exons,
> which is also suffering, but I thought I'd start out here.  When I try
> to load the resulting resource, I'm getting
> <type 'exceptions.AttributeError'>: FakeModule object has no attribute
> 'Exon'
>
> The Exon class is defined above this, and the ExonCollection uses
> Collection(itemClass=Exon).
> I'm not sure where the problem is...
>
> The source is posted at http://pastebin.com/m42d7a159
>
> Thanks!
>
> Jake Biesinger
>
> >
>

--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---

Reply via email to