in reply to Re^2: Splitting only on internal pattern, not at start or end of string
in thread Splitting only on internal pattern, not at start or end of string
Unfortunately, also totally wrong as it will consume an A, C, G or T adjacent to the Ns. Rather than split do a global match for one or more of A, C, G or T.
$ perl -E ' $seq = q{NNACGTNNNACGTNACGTNN}; say for split m{[ACGT]N+[ACGT]}, $seq; say q{-} x 10; say for $seq =~ m{[ACGT]+}g;' NNACG CG CGTNN ---------- ACGT ACGT ACGT $
I hope this is helpful.
Update: Corrected wording, s/more than one of/one or more of/
Cheers,
JohnGG
|
|---|