Class | Bio::Fasta::Report::Hit::Query |
In: |
lib/bio/appl/fasta/format10.rb
|
Parent: | Object |
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. |
# 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
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, line 364 364: def entry_id 365: @definition[/\S+/] 366: end
Returns the sequence length. You can access this value by the Report::Hit#query_len method.
# File lib/bio/appl/fasta/format10.rb, line 370 370: def length 371: @data['sq_len'].to_i 372: end
Returns ‘p’ for protein sequence, ‘D’ for nucleotide sequence.
# File lib/bio/appl/fasta/format10.rb, line 375 375: def moltype 376: @data['sq_type'] 377: 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, line 381 381: def start 382: @data['al_start'].to_i 383: 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, line 387 387: def stop 388: @data['al_stop'].to_i 389: end