Module | Bio::Sequence::QualityScore::Solexa |
In: |
lib/bio/sequence/quality_score.rb
|
Bio::Sequence::QualityScore::Solexa is a module having quality calculation methods for the Solexa quality score.
BioRuby internal use only (mainly from Bio::Fastq).
convert_nothing | -> | convert_scores_from_solexa |
convert_nothing | -> | convert_scores_to_solexa |
convert_scores_from_phred_to_solexa | -> | convert_scores_from_phred |
convert_scores_from_solexa_to_phred | -> | convert_scores_to_phred |
Type of quality scores.
Returns: | (Symbol) the type of quality score. |
# File lib/bio/sequence/quality_score.rb, line 150 150: def quality_score_type 151: :solexa 152: end
Probability to Solexa score conversion.
Arguments:
Returns: | (Array containing Float) scores |
# File lib/bio/sequence/quality_score.rb, line 180 180: def solexa_p2q(probabilities) 181: probabilities.collect do |p| 182: t = p / (1.0 - p) 183: t = Float::MIN if t < Float::MIN 184: q = -10 * Math.log10(t) 185: q.finite? ? q.round : q 186: end 187: end
Solexa score to probability conversion.
Arguments:
Returns: | (Array containing Float) probabilities |
# File lib/bio/sequence/quality_score.rb, line 159 159: def solexa_q2p(scores) 160: scores.collect do |q| 161: t = 10 ** (- q / 10.0) 162: t /= (1.0 + t) 163: if t > 1.0 then 164: t = 1.0 165: #elsif t < 0.0 then 166: # t = 0.0 167: end 168: t 169: end 170: end