FASTQ header correction to remove .1 and .2 from paired end - SRA files
1
0
Entering edit mode
5 months ago

From this step as raw data:

@ERR797585640.1.1 1 length=151
ATATCGGGACGTGCGATCAGCACAAGCCGGCTATCGGTGTGGCGC

I have converted till this:

Read 1:

@ERR797585640.1.1
ATATCGGGACGTGCGATCAGCACAAGCCGGCTATCGGTGT

Read 2:

@ERR797585640.1.2
ATATCGGGACGTGCGATCAGCACAAGCCGGCTATCGGTGT

I have taken ERR and SRA samples for RnD.

But I want to keep only format as:

Read 1:

@ERR797585640.1
ATATCGGGACGTGCGATCAGCACAAGCCGGCTATCGGTGT

Read 2:

@ERR797585640.1
ATATCGGGACGTGCGATCAGCACAAGCCGGCTATCGGTGT

Kindly provide any commands or suggestion to remove and make changes for fastq headers

Fastq • 556 views
ADD COMMENT
1
Entering edit mode

I have converted till this:

how ? what was the command ?

ADD REPLY
0
Entering edit mode

I have used:

sed '/^@/ {s/ .*//}' SAMPLE to convert till @ERR797585640.1.1

But i need further guidance for next step

ADD REPLY
1
Entering edit mode

you cannot use '@' as the signal for the first line of a fastq file as @ can also be a symbol of quality

ADD REPLY
0
Entering edit mode

Please stop using "convert", you're using it wrong and your sentences don't make any sense.

ADD REPLY
2
Entering edit mode
5 months ago

Not sure it's a good idea to name both reads the same, but here's a perl oneliner to change your FASTQ headers:

perl -lne 'if(/^(@[^\.)]+\.\d+)\.\d/){ print "$1" } else { print }'

If you want to make sure only headers are affected, in case quality line starts with at:

perl -lne 'if($.%4==1 && /^(@[^\.)]+\.\d+)\.\d/){ print "$1" } else { print }'
ADD COMMENT
2
Entering edit mode

Some tools require both reads to have the same name (or least they want the part of the read name before the first whitespace to be the same).

ADD REPLY
0
Entering edit mode

IMPORTANT SIDE NOTE: This can break SRA download tools if you upload your files with identical read names. Surprisingly NCBI allows(ed?) this....I hope they changed it by now.

ADD REPLY

Login before adding your answer.

Traffic: 2222 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