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 11 months ago
Ram ♦ 13k
2.7 years ago by
5heikki ♦ 7.0k