X-Git-Url: https://git.donarmstrong.com/?a=blobdiff_plain;f=code_perl%2FMaasha%2FAlign.pm;h=262ee48255634929b0e7383224952b3800fc88aa;hb=c401b3387e7713ee622638150609f11ee9305928;hp=55b4c2f9f0f6b9a698aa1278317a1599626479e4;hpb=e85ab3ff25098befde19f6f0839292f68739b785;p=biopieces.git diff --git a/code_perl/Maasha/Align.pm b/code_perl/Maasha/Align.pm index 55b4c2f..262ee48 100644 --- a/code_perl/Maasha/Align.pm +++ b/code_perl/Maasha/Align.pm @@ -272,18 +272,18 @@ sub align_pins $type ||= Maasha::Seq::seq_guess_type( $entry1->[ SEQ ] ); - $blosum = blosum_read() if $type =~ /protein/; + $blosum = blosum_read() if $type =~ "PROTEIN"; for ( $i = 0; $i < length $entry1->[ SEQ ]; $i++ ) { - $char1 = substr $entry1->[ SEQ ], $i, 1; - $char2 = substr $entry2->[ SEQ ], $i, 1; + $char1 = uc substr $entry1->[ SEQ ], $i, 1; + $char2 = uc substr $entry2->[ SEQ ], $i, 1; if ( $blosum and $char1 eq $char2 ) { $pins .= $char1; - } elsif ( uc $char1 eq uc $char2 ) { + } elsif ( $char1 eq $char2 ) { $pins .= "|"; - } elsif ( $blosum and $blosum->{ $char1 }->{ $char2 } > 0 ) { + } elsif ( $blosum and defined $blosum->{ $char1 }->{ $char2 } and $blosum->{ $char1 }->{ $char2 } > 0 ) { $pins .= "+"; } else { $pins .= " "; @@ -480,9 +480,9 @@ sub align_tile $type = Maasha::Seq::seq_guess_type( $seq1 ); - if ( $type eq "rna" ) { + if ( $type eq "RNA" ) { $seq2 = Maasha::Seq::rna_revcomp( $seq1 ); - } elsif ( $type eq "dna" ) { + } elsif ( $type eq "DNA" ) { $seq2 = Maasha::Seq::dna_revcomp( $seq1 ); } else { Maasha::Common::error( qq(Bad sequence type->$type) );