[Bioperl-l] Re: bioperl Registry

Lincoln Stein lstein at cshl.edu
Fri Nov 21 09:02:01 EST 2003


> > In LocatableSeq.pm, there was the following odd bit of code in the
> > start() method:
> >
> > 	$self->seq ? (return $self->{'start'} || 1) : undef;
> >
> > This is weird, because it means if there is no sequence attached to the
> > LocatableSeq, it returns undef as the start coordinate.  This was causing
> > the GFF regression tests to fail.  I replaced the line with a simple
> > return $self->{'start'} || 1.
>
> That was my recent modification. I thought that would make sense. end()
> returns undef. If there is no sequence and start() has not been set, why is
> it necessary to assume that start equals 1?

In fact I would be happy with this:

	return $self->{'start'};

The GFF code is correctly setting the 'start' key in this case.  The || 1 was 
residual because I didn't understand what the intent of the code was.   
Perhaps the logic you are looking for is:

	return $self->{'start'} if defined $self->{'start'};
	return 1                   if $self->seq;
	return;

???

Lincoln


>
> I happy to accept this but would like to understand why before I change the
> t/Locatable.t.
>
> 	-Heikki
>
> > Lincoln
> >
> > On Thursday 20 November 2003 09:16 pm, Lincoln Stein wrote:
> > > I've got perl 5.8.2 installed now and can partially reproduce the
> > > problem. I am working on it now.
> > >
> > > Lincoln
> > >
> > > On Thursday 20 November 2003 08:19 am, Heikki Lehvaslaiho wrote:
> > > > Michele & Lincoln,
> > > >
> > > > Could I bother either of you two to have a look at the bioperl live
> > > > Registry/ Bio::DB::Flat modules. There is something wrong in the
> > > > BerkeleyDB version of flatdb and I can not get my head around it.
> > > >
> > > > Brian has been  working on it but everything works under his cygwin
> > > > system so he is stuck. I isolated the BDB tests from t/Registry.t
> > > > into an other file and put it into bugzilla:
> > > > http://bugzilla.bioperl.org/show_bug.cgi?id=1562
> > > >
> > > > The tests fail in both Mandrake Linux 9.2+cooker (Perl 5.8.2) and
> > > > RedHat Linux 9 (Perl 5.8.1), so it is definitely not just my system's
> > > > problem.
> > > >
> > > > Cheers,
> > > > 		-Heikki

-- 
Lincoln Stein
lstein at cshl.edu
Cold Spring Harbor Laboratory
1 Bungtown Road
Cold Spring Harbor, NY 11724
(516) 367-8380 (voice)
(516) 367-8389 (fax)


More information about the Bioperl-l mailing list