I have been trying to get a sequence (e.g. GCGAGCCCCACATCGCCCCCCCGATTGTAATAAATAA) from a fastq file (file.fastq) I have and output a fq file. I have tried the command:
grep -A 2 -B 1 'GCGAGCCCCACATCGCCCCCCCGATTGTAATAAATAA' file.fastq | sed '/--/d' > output.fq
I got an output as 6- lines of reads that are different, while my target sequence is basically more in number. A part from that they might be just not there, Are the - A and - B is getting only the upstream and trailing sequences surroundng my target or do they get these along with the target sequences. I red the -- help page, but could not understand it. Thanks for any help.
use
--no-group-separator
instead of sedAre you confident this sequence will only appear once?
Actually it is much longer I only gives example...
let's try another way. Show us the output of:
Could you let me know what paste is doing ?
Thanks
Converting to a single line