I'm back at this after some bench work, and it's not working for me yet.
here's a file named infile
>zzzzzzzzzzzzzGGGAAGTGAGGCGYTGTTGTTATTTGGTTTAYGAGTCAGAGGTGTTTTTTCACGGAGAGATGGCTCTAAGA
>zzzzzzzzzzzzzGGGAAGTGAGGCGYTGTTGTTATTTGGTTTAYGAGYTAGAGGYGTCTTTTTACGGAGAGACGGTTTTAAGA
I also tried a version without the initial ">" symbol, in case that had an inappropriate meaning.
here are three main versions of the sed script I'm trying to run, along with variants. I'm using the g command rather than the individual replacements because the replacement value will always be the same. Two of the versions are an attempt to figure out what sort of brackets to use when using numbers rather than dots. The final, clunky version uses the dots.
version 1
$> sed 's/\{36\}.\{12\}.\{9\}.\(.\).\(..\).\{12\}.\(.\).\(.*\)/x/g' infile1
version 1a
$> sed -e 's/\{36\}.\{12\}.\{9\}.\(.\).\(..\).\{12\}.\(.\).\(.*\)/x/g' infile1
version 1b
$> sed 's/\{36\}.\{12\}.\{9\}.\(.\).\(..\).\{12\}.\(.\).\(.*\)/x/g' infile >zzzzzzzzzzzzzGGGAAGTGAGGCGYTGTTGTTATTTGGTTTAYGAGTCAGAGGTGTTTTTTCACGGAGAGATGGCTCTAAGA
>zzzzzzzzzzzzzGGGAAGTGAGGCGYTGTTGTTATTTGGTTTAYGAGYTAGAGGYGTCTTTTTACGGAGAGACGGTTTTAAGA
version 2
$> sed 's/\(36\).\(12\).\(9\).\(.\).\(..\).\(12\).\(.\).\(.*\)/x/g' infile1
(same variants as with version 1)
version 3
$> sed 's/\(....................................\).\(............\).\(.........\).\(.\).\(..\).\(............\).\(.\).(.*\)/x/g'
(same variants as with version 1)
the resulting error is sometimes along the lines of command not found, other times the error says unbalanced parentheses.
desired output would be
>zzzzzzzzzzzzzGGGAAGTGAGGCGYTGTTGTTAxTTGGTTTAYGAGxCAGAGGTGTxTxTTxACGGAGAGATGGxTxTAAGA
>zzzzzzzzzzzzzGGGAAGTGAGGCGYTGTTGTTATTTGGTTTAYGAGYTAGAGGYGTxTxTTxACGGAGAGACGGxTxTAAGA
to give you a sense of the magnitude of the real program, here's the proposed script for the entire piece of DNA (which would be applied to about 60 lines of that length, rather than the two lines in the infile example.
$> sed 's/\(36\).\(12\).\(9\).\(.\).\(..\).\(12\).\(.\).\(13\).\(6\).....\(5\).\(.\)..\(7\).....\(.\).\(6\).\(..\).\(6\).\(...\)...\(25\).\(18\).\(..\)..\(8\).\(...\).\(...\).\(...\).\(5\).\(6\).\(9\).\(10\)..\(21\).\(6\)..\(8\).\(10\).\(4\).\(10\).\(24\).\(26\).\(.*\)/x/g' infile
I'm using a MacOS X default (Bash shell) terminal.
Is there anything I am doing right?
Is there something dead obvious that I'm doing wrong?
I need to write, oh, 18 scripts of this length, and get them working.
---------- Post updated at 03:16 PM ---------- Previous update was at 03:14 PM ----------
I missed two replacements in the sample output file
>zzzzzzzzzzzzzGGGAAGTGAGGCGYTGTTGTTAxTTGGTTTAYGAGxCAGAGGTGTxTxTTxACGGAGAGATGGxTxTAAGA
>zzzzzzzzzzzzzGGGAAGTGAGGCGYTGTTGTTAxTTGGTTTAYGAGxTAGAGGYGTxTxTTxACGGAGAGACGGxTxTAAGA