Module Bio::Sequence::QualityScore::Converter
In: lib/bio/sequence/quality_score.rb

Converter methods between PHRED and Solexa quality scores.

Methods

Public Instance methods

Does nothing and simply returns the given argument.


Arguments:

  • (required) scores: (Array containing Integer) quality scores
Returns:(Array containing Integer) quality scores

[Source]

    # File lib/bio/sequence/quality_score.rb, line 70
70:       def convert_nothing(scores)
71:         scores
72:       end

Converts PHRED scores to Solexa scores.

The values may be truncated or incorrect if overflows/underflows occurred during the calculation.


Arguments:

  • (required) scores: (Array containing Integer) quality scores
Returns:(Array containing Integer) quality scores

[Source]

    # File lib/bio/sequence/quality_score.rb, line 38
38:       def convert_scores_from_phred_to_solexa(scores)
39:         sc = scores.collect do |q|
40:           t = 10 ** (q / 10.0) - 1
41:           t = Float::MIN if t < Float::MIN
42:           r = 10 * Math.log10(t)
43:           r.finite? ? r.round : r
44:         end
45:         sc
46:       end

Converts Solexa scores to PHRED scores.

The values may be truncated if overflows/underflows occurred during the calculation.


Arguments:

  • (required) scores: (Array containing Integer) quality scores
Returns:(Array containing Integer) quality scores

[Source]

    # File lib/bio/sequence/quality_score.rb, line 56
56:       def convert_scores_from_solexa_to_phred(scores)
57:         sc = scores.collect do |q|
58:           r = 10 * Math.log10(10 ** (q / 10.0) + 1)
59:           r.finite? ? r.round : r
60:         end
61:         sc
62:       end

[Validate]