Class Bio::FastaNumericFormat
In: lib/bio/db/fasta.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.

Methods

[]   data   each   length  

Public Instance methods

Returns the n-th element.

[Source]

     # File lib/bio/db/fasta.rb, line 319
319:     def [](n)
320:       data[n]
321:     end

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

[Source]

     # File lib/bio/db/fasta.rb, line 299
299:     def data
300:       unless @list
301:         @list = @data.strip.split(/\s+/).map {|x| x.to_i}
302:       end
303:       @list
304:     end

Yields on each elements of the numerical data.

[Source]

     # File lib/bio/db/fasta.rb, line 312
312:     def each
313:       data.each do |x|
314:         yield x
315:       end
316:     end

Returns the number of elements in the numerical data.

[Source]

     # File lib/bio/db/fasta.rb, line 307
307:     def length
308:       data.length
309:     end

[Validate]