Bioperl: RangeI strand questions

Steve Chervitz sac@neomorphic.com (Steve A. Chervitz)
Thu, 25 May 2000 10:14:05 -0700 (PDT)


Matt,

Okay, I'll commit my changes. I think it is right to include strand
information in the Range object, since these are really bio-ranges,
not pure mathematical intervals. There is a mechanism for ignoring
strand info if you want to.

Another change I made was to include strand information in the
toString() method of Range.pm. So instead of returning a string like
"(1000, 2000)", it will return "(1000, 2000) strand=-1". The
toString() method should not be used programmatically, but only for
debugging or display purposes. Perhaps there could be an argument to
suppress strand information in toString()?

Steve

Matthew Pocock writes:
 > Steve,
 > 
 > Steve Chervitz wrote:
 > 
 > > Matt,
 > >
 > > In RangeI.pm, the union and intersection methods were both always
 > > returning 0 for the strand. Why is this? It seems better to preserve
 > > strand information if the ranges being compared are on the same strand
 > > and return 0 only if this isn't the case. Is there any code that
 > > depends on the current behavior?
 > 
 > There are no dependancies that I am aware of. Fixing this would be a GOOD
 > thing. I sudgest writing a function like _testStrand called _combineStrand
 > that is invoked as:
 > 
 > $self->_combineStrand($other, $so)
 > 
 > and does the apropreate combining based upon the strand option string.
 > 
 > >
 > >
 > > There were several calls to _testStrand that didn't include both
 > > arguments (the other range and the strand option string). Was this
 > > deliberate?
 > >
 > 
 > No - my mistake. e.g. intersection should contain:
 > 
 > return unless $self->_testStrand($other, $so);
 > 
 > I guess this code never got tested thoroughly. I was always a bit hazey
 > about including strand info with the range, so didn't have a very clear
 > idea how the API was supposed to behave. Oops.
 > 
 > >
 > > Last item: The way union is set up, you can't supply a strand option
 > > argument. If you instead specify that the range list be passed in as a
 > > reference, then users could include a strand option argument:
 > >
 > >   Bio::RangeI->union(\@ranges, 'strong');
 > >
 > > What do you think?
 > >
 > 
 > Looks fine to me. I guess pass-by-reference is always a good thing -
 > easier on the memory, and lets you pass in more than just a single list.
 > 
 > Since I now use Java day-to-day, would somebody else like to look after
 > this module? I don't think that I can provide an apropreate level of
 > support.
 > 
 > All the best,
 > 
 > Matthew
 > 
 > >
 > > Steve
 > > =========== Bioperl Project Mailing List Message Footer =======
 > > Project URL: http://bio.perl.org/
 > > For info about how to (un)subscribe, where messages are archived, etc:
 > > http://www.techfak.uni-bielefeld.de/bcd/Perl/Bio/vsns-bcd-perl.html
 > > ====================================================================
 > 
 > --
 > Joon: You're out of your tree
 > Sam:  It wasn't my tree
 >                                                  (Benny & Joon)
 > 
 > 
 > 
=========== Bioperl Project Mailing List Message Footer =======
Project URL: http://bio.perl.org/
For info about how to (un)subscribe, where messages are archived, etc:
http://www.techfak.uni-bielefeld.de/bcd/Perl/Bio/vsns-bcd-perl.html
====================================================================