Class: Quality
- Inherits:
-
String
- Object
- String
- Quality
- Defined in:
- lib/parse_fasta/quality.rb
Overview
Provide some methods for dealing with common tasks regarding quality strings.
Instance Method Summary collapse
-
#mean_qual ⇒ Float
Returns the mean quality for the record.
-
#qual_scores ⇒ Array<Fixnum>
Returns an array of illumina style quality scores.
Instance Method Details
#mean_qual ⇒ Float
Returns the mean quality for the record. This will be a good deal faster than getting the average with qual_scores and reduce.
29 30 31 |
# File 'lib/parse_fasta/quality.rb', line 29 def mean_qual (self.sum - (self.length * 33)) / self.length.to_f end |
#qual_scores ⇒ Array<Fixnum>
Returns an array of illumina style quality scores. The quality scores generated will be Phred+33 (i.e., new Illumina).
40 41 42 |
# File 'lib/parse_fasta/quality.rb', line 40 def qual_scores self.each_byte.map { |b| b - 33 } end |