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).

### Methods

p2q q2p quality_score_type solexa_p2q solexa_q2p

### Included Modules

Converter

### External Aliases

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

### Public Instance methods

p2q(probabilities)

Alias for solexa_p2q

q2p(scores)

Alias for solexa_q2p

quality_score_type()

Type of quality scores.

Returns: | (Symbol) the type of quality score.

[Source]

         # File lib/bio/sequence/quality_score.rb, line 152
    152:       def quality_score_type
    153:         :solexa
    154:       end

solexa_p2q(probabilities)

Probability to Solexa score conversion.

Arguments:

- (required) probabilities: (Array containing Float) probabilities

Returns: | (Array containing Float) scores

[Source]

         # 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_q2p(scores)

Solexa score to probability conversion.

Arguments:

- (required) scores: (Array containing Integer) scores

Returns: | (Array containing Float) probabilities

[Source]

         # 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

[Validate]