in reply to Re^5: counting the number of 16384 pattern matches in a large DNA sequence
in thread counting the number of 16384 pattern matches in a large DNA sequence

Thanks.I tried this line

$result{$string} =()= ($seq{$key} =~ /$string/ig);

but it is nt printing anything.

  • Comment on Re^6: counting the number of 16384 pattern matches in a large DNA sequence
  • Download Code

Replies are listed 'Best First'.
Re^7: counting the number of 16384 pattern matches in a large DNA sequence
by kennethk (Abbot) on Jun 14, 2012 at 22:26 UTC
    As described in I know what I mean. Why don't you?, come up with a simple, replicatable piece of code that displays the bug. For example,
    use strict; use warnings; my %result; my %seq = (key => 'asdfasdfasdf'); my @string = 'asdf'; foreach my $string (@string) { chomp $string; foreach my $key (keys %seq) { $result{$string} =()= ($seq{$key} =~ /$string/ig); } foreach my $s (keys %result) { print "$s => $result{$s}\n"; } }
    outputs asdf => 3 as expected.

    #11929 First ask yourself `How would I do this without a computer?' Then have the computer do it the same way.