This is a test version of Biostars. For the public version, visit https://www.biostars.org.
Header change in NCBI SRR files

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

1 answer

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"

Log in to answer this question.