In fastq file of Illumina 1.3+,quality score = Phred quality +64, which equal solexa quality+64 early, so i should change some code to deal with new solexa data.
but some calculation is puzzling.
Given a character $sq, the following Perl code gives the Phred quality $Q:
$Q = 10 * log(1 + 10 ** (ord($sq) - 64) / 10.0)) / log(10);
So it is easy to conver Solexa->Sanger quality
my @conv_table;
for (-64..64) {
$conv_table[$_+64] = chr(int(33 + 10*log(1+10**($_/10.0))/log(10)+.499));
}
but i do not understand where is 0.499 from. i think it should be
conv_table[$_+64] = chr(int(33 + 10*log(1+10**($_/10.0))/log(10)))
but some calculation is puzzling.
Given a character $sq, the following Perl code gives the Phred quality $Q:
$Q = 10 * log(1 + 10 ** (ord($sq) - 64) / 10.0)) / log(10);
So it is easy to conver Solexa->Sanger quality
my @conv_table;
for (-64..64) {
$conv_table[$_+64] = chr(int(33 + 10*log(1+10**($_/10.0))/log(10)+.499));
}
but i do not understand where is 0.499 from. i think it should be
conv_table[$_+64] = chr(int(33 + 10*log(1+10**($_/10.0))/log(10)))
Comment