[Bioperl-l] Bio/SeqFeature/Annotated proposed patch

Cook, Malcolm MEC at stowers-institute.org
Fri Jan 19 18:07:31 EST 2007


Sendu & Chris,

Thanks for vetting this change.

My mistake for mixing 'Annotations' with deprecated 'tags'.  Regardless,
it does pass SeqFeature.t, including these new tests I just added, the
last of which fails without the patch:

    is $sfa3->score(), 12;
    $sfa3->score(11);
    is $sfa3->score(), 11;
    $sfa3->score(0);
    is $sfa3->score(), 0;

...as confirmed via `./Build test --test_files t/SeqFeature.t --verbose`

However, Sendu's improved implementation passes them too, as does
testing for `defined`, as is done elsewhere in this module, viz:

	$self->score('.') unless
(defined($self->get_Annotations('score'))); # make sure we always have
something

So, I'm going with the test for 'defined' since this approach is what is
used elsewhere in this module.

Thanks for your eyes and minds....

Malcolm Cook
Database Applications Manager - Bioinformatics
Stowers Institute for Medical Research - Kansas City, Missouri
  

> -----Original Message-----
> From: bioperl-l-bounces at lists.open-bio.org 
> [mailto:bioperl-l-bounces at lists.open-bio.org] On Behalf Of Sendu Bala
> Sent: Friday, January 19, 2007 3:07 PM
> To: Cook, Malcolm
> Cc: bioperl list; allenday at ucla.edu; allenday at cpan.org
> Subject: Re: [Bioperl-l] Bio/SeqFeature/Annotated proposed patch
> 
> Cook, Malcolm wrote:
> > I ran across this problem:
> > 
> > Setting the score of a feature to 0 (zero) cuases it to 
> really be set to
> > '.'.
> > 
> > I'm poised to apply the following patch.
> > 
> > Any objections?
> 
> > !   $self->score('.') unless 
> ($self->get_Annotations('score')); # make
> > sure we always have something
> 
> vs
> 
> > !   $self->score('.') unless $self->has_tag('score'); # make sure we
> > always have something 
> 
> I didn't look into how this is setup, but could something 
> have a score 
> tag without the score being defined? I'd have thought it 
> safest to call 
> $self->get_Annotations('score') and check if the answer was defined.
> 
> So really the solution would seem to be:
> 
> $self->score('.') unless @{[$self->get_Annotations('score')]};
> (or similar)
> _______________________________________________
> Bioperl-l mailing list
> Bioperl-l at lists.open-bio.org
> http://lists.open-bio.org/mailman/listinfo/bioperl-l
> 



More information about the Bioperl-l mailing list