Help for this page

Select Code to Download


  1. or download this
    use 5.18.0;
    use warnings;
    ...
    
    $subs{$_}++ for grep { length >= 2 } split m/,/ => ($string =~ s/([ACG
    +T])\K(?!\1)/,/gr);
    printf "%5d %3d %s\n", $subs{$_->[1]}, @$_ for sort { $b->[0] <=> $a->
    +[0] || $a->[1] cmp $b->[1] } map {[ length, $_ ]} keys %subs;
    
  2. or download this
        1   6 CCCCCC
        1   4 GGGG
    ...
        2   2 AA
        2   2 GG
        5   2 TT