[Bioperl-guts-l] bioperl-live/Bio RangeI.pm,1.51,1.52

Malcom Cook mcook at dev.open-bio.org
Wed Jan 10 17:21:53 EST 2007


Update of /home/repository/bioperl/bioperl-live/Bio
In directory dev.open-bio.org:/tmp/cvs-serv26787

Modified Files:
	RangeI.pm 
Log Message:
implement offsetStranded


Index: RangeI.pm
===================================================================
RCS file: /home/repository/bioperl/bioperl-live/Bio/RangeI.pm,v
retrieving revision 1.51
retrieving revision 1.52
diff -C2 -d -r1.51 -r1.52
*** RangeI.pm	26 Sep 2006 22:03:04 -0000	1.51
--- RangeI.pm	10 Jan 2007 22:21:51 -0000	1.52
***************
*** 65,68 ****
--- 65,69 ----
  Juha Muilu (muilu at ebi.ac.uk)
  Sendu Bala (bix at sendu.me.uk)
+ Malcolm Cook (mec at stowers-institute.org)
  
  =head1 APPENDIX
***************
*** 557,560 ****
--- 558,580 ----
  }
  
+ =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;
+ };
  
  1;



More information about the Bioperl-guts-l mailing list