[Bio] / Sprout / Sprout.pm Repository: Repository Listing Bio

# Diff of /Sprout/Sprout.pm

revision 1.22, Fri Sep 9 21:10:46 2005 UTC revision 1.24, Sun Sep 11 17:08:59 2005 UTC
# Line 1588  Line 1588
1589      # Check to see if we found anything.      # Check to see if we found anything.
1590      if (!@pegs) {      if (!@pegs) {
1591            Trace("No coupling found.") if T(Coupling => 4);
1592          # No coupling, so undefine the return value.          # No coupling, so undefine the return value.
1593          \$retVal = undef;          \$retVal = undef;
1594      } else {      } else {
1595          # We have a coupling! Get the score and check for inversion.          # We have a coupling! Get the score and check for inversion.
1596          \$score = \$pegs[0]->[1];          \$score = \$pegs[0]->[1];
1597          \$inverted = (\$pegs[0]->[0] eq \$peg1);          my \$firstFound = \$pegs[0]->[0];
1598            \$inverted = (\$firstFound ne \$peg1);
1599            Trace("Coupling score is \$score. First peg is \$firstFound, peg 1 is \$peg1.") if T(Coupling => 4);
1600      }      }
1601      # Return the result.      # Return the result.
1602      return (\$retVal, \$inverted, \$score);      return (\$retVal, \$inverted, \$score);
# Line 1698  Line 1701
1701          if (\$line =~ m/^>\s*(.+?)(\s|\n)/) {          if (\$line =~ m/^>\s*(.+?)(\s|\n)/) {
1702              # Here we have a new header. Store the current sequence if we have one.              # Here we have a new header. Store the current sequence if we have one.
1703              if (\$id) {              if (\$id) {
1704                  \$retVal{\$id} = uc \$sequence;                  \$retVal{\$id} = lc \$sequence;
1705              }              }
1706              # Clear the sequence accumulator and save the new ID.              # Clear the sequence accumulator and save the new ID.
1707              (\$id, \$sequence) = ("\$prefix\$1", "");              (\$id, \$sequence) = ("\$prefix\$1", "");
1708          } else {          } else {
1709              # Here we have a data line, so we add it to the sequence accumulator.              # Here we have a data line, so we add it to the sequence accumulator.
1710              # 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
1711              # case.              # case.
1712              \$line =~ /^\s*(.*?)(\s|\n)/;              \$line =~ /^\s*(.*?)(\s|\n)/;
1713              \$sequence .= \$1;              \$sequence .= \$1;
# Line 1712  Line 1715
1715      }      }
1716      # Flush out the last sequence (if any).      # Flush out the last sequence (if any).
1717      if (\$sequence) {      if (\$sequence) {
1718          \$retVal{\$id} = uc \$sequence;          \$retVal{\$id} = lc \$sequence;
1719      }      }
1720      # Close the file.      # Close the file.
1721      close FASTAFILE;      close FASTAFILE;

Legend:
 Removed from v.1.22 changed lines Added in v.1.24