Header change in NCBI SRR files
1
0
Entering edit mode
17 months ago

Hi all

I have downloaded some SRR and ERR fastq files for my research purpose and I would like to change the headers in SRR files. It would be helpful if any one suggest some possible ways to change it.

Example header seq present in fastq file

@SRR1969129.2 2 length=150

@SRR1969129.3 3 length=150

I would like to change it like:

@SRR1969129-2-2

@SRR1969129-3-3

SRR SRA NCBI Fastq Header • 401 views
ADD COMMENT
1
Entering edit mode
17 months ago
Anda ▴ 10

you can try this sed:

sed -i "s/ length=150//g ; s/ /-/g ; s/\./-/g"  YOUR_FASTQ_FILE

explanation: first, space and the following length=150 is removed then the remaining space is replaced with "-" and finally the "." is replaced with "-". all happens in place due to the "sed -i"

ADD COMMENT

Login before adding your answer.

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