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 150
    150:       def quality_score_type
    151:         :solexa
    152:       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 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_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 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

[Validate]