Probably not the fastest option:
grep -B1 -A2 "^AGATCGG" file.fq | grep -v "^--$" > out.fq
Find lines that begin with "AGATCGG", grab one line before each hit and two lines after each hit, remove lines that are "--".
Note that it's possible (but extremely unlikely) that some quality value line begins like "AGATCGG", in which case the above command would mess up the output file. The likelihood of this is probably very close to zero but if you're processing a file with googolplex lines, maybe it could happen.
modified 22 months ago
RamRS ♦ 19k
3.6 years ago by
5heikki ♦ 7.9k