Class | Bio::Fasta::Report::Hit::Query
In: | lib/bio/appl/fasta/format10.rb
Parent: | Object

### Methods

entry_id length moltype new start stop

### Attributes

data | [R] | Returns a Hash containing ‘sq_len’, ‘sq_offset’, ‘sq_type’, ‘al_start’, ‘al_stop’, and ‘al_display_start’ values. You can access most of these values by Report::Hit#query_* methods.
definition | [R] | Returns the definition of the entry as a String. You can access this value by Report::Hit#query_def method.
sequence | [R] | Returns the sequence (with gaps) as a String. You can access this value by the Report::Hit#query_seq method.

### Public Class methods

new(data)

[Source]

         # File lib/bio/appl/fasta/format10.rb, line 333
    333:       def initialize(data)
    334:         @definition, *data = data.split(/\n/)
    335:         @data = {}
    336:         @sequence = ''
    337:
    338:         pat = /;\s+([^:]+):\s+(.*)/
    339:
    340:         data.each do |x|
    341:           if pat.match(x)
    342:             @data[$1] = $2
    343:           else
    344:             @sequence += x
    345:           end
    346:         end
    347:       end

### Public Instance methods

entry_id()

Returns the first word in the definition as a String. You can get this value by Report::Hit#query_id method.

[Source]

         # File lib/bio/appl/fasta/format10.rb, line 364
    364:       def entry_id
    365:         @definition[/\S+/]
    366:       end

length()

Returns the sequence length. You can access this value by the Report::Hit#query_len method.

[Source]

         # File lib/bio/appl/fasta/format10.rb, line 370
    370:       def length
    371:         @data['sq_len'].to_i
    372:       end

moltype()

Returns ‘p’ for protein sequence, ‘D’ for nucleotide sequence.

[Source]

         # File lib/bio/appl/fasta/format10.rb, line 375
    375:       def moltype
    376:         @data['sq_type']
    377:       end

start()

Returns alignment start position. You can also access this value by Report::Hit#query_start method for shortcut.

[Source]

         # File lib/bio/appl/fasta/format10.rb, line 381
    381:       def start
    382:         @data['al_start'].to_i
    383:       end

stop()

Returns alignment end position. You can access this value by Report::Hit#query_end method for shortcut.

[Source]

         # File lib/bio/appl/fasta/format10.rb, line 387
    387:       def stop
    388:         @data['al_stop'].to_i
    389:       end

[Validate]