[Bioperl-l] Bio::RangeI::union

Chris Mungall cjm at fruitfly.org
Fri Jun 10 12:36:25 EDT 2005


You're right, I could just do

 $newrange = Bio::Range->union(@ranges)

And it would work fine

However, the calling context is *another* "decorated" interface in RangeI
(disconnected_ranges) - it seems very odd to have a an interface "method"
calling a method in a class that implements that interface

I'm not sure exactly what you're proposing when you say "deprecating the
Bio::RangeI->union() construct" - how would this work? Would it just throw
a warning if $self eq "Bio::RangeI"?

On Thu, 9 Jun 2005, Aaron J. Mackey wrote:

> Or, how about deprecating the Bio::RangeI->union() construct (since
> although we've supplied implementations in interface, we don't need
> to encourage people to use them)?  This is just a weird way to do
> $newrange = Bio::Range->union(@ranges), right? (which saves a whole
> capitalized keystroke!)
>
> -Aaron
>
> On Jun 9, 2005, at 2:45 PM, Chris Mungall wrote:
>
> >
> > The pod docs for union() state that this is is valid:
> >
> >   my $newrange = Bio::RangeI->union(@ranges);
> >
> > In the subroutine body, this gets called:
> >
> >   my $self = shift;
> >   ...
> >   $self->new(...)
> >
> > Since $self is equal to the string "Bio::RangeI", rather than an
> > object
> > implementing this interface, this will result in a call to
> >
> >   Bio::Root::RootI->new("Bio::RangeI",...)
> >
> > This works fine in bp1.4, but in recent bioperl revisions this
> > results in
> > a warning message that Bio::Root::RootI->new is deprecated, and a
> > delegation to Bio::Root::Root, **omitting the name of the class to be
> > created**, thus creating a Bio::Root::Root object, which is useless
> > and
> > will inevitably break any code calling the union() method.
> >
> > I think this delegation is completely wrong, and should be removed,
> > and
> > the warning message switched to an error; OR it should be
> > undeprecated and
> > the original behaviour behaviour restored
> >
> > If we decide that RootI->new is truly deprecated, then Bio::RangeI
> > should
> > have to do some $self examination, and use the correct object
> > instantiation method, rather than $self->new. I don't really know
> > what the
> > correct object instantiation method is - perhaps just Bio::Range-
> > >new()?
> > Or should a factory be used?
> >
> > Personally, I would prefer it if Bio::RootI->new were undeprecated
> > and the
> > original behaviour restored. deprecating would make perfect sense if
> > bioperl interfaces really were interfaces, which they are not.
> >
> > Cheers
> > Chris
> >
> > _______________________________________________
> > Bioperl-l mailing list
> > Bioperl-l at portal.open-bio.org
> > http://portal.open-bio.org/mailman/listinfo/bioperl-l
> >
>
> --
> Aaron J. Mackey, Ph.D.
> Project Manager, ApiDB Bioinformatics Resource Center
> Penn Genomics Institute, University of Pennsylvania
> email:  amackey at pcbi.upenn.edu
> office: 215-898-1205
> fax:    215-746-6697
> postal: Penn Genomics Institute
>          Goddard Labs 212
>          415 S. University Avenue
>          Philadelphia, PA  19104-6017
>
>



More information about the Bioperl-l mailing list