--- Sprout.pm 2005/09/09 20:40:41 1.21 +++ Sprout.pm 2005/09/11 17:08:59 1.24 @@ -1538,6 +1538,7 @@ Trace("Peg 1 is " . \$peg1Data->[1] . " and Peg 2 is " . \$peg2Data->[1] . ".") if T(Coupling => 4); push @retVal, [\$peg1Data->[1], \$peg2Data->[1], \$peg1Data->[0]]; } + Trace("Last index in evidence result is is \$#retVal.") if T(Coupling => 4); } # Return the result. return @retVal; @@ -1587,12 +1588,15 @@ [\$retVal], ["ParticipatesInCoupling(from-link)", "Coupling(score)"]); # Check to see if we found anything. if (!@pegs) { + Trace("No coupling found.") if T(Coupling => 4); # No coupling, so undefine the return value. \$retVal = undef; } else { # We have a coupling! Get the score and check for inversion. \$score = \$pegs[0]->[1]; - \$inverted = (\$pegs[0]->[0] eq \$peg1); + my \$firstFound = \$pegs[0]->[0]; + \$inverted = (\$firstFound ne \$peg1); + Trace("Coupling score is \$score. First peg is \$firstFound, peg 1 is \$peg1.") if T(Coupling => 4); } # Return the result. return (\$retVal, \$inverted, \$score); @@ -1697,13 +1701,13 @@ if (\$line =~ m/^>\s*(.+?)(\s|\n)/) { # Here we have a new header. Store the current sequence if we have one. if (\$id) { - \$retVal{\$id} = uc \$sequence; + \$retVal{\$id} = lc \$sequence; } # Clear the sequence accumulator and save the new ID. (\$id, \$sequence) = ("\$prefix\$1", ""); } else { # Here we have a data line, so we add it to the sequence accumulator. - # First, we get the actual data out. Note that we normalize to upper + # First, we get the actual data out. Note that we normalize to lower # case. \$line =~ /^\s*(.*?)(\s|\n)/; \$sequence .= \$1; @@ -1711,7 +1715,7 @@ } # Flush out the last sequence (if any). if (\$sequence) { - \$retVal{\$id} = uc \$sequence; + \$retVal{\$id} = lc \$sequence; } # Close the file. close FASTAFILE;