Don't ask to ask, just ask | |
PerlMonks |
Re^4: unique sequencesby AnomalousMonk (Archbishop) |
on Dec 11, 2017 at 21:25 UTC ( [id://1205305]=note: print w/replies, xml ) | Need Help?? |
I thought the capturing parenthesis would capture the look-behind pattern as well. It does — except I wouldn't think of what was captured as "the look-behind pattern", but simply as "the pattern" or maybe "the match." Look-around doesn't really enter in to it, and I don't see any need to bring in substr either; you already seem to have everything you need in $1, e.g. (with one repeated sequence):
However, I think the line-by-line processing of your code here is problematic. In the OPed code, the function loadSequence() (supposedly) concatenates all lines of ATCG bases in a file together before trying to extract sub-sequences of interest. In line-by-line processing, a sub-sequence may be interrupted by a newline and thus be missed. (OTOH, the whole 21-base-versus-12-base aspect of the OPed code leaves me puzzled; I can't quite figure out what the OPer was going for there.) Give a man a fish: <%-{-{-{-<
In Section
Seekers of Perl Wisdom
|
|