add 1/2 to fastq header
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
ADD COMMENT
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.

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

reformat.sh from BBTools can do what you want.

ADD COMMENT
0
Entering edit mode

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

ADD REPLY
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.

ADD REPLY
0
Entering edit mode

This can be achived with awk too.

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

Login before adding your answer.

Traffic: 1418 users visited in the last hour
Help About
FAQ
Access RSS
API
Stats

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.

Powered by the version 2.3.6