in reply to Re^4: 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
tomy @matches = ($seq{$key} =~ /$string/ig); #print "@matches\n"; $result{$string} = scalar(@matches);
$result{$string} =()= ($seq{$key} =~ /$string/ig);
would hit the spec of this request, but I would also expect the speed-up achieved would be negligible. The compound of two = operators with an empty list (()) puts the regex in list context, thus obtaining a count of all matches.
#11929 First ask yourself `How would I do this without a computer?' Then have the computer do it the same way.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^6: counting the number of 16384 pattern matches in a large DNA sequence
by anonym (Acolyte) on Jun 14, 2012 at 20:20 UTC | |
by kennethk (Abbot) on Jun 14, 2012 at 22:26 UTC |