Class | Bio::FastaNumericFormat
In: | lib/bio/db/fasta/qual.rb
Parent: | FastaFormat

Treats a FASTA formatted numerical entry, such as:

      >id and/or some comments                    <== comment line
      24 15 23 29 20 13 20 21 21 23 22 25 13      <== numerical data
      22 17 15 25 27 32 26 32 29 29 25

The precedent ’>’ can be omitted and the trailing ’>’ will be removed automatically.

— Bio::FastaNumericFormat.new(entry)

Stores the comment and the list of the numerical data.

— Bio::FastaNumericFormat#definition

The comment line of the FASTA formatted data.

- FASTA format (Wikipedia) en.wikipedia.org/wiki/FASTA_format
- Phred quality score (WikiPedia) en.wikipedia.org/wiki/Phred_quality_score

### Methods

[] data each length

### Public Instance methods

[](n)

Returns the n-th element. If out of range, returns nil.

Arguments:

- (required) n: (Integer) position

Returns: | (Integer or nil) the value

[Source]

        # File lib/bio/db/fasta/qual.rb, line 94
    94:     def [](n)
    95:       data[n]
    96:     end

data()

Returns the list of the numerical data (typically the quality score of its corresponding sequence) as an Array.

Returns: | (Array containing Integer) numbers

[Source]

        # File lib/bio/db/fasta/qual.rb, line 64
    64:     def data
    65:       unless defined?(@list)
    66:         @list = @data.strip.split(/\s+/).map {|x| x.to_i}
    67:       end
    68:       @list
    69:     end

each() {|x| ...}

Yields on each elements of the numerical data.

Yields: | (Integer) a numerical data element
Returns: | (undefined)

[Source]

        # File lib/bio/db/fasta/qual.rb, line 83
    83:     def each
    84:       data.each do |x|
    85:         yield x
    86:       end
    87:     end

length()

Returns the number of elements in the numerical data, which will be the same of its corresponding sequence length.

Returns: | (Integer) the number of elements

[Source]

        # File lib/bio/db/fasta/qual.rb, line 75
    75:     def length
    76:       data.length
    77:     end

[Validate]