add 1/2 to fastq header
1
0
Entering edit mode
24 months 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 • 1.4k 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
24 months ago
Mensur Dlakic ★ 28k

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: 1306 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