Beefy Boxes and Bandwidth Generously Provided by pair Networks
Your skill will accomplish
what the force of many cannot
 
PerlMonks  

Re: Identifying Overlapping Matches in Nucleotide Sequence

by Eily (Monsignor)
on Oct 27, 2017 at 07:59 UTC ( [id://1202125]=note: print w/replies, xml ) Need Help??


in reply to Identifying Overlapping Matches in Nucleotide Sequence

You can use the look ahead assertion (found in Extended Patterns), which makes perl search for a pattern and return to the previous position after the match (and /g doesn't allow perl to match exactly at the same position, so it will move by at least one char on the next attempt).

($myseq =~ /(?=AA)/gi ), or (?=(AA)) if you want to capture the matches (which isn't really useful when the pattern is AA).

Replies are listed 'Best First'.
Re^2: Identifying Overlapping Matches in Nucleotide Sequence
by FIJI42 (Acolyte) on Oct 27, 2017 at 13:02 UTC

    This worked perfectly. Thanks!

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others making s'mores by the fire in the courtyard of the Monastery: (3)
As of 2024-04-25 05:35 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found