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

Converter methods between PHRED and Solexa quality scores.

### Methods

convert_nothing convert_scores_from_phred_to_solexa convert_scores_from_solexa_to_phred

### Public Instance methods

convert_nothing(scores)

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 72
    72:       def convert_nothing(scores)
    73:         scores
    74:       end

convert_scores_from_phred_to_solexa(scores)

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 40
    40:       def convert_scores_from_phred_to_solexa(scores)
    41:         sc = scores.collect do |q|
    42:           t = 10 ** (q / 10.0) - 1
    43:           t = Float::MIN if t < Float::MIN
    44:           r = 10 * Math.log10(t)
    45:           r.finite? ? r.round : r
    46:         end
    47:         sc
    48:       end

convert_scores_from_solexa_to_phred(scores)

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 58
    58:       def convert_scores_from_solexa_to_phred(scores)
    59:         sc = scores.collect do |q|
    60:           r = 10 * Math.log10(10 ** (q / 10.0) + 1)
    61:           r.finite? ? r.round : r
    62:         end
    63:         sc
    64:       end

[Validate]