| 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 243
243: def initialize(data)
244: @definition, *data = data.split(/\n/)
245: @data = {}
246: @sequence = ''
247:
248: pat = /;\s+([^:]+):\s+(.*)/
249:
250: data.each do |x|
251: if pat.match(x)
252: @data[$1] = $2
253: else
254: @sequence += x
255: end
256: end
257: 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 274
274: def entry_id
275: @definition[/\S+/]
276: 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 280
280: def length
281: @data['sq_len'].to_i
282: end
Returns ‘p’ for protein sequence, ‘D’ for nucleotide sequence.
# File lib/bio/appl/fasta/format10.rb, line 285
285: def moltype
286: @data['sq_type']
287: 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 291
291: def start
292: @data['al_start'].to_i
293: 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 297
297: def stop
298: @data['al_stop'].to_i
299: end