bioperl / bioperl-live-redmine

Legacy tickets migrated from the OBF Redmine issue tracker: http://redmine.open-bio.org
0 stars 0 forks source link

processed_transcript glyph no longer handles Bio::SeqFeature::Gene::Exon features #138

Open cjfields opened 8 years ago

cjfields commented 8 years ago

Author Name: Ben Booth (Ben Booth) Original Redmine Issue: 3377, https://redmine.open-bio.org/issues/3377 Original Date: 2012-08-16 Original Assignee: Bioperl Guts


We’re using Bio::Graphics for our internal genome browser. The browser has been using Bio::Graphics version 1.006001, however, after upgrading to version 2.26, the processed_transcript glyph no longer works correctly. I attached two test examples; the oldtest.pl script works on the old Bio::Graphics but not on the new one. The test.pl script works on both new and old versions of Bio::Graphics.

It looks like there were some undocumented API changes in Bio::Graphics regarding this glyph. Previously, we were using Bio::SeqFeature::Gene::Transcript features, then adding Bio::SeqFeature::Gene::Exons to them using $feature->add_exon(). Using the same code with the new Bio::Graphics throws this exception:

Can’t locate object method “type” via package “Bio::SeqFeature::Gene::Exon” at /usr/share/perl5/site_perl/Bio/Graphics/Glyph/processed_transcript.pm line 19, line 192. at /usr/share/perl5/site_perl/Bio/Graphics/Glyph/processed_transcript.pm line 19, line 192. Bio::Graphics::Glyph::processed_transcript::guess_options(‘Bio::Graphics::Glyph::processed_transcript=HASH(0x38988f8)’) called at /usr/share/perl5/site_perl/Bio/Graphics/Glyph/processed_transcript.pm line 10 Bio::Graphics::Glyph::processed_transcript::new(‘Bio::Graphics::Glyph::processed_transcript’, ‘-feature’, ‘Bio::SeqFeature::Gene::Transcript=HASH(0x3882c70)’, ‘-factory’, ‘Bio::Graphics::Glyph::Factory=HASH(0x360ab80)’, ‘-flip’, 0, ‘-level’, 0, …) called at /usr/share/perl5/site_perl/Bio/Graphics/Glyph/Factory.pm line 344 Bio::Graphics::Glyph::Factory::make_glyph(‘Bio::Graphics::Glyph::Factory=HASH(0x360ab80)’, 0, ‘Bio::SeqFeature::Gene::Transcript=HASH(0x3882c70)’) called at /usr/share/perl5/site_perl/Bio/Graphics/Glyph.pm line 420 Bio::Graphics::Glyph::add_feature(‘Bio::Graphics::Glyph::track=HASH(0x3633278)’, ‘Bio::SeqFeature::Gene::Transcript=HASH(0x3882c70)’) called at test.pl line 30

After using the perl debugger to figure out what was going on, I discovered that I could add Bio::Graphics::Features to the Bio::SeqFeature::Gene::Transcript instead of the Bio::SeqFeature::Gene::Exons, and add them using $feature->add_SeqFeature() instead of $feature->add_exon(). Was this API change intentional? I couldn’t find any documentation for this change or the rationale for it. It would be nice if the old approach was supported along with the new one for backward compatibility. As it stands now, I will have to do a fair amount of work to support the new API changes.

cjfields commented 8 years ago

Original Redmine Comment Author Name: Chris Fields Original Date: 2012-08-29T03:30:51Z


I wouldn’t be surprised if this were a bug in Bio::SeqFeature::Gene::* modules, they haven’t kept up with changes in Bio::SeqFeature over time. The type() method is something that could probably be added in this case.