[Bioperl-l] PROPOSED new method Bio::Range->offsetStranded
Cook, Malcolm
MEC at stowers-institute.org
Wed Jan 10 17:07:21 UTC 2007
Hi Chris,
In part of a pipeline to design oligo microarray for detecting alternate
splice sites, I build 0-length features which identify the location of
all 5' and 3' splice sites (as inferred from flybase GFF gene,
transcript, mRNA, exon features) and then offset these feature to create
a region flanking it, which is then taken as the target of an oligo
design process.
I'm sure I could re-conceptualize my approach, but, as implemented, it
works a treat.
My thinking is influenced by my Excel's object model (VBA), which has
Offset as a destructive method of Excel.Range (of excel cells).
I suppose any algorithm that used a 'sliding window' could possibly
benefit from Bio::Range->offsetStranded.
Cheers,
Malcolm Cook (poised to commit ;)
> -----Original Message-----
> From: Chris Fields [mailto:cjfields at uiuc.edu]
> Sent: Wednesday, January 10, 2007 10:10 AM
> To: Cook, Malcolm; 'bioperl list'; muilu at ebi.ac.uk; bix at sendu.me.uk
> Subject: RE: [Bioperl-l] PROPOSED new method
> Bio::Range->offsetStranded
>
> Malcolm,
>
> I don't have a problem with it. Just curious, but what would
> it be used
> for?
>
> chris
>
> > Hi,
> >
> > I'd like to commit changes to Bio::RangeI which defined
> > offsetStranded to allows the following tests to pass in Bio/Range.t
> >
> > $r = Bio::Range->new(-start => 30, -end => 40, -strand =>
> > -1); ok ($r->offsetStranded(-5,10)->toString, '(20, 45)
> > strand=-1'); ok ($r->offsetStranded(+5,-10)->toString, '(30,
> > 40) strand=-1'); $r->strand(1); ok
> > ($r->offsetStranded(-5,10)->toString, '(25, 50) strand=1');
> > ok ($r->offsetStranded(+5,-10)->toString, '(30, 40) strand=1');
> >
> >
> > Here's the implementation.
> >
> > =head2 offsetStranded
> >
> > Title : offsetStranded
> > Usage : $rnge->ofsetStranded($fiveprime_offset,
> > $threeprime_offset)
> > Function : destructively modifies RangeI implementing object to
> > offset its start and stop coordinates by
> > values $fiveprime_offset and
> > $threeprime_offset (positive values being in
> > the strand direction).
> > Args : two integer offsets: $fiveprime_offset and
> > $threeprime_offset
> > Returns : $self, offset accordingly.
> >
> > =cut
> >
> > sub offsetStranded {
> > my ($self, $offset_fiveprime, $offset_threeprime) = @_;
> > my ($offset_start, $offset_end) = $self->strand() eq -1 ?
> > (- $offset_threeprime, - $offset_fiveprime) :
> > ($offset_fiveprime, $offset_threeprime);
> > $self->start($self->start + $offset_start);
> > $self->end($self->end + $offset_end);
> > return $self;
> > };
> >
> >
> > I'll commit tomorrow unless I'm told 'that would be a mistake'.
> >
> > Cheers,
> >
> > --Malcolm
> >
> > _______________________________________________
> > 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