I am using pileup function in Rsamtools version 1.22.0. The bam file that I used as an input to the function has Illumina1.3+ based (phred64) scoring scheme. So I wish to know if there is any way to specify the phred scoring scheme to pileup function via pileupParam or scanBamParam. Does it decode the phred scoring automatically?
Quality scores in the BAM file are stored as the ASCII code of the letter. You're supposed to provide an integer value such that 33 + min_base_quality is the relevant ASCII character, whatever your encoding scheme. From Wikipedia the lowest quality Illumina1.3+ ASCII letter is '@', which has ASCII coding 64, which in turn is 31 more than the reference 33. If you wanted nucleotides with score 9 or more (ASCII character 'I' coding 73, 40 more than the reference 33) you'd specify min_base_qual=40. At least I think that's how it works...
I created a function to map from integer or ASCII PHRED score to offset; it will be included in the next release (1.24.0) of Rsamtools.
Thank you Martin for your suggestion! I will try out this. Does anybody else have experienced this problem before?