Help for this page

Select Code to Download


  1. or download this
      # "$ _" is really "$_", and change the qq to a double-quote
      $_ = 
    ...
      s|.*(\w).*(\w).*\n|$_{$-++ / 9 % 2 ? $2:$ 1}|gex;
      s|(.)(.)(.)(.)|chr (64*$1 + 16*$2 + 4*$3 + $4)|gex;
      eval
    
  2. or download this
      @_{A => C => G => T => } = 0..3;
      # is really...
      @_{'A', 'C', 'G', 'T'}   = 0..3;
    
  3. or download this
      s|
        .*      # greedily match
    ...
        # strand (see physi's comment for a visual representation of this)
        $_{$-++ / 9 % 2 ? $2:$ 1}
      |gex;
    
  4. or download this
      s|
        # store next four characters into $1,$2,$3, and $4
    ...
        # replace with a Base4-to-ASCII conversion of those characters
        chr (64*$1 + 16*$2 + 4*$3 + $4)
      |gex;
    
  5. or download this
    use strict;
    
    ...
        print "$fmt\n";
      }
    }