class Bio::Fasta::Report::Hit::Query

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 Bio::Fasta::Report::Hit#query_def method.

sequence[R]

Returns the sequence (with gaps) as a String. You can access this value by the Bio::Fasta::Report::Hit#query_seq method.

Public Class Methods

new(data) click to toggle source
# File lib/bio/appl/fasta/format10.rb, line 333
def initialize(data)
  @definition, *data = data.split(/\n/)
  @data = {}
  @sequence = ''

  pat = /;\s+([^:]+):\s+(.*)/

  data.each do |x|
    if pat.match(x)
      @data[$1] = $2
    else
      @sequence += x
    end
  end
end

Public Instance Methods

entry_id() click to toggle source

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

# File lib/bio/appl/fasta/format10.rb, line 364
def entry_id
  @definition[/\S+/]
end
length() click to toggle source

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

# File lib/bio/appl/fasta/format10.rb, line 370
def length
  @data['sq_len'].to_i
end
moltype() click to toggle source

Returns 'p' for protein sequence, 'D' for nucleotide sequence.

# File lib/bio/appl/fasta/format10.rb, line 375
def moltype
  @data['sq_type']
end
start() click to toggle source

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

# File lib/bio/appl/fasta/format10.rb, line 381
def start
  @data['al_start'].to_i
end
stop() click to toggle source

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

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