1
0
Entering edit mode
8 weeks ago
reaset41 • 0

How do I add a 1 or 2 to the header of a fastq read file? To specify if it is from the R1 or R2 file

fastq • 362 views
1
Entering edit mode

the fastq file format does not have headers or file comments. This is usually disambiguated by naming the first-read file so it has the suffix suffix "_R1.fq.gz" or "_1.fq.gz" and similarly for the second-read file.

1
Entering edit mode
8 weeks ago
Mensur Dlakic ★ 22k

reformat.sh from BBTools can do what you want.

0
Entering edit mode

This will add /1 /2 to the individual reads....which might be what the user actually wants?

2
Entering edit mode

There is no global header in FASTQ files, only headers of individual reads. I think it is a safe assumption that adding to individual headers is a desired outcome.

0
Entering edit mode

This can be achived with awk too.

zcat myfastq.gz | awk '/^@/{$0=$0"TexIWantToAdd"} 1'