Module: Bio::Sequence::QualityScore::Solexa
- Includes:
- Converter
- Included in:
- Fastq::FormatData::FASTQ_SOLEXA
- Defined in:
- lib/bio/sequence/quality_score.rb
Overview
Bio::Sequence::QualityScore::Solexa is a module having quality calculation methods for the Solexa quality score.
BioRuby internal use only (mainly from Bio::Fastq).
Instance Method Summary (collapse)
-
- (Object) quality_score_type
Type of quality scores.
-
- (Object) solexa_p2q(probabilities)
(also: #p2q)
Probability to Solexa score conversion.
-
- (Object) solexa_q2p(scores)
(also: #q2p)
Solexa score to probability conversion.
Methods included from Converter
#convert_nothing, #convert_scores_from_phred_to_solexa, #convert_scores_from_solexa_to_phred
Instance Method Details
- (Object) quality_score_type
Type of quality scores.
Returns |
(Symbol) the type of quality score. |
150 151 152 |
# File 'lib/bio/sequence/quality_score.rb', line 150 def quality_score_type :solexa end |
- (Object) solexa_p2q(probabilities) Also known as: p2q
Probability to Solexa score conversion.
Arguments:
-
(required) probabilities: (Array containing Float) probabilities
Returns |
(Array containing Float) scores |
180 181 182 183 184 185 186 187 |
# File 'lib/bio/sequence/quality_score.rb', line 180 def solexa_p2q(probabilities) probabilities.collect do |p| t = p / (1.0 - p) t = Float::MIN if t < Float::MIN q = -10 * Math.log10(t) q.finite? ? q.round : q end end |
- (Object) solexa_q2p(scores) Also known as: q2p
Solexa score to probability conversion.
Arguments:
-
(required) scores: (Array containing Integer) scores
Returns |
(Array containing Float) probabilities |
159 160 161 162 163 164 165 166 167 168 169 170 |
# File 'lib/bio/sequence/quality_score.rb', line 159 def solexa_q2p(scores) scores.collect do |q| t = 10 ** (- q / 10.0) t /= (1.0 + t) if t > 1.0 then t = 1.0 #elsif t < 0.0 then # t = 0.0 end t end end |