[Bioperl-guts-l] bioperl-live/Bio SimpleAlign.pm,1.110,1.111

Christopher John Fields cjfields at dev.open-bio.org
Mon Sep 25 12:22:16 EDT 2006


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

Modified Files:
	SimpleAlign.pm 
Log Message:
bug 2099

Index: SimpleAlign.pm
===================================================================
RCS file: /home/repository/bioperl/bioperl-live/Bio/SimpleAlign.pm,v
retrieving revision 1.110
retrieving revision 1.111
diff -C2 -d -r1.110 -r1.111
*** SimpleAlign.pm	21 Sep 2006 19:20:12 -0000	1.110
--- SimpleAlign.pm	25 Sep 2006 16:22:14 -0000	1.111
***************
*** 942,956 ****
  		$new_seq->seq( $slice_seq );
  
! 		# start
  		if ($start > 1) {
  			my $pre_start_seq = $seq->subseq(1, $start - 1);
  			$pre_start_seq =~ s/\W//g;
  			$new_seq->start( $seq->start + CORE::length($pre_start_seq)  );
  		} else {
  			$new_seq->start( $seq->start);
  		}
- 
- 		# end
- 		$slice_seq =~ s/\W//g;
  		$new_seq->end( $new_seq->start + CORE::length($slice_seq) - 1 );
  
--- 942,960 ----
  		$new_seq->seq( $slice_seq );
  
! 		$slice_seq =~ s/\W//g;
! 		
  		if ($start > 1) {
  			my $pre_start_seq = $seq->subseq(1, $start - 1);
  			$pre_start_seq =~ s/\W//g;
+ 			if (!defined($seq->strand)) {
+ 				$new_seq->start( $seq->start + CORE::length($pre_start_seq) );
+ 			} elsif ($seq->strand < 0){
+ 				$new_seq->start( $seq->end - CORE::length($pre_start_seq) - CORE::length($slice_seq) + 1);
+ 			} else {
  			$new_seq->start( $seq->start + CORE::length($pre_start_seq)  );
+ 			}
  		} else {
  			$new_seq->start( $seq->start);
  		}
  		$new_seq->end( $new_seq->start + CORE::length($slice_seq) - 1 );
  
***************
*** 991,995 ****
     my $aln;
  
! 	if ($args[0][0] =~ /^[a-z_]+$/i) {
  		 $aln = $self->_remove_columns_by_type($args[0]);
  	} elsif ($args[0][0] =~ /^\d+$/) {
--- 995,999 ----
     my $aln;
  
! 	if ($args[0][0] =~ /^[a-z]+$/i) {
  		 $aln = $self->_remove_columns_by_type($args[0]);
  	} elsif ($args[0][0] =~ /^\d+$/) {



More information about the Bioperl-guts-l mailing list