[Bioperl-guts-l] bioperl-live/Bio/DB/SeqFeature Segment.pm, 1.15, 1.16

Jason Stajich jason at dev.open-bio.org
Fri Jan 26 18:13:22 EST 2007


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

Modified Files:
	Segment.pm 
Log Message:
insure that length is positive and location object has segment's strandedness

Index: Segment.pm
===================================================================
RCS file: /home/repository/bioperl/bioperl-live/Bio/DB/SeqFeature/Segment.pm,v
retrieving revision 1.15
retrieving revision 1.16
diff -C2 -d -r1.15 -r1.16
*** Segment.pm	1 Nov 2006 17:25:04 -0000	1.15
--- Segment.pm	26 Jan 2007 23:13:20 -0000	1.16
***************
*** 213,217 ****
  This is identical to Bio::DB::SeqFeature::Store-E<gt>get_seq_stream()
  except that the location filter is always automatically applied so
! that the iterator you receive returns features that overlap the segment's region.
  
  When called without any arguments this method will return an iterator
--- 213,218 ----
  This is identical to Bio::DB::SeqFeature::Store-E<gt>get_seq_stream()
  except that the location filter is always automatically applied so
! that the iterator you receive returns features that overlap the
! segment's region.
  
  When called without any arguments this method will return an iterator
***************
*** 233,236 ****
--- 234,239 ----
  =cut
  
+ #'
+ 
  sub get_seq_stream {
    my $self = shift;
***************
*** 402,406 ****
  sub strand  { shift->{strand} }
  sub ref     { shift->seq_id   }
! sub length  { my $self = shift; return $self->end-$self->start+1; }
  sub primary_tag  { 'region' }
  sub source_tag   { __PACKAGE__ }
--- 405,414 ----
  sub strand  { shift->{strand} }
  sub ref     { shift->seq_id   }
! 
! sub length  { 
!     my $self = shift; 
!     return abs($self->end - $self->start) +1;        
! }
! 
  sub primary_tag  { 'region' }
  sub source_tag   { __PACKAGE__ }
***************
*** 449,456 ****
  			      -id  => $self->seq_id);
  }
  sub location {
    my $self = shift;
!   require Bio::Location::Simple unless Bio::Location::Simple->can('new');
!   return Bio::Location::Simple->new(-start=>$self->start,-end=>$self->end);
  }
  sub primary_id   {
--- 457,470 ----
  			      -id  => $self->seq_id);
  }
+ 
  sub location {
    my $self = shift;
!   require Bio::Location::Simple unless Bio::Location::Simple->can('new');  
!   my $loc = Bio::Location::Simple->new(-start  => $self->start,
! 				    -end    => $self->end,
! 				       -strand => $self->strand);
!   $loc->strand($self->strand);
!   warn("strand will be ", $self->strand, "\n") if $self->strand < 0;
!   return $loc;
  }
  sub primary_id   {



More information about the Bioperl-guts-l mailing list