[Bioperl-l] SeqFeature->_expand_region

Chris Mungall cjm at fruitfly.org
Wed Jul 2 22:50:54 EDT 2003


I'm not sure what your proposed solution to my problem is - or maybe I
didn't explain it properly.

when I use the code as-is, I end up with a location that has start, end
but has strand==0

you say:

> So, I'd actually argue that if there has been no prior attempt to set
> the strand, the first added subfeature with a strand is allowed to
> promote its knowledge to the container. This is what this piece of code
> does:

[snip]
>          $self->strand($feat->strand) unless defined($self->strand());

but the piece of code fails to promote its knowledge of the strand to the
container ($self), because the container strand is necessarily defined and
is equal to 0.

are you suggesting we change Location::Atomic to return undefined when not
known?

On Wed, 2 Jul 2003, Hilmar Lapp wrote:

>
> On Wednesday, July 2, 2003, at 03:44  PM, Chris Mungall wrote:
>
> > Or maybe the return value for Location::Atomic should be changed
> >
> >   # let's go ahead and force to '0' if
> >   # we are requesting the strand without it
> >   # having been set previously
> >    return $self->{'_strand'} || 0;
> >
>
> I think here is where the offender sits. '0' is defined as 'set to
> unknown', whereas not set is not set.
>
> The expand-logic presently says that adding sub-features can't change
> the knowledge about the strand if there are no coordinates set;
> otherwise (if there are coordinates set) defer that decision to the
> union() implementation.
>
> So, I'd actually argue that if there has been no prior attempt to set
> the strand, the first added subfeature with a strand is allowed to
> promote its knowledge to the container. This is what this piece of code
> does:
>
>      if((! defined($self->start())) && (! defined $self->end())) {
>          $self->start($feat->start());
>          $self->end($feat->end());
>          $self->strand($feat->strand) unless defined($self->strand());
>
> My $0.02.
>
> -hilmar
>
>



More information about the Bioperl-l mailing list