Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl-Sensitive Sunglasses
 
PerlMonks  

Re^6: counting the number of 16384 pattern matches in a large DNA sequence

by salva (Monsignor)
on Jun 15, 2012 at 07:22 UTC ( #976378=note: print w/ replies, xml ) Need Help??


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

an untested variation:

while(/([ACGT]{7,})/g) { for my $ix (0..lenght($1) - 7) { ++$index{substr($1, $ix, 7)} } }
This regular expression should process every character on the string just once and so be an order of magnitude faster than yours which tries to match the look-ahead pattern at every char.

But that is just guessing... could you benchmark it?


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

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://976378]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others chilling in the Monastery: (17)
As of 2014-10-23 16:37 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    For retirement, I am banking on:










    Results (126 votes), past polls