This is a test version of Biostars. For the public version, visit https://www.biostars.org.
Convert Phred score 41 to 40

I need to convert new data (Illumina 1.8+) to 454 format (old Sanger).

According to this page (http://www.dylanstorey.com/node/54), only difference in these two formats is that new Illumina can have score 41 (letter J), whereas old Sanger goes only up to 40. Is there any tool to convert all 41 scores to 40 (letter I) in fastq?

fastq

Its not the same question as I am not interested in converting ASCII-64 to Sanger score (ASCII-33). Instead, both my formats are in ASCII-33 (Sanger), just one goes from 0..41 and second from 0..40

2 answers

Is this what you want?

cat <your-fastq-file> | awk ' {if(NR %4 == 0) {gsub("J","I");print} else {print}}'

If it is a .gz file, use zcat to read it and gzip to zip it back.

If you don't care about converting all the 'J's to 'I's (slightly lowering the scores of some bases), you can use sed:

sed -e '4~4y/J/I/' fastqfile.fastq > fastqfile.illuminaphred.fastq

You can also add the -i option to modify the file in place, without having to copy it to fastqfile.illuminaphred.fastq.

Log in to answer this question.