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 16 months ago
Ram ♦ 15k
3.1 years ago by
5heikki ♦ 7.3k