Beefy Boxes and Bandwidth Generously Provided by pair Networks
Clear questions and runnable code
get the best and fastest answer
 
PerlMonks  

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

by salva (Abbot)
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?
[ELISHEVA]: \Disciplus : lol
[Discipulus]: and ELISHEVA we waait one your post since ~2years... ;=)
[ELISHEVA]: has it really been that long?
[Discipulus]: it seems..
[Discipulus]: more: just one thread in the last ~5 years
[Discipulus]: but Dumas is waiting for me in the bed.. luckly as book author.. see you!
[ELISHEVA]: Sleep well!
[ELISHEVA]: Or read well
[Discipulus]: thanks, best dreams to you all

How do I use this? | Other CB clients
Other Users?
Others avoiding work at the Monastery: (8)
As of 2017-05-28 20:45 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?