From 35416786b6cd7cf6fdf91e8b8d4d05fb6d462588 Mon Sep 17 00:00:00 2001 From: cjfields Date: Mon, 24 Nov 2008 04:52:58 +0000 Subject: [PATCH] [bug 2630] * small Simplealign fix to deal with symbols svn path=/bioperl-live/trunk/; revision=15013 --- Bio/SimpleAlign.pm | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/Bio/SimpleAlign.pm b/Bio/SimpleAlign.pm index c7a7eaeaf..5273915e2 100644 --- a/Bio/SimpleAlign.pm +++ b/Bio/SimpleAlign.pm @@ -561,11 +561,16 @@ sub uniq_seq { # it's necessary to ignore "n", "N", leading gaps and ending gaps in # comparing two sequence strings -# 1st, convert "n", "N" to "?" (for DNA sequence only): + # 1st, convert "n", "N" to "?" (for DNA sequence only): $str =~ s/n/\?/gi if $str =~ /^[atcgn-]+$/i; -# 2nd, convert leading and ending gaps to "?": + # 2nd, convert leading and ending gaps to "?": $str = &_convert_leading_ending_gaps($str, '-', '?'); - my $new = Bio::LocatableSeq->new(-id => $seq->id(), + # Note that '?' also can mean unknown residue. + # I don't like making global class member changes like this, too + # prone to errors... -- cjfields 08-11-18 + local $Bio::LocatableSeq::GAP_SYMBOLS = '-\?'; + my $new = Bio::LocatableSeq->new( + -id => $seq->id(), -alphabet=> $seq->alphabet, -seq => $str, -start => $seq->start, -- 2.11.4.GIT