Hi,
I want to change my fastq file
@1/1
GTCGCTGACGAGCGAGTACT
+SRR00000.1 1 length=150
FFFFFFFFFFFFFFFFFFFFFFFF
into something like
@SRR00000.1 1 length=150
GTCGCTGACGAGCGAGTACT
+SRR00000.1 1 length=150
FFFFFFFFFFFFFFFFFFFFFFFF
Replacing header line with third line. Iam trying something like this awk 'NR%4==1 {$0=$3} {print}' but ofcourse $3 would be empty in the start so it gives empty header line.
Any help with awk command or anything else would be really appreciated?
Thanks
1 answer
gunzip -c in.fq.gz | paste - - - - | awk -F '\t' '{OFS="\n";$3=sprintf("+%s",substr($1,2));print;}'
Thankyou, can you please explain this? specially | paste - - - - | part? Plus we also need to replace + with @ here
Plus we also need to replace + with @ here
ah yes, fixed.
specially | paste - - - -
"Combining N consecutive lines" https://www.geeksforgeeks.org/paste-command-in-linux-with-examples/
Thank you so much. With little update in line numbers, it's perfect.
gunzip -c in.fq.gz | paste - - - - | awk -F '\t' '{OFS="\n";$1=sprintf("@%s",substr($3,2));print;}'
Log in to answer this question.