Register FAQ Members List Calendar Search Today's Posts Mark Forums Read

 Similar Threads Thread Thread Starter Forum Replies Last Post nii 454 Pyrosequencing 4 10-15-2020 06:29 AM jmugford Bioinformatics 1 08-12-2011 05:18 PM captainentropy Bioinformatics 3 09-13-2010 09:42 PM baohua100 Bioinformatics 2 03-28-2009 05:52 PM baohua100 Bioinformatics 1 02-19-2009 09:21 AM

 06-08-2010, 07:59 AM #1 biocc Member   Location: beijing Join Date: Jul 2008 Posts: 35 prhed score 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)))
 06-08-2010, 08:10 AM #2 Bio.X2Y Member   Location: Europe Join Date: Apr 2010 Posts: 46 It looks like whoever wrote the code just wanted to round the answer to the nearest whole number (since int() on its own always rounds down). int(3.1) -> 3 int(3.5) -> 3 int(3.9) -> 3 by adding 0.5 (or in this case 0.499) and then int(), you are rounding to the nearest whole number. int (3.9 + 0.5) -> 4 Not sure why they are using 0.499 instead of 0.5.