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 152 152: def quality_score_type 153: :solexa 154: end
Probability to Solexa score conversion.
Arguments:
Returns: | (Array containing Float) scores |
# File lib/bio/sequence/quality_score.rb, line 182 182: def solexa_p2q(probabilities) 183: probabilities.collect do |p| 184: t = p / (1.0 - p) 185: t = Float::MIN if t < Float::MIN 186: q = -10 * Math.log10(t) 187: q.finite? ? q.round : q 188: end 189: end
Solexa score to probability conversion.
Arguments:
Returns: | (Array containing Float) probabilities |
# File lib/bio/sequence/quality_score.rb, line 161 161: def solexa_q2p(scores) 162: scores.collect do |q| 163: t = 10 ** (- q / 10.0) 164: t /= (1.0 + t) 165: if t > 1.0 then 166: t = 1.0 167: #elsif t < 0.0 then 168: # t = 0.0 169: end 170: t 171: end 172: end