class Bio::Fasta::Report::Hit::Query
Attributes
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.
Returns the definition of the entry as a String. You can access this value by Report::Hit#query_def
method.
Returns the sequence (with gaps) as a String. You can access this value by the Report::Hit#query_seq
method.
Public Class Methods
# File lib/bio/appl/fasta/format10.rb 334 def initialize(data) 335 @definition, *data = data.split(/\n/) 336 @data = {} 337 @sequence = '' 338 339 pat = /;\s+([^:]+):\s+(.*)/ 340 341 data.each do |x| 342 if pat.match(x) 343 @data[$1] = $2 344 else 345 @sequence += x 346 end 347 end 348 end
Public Instance Methods
Returns the first word in the definition as a String. You can get this value by Report::Hit#query_id
method.
# File lib/bio/appl/fasta/format10.rb 365 def entry_id 366 @definition[/\S+/] 367 end
Returns the sequence length. You can access this value by the Report::Hit#query_len
method.
# File lib/bio/appl/fasta/format10.rb 371 def length 372 @data['sq_len'].to_i 373 end
Returns ‘p’ for protein sequence, ‘D’ for nucleotide sequence.
# File lib/bio/appl/fasta/format10.rb 376 def moltype 377 @data['sq_type'] 378 end
Returns alignment start position. You can also access this value by Report::Hit#query_start
method for shortcut.
# File lib/bio/appl/fasta/format10.rb 382 def start 383 @data['al_start'].to_i 384 end
Returns alignment end position. You can access this value by Report::Hit#query_end
method for shortcut.
# File lib/bio/appl/fasta/format10.rb 388 def stop 389 @data['al_stop'].to_i 390 end