Class: Bio::HMMER::Report::Hit
Overview
Container class for HMMER search hits.
Instance Attribute Summary collapse
-
#accession ⇒ Object
(also: #target_id, #hit_id, #entry_id)
readonly
Returns the value of attribute accession.
-
#description ⇒ Object
(also: #definition)
readonly
Returns the value of attribute description.
-
#evalue ⇒ Object
readonly
E-value.
-
#hsps ⇒ Object
readonly
An Array of Bio::HMMER::Report::Hsp objects.
-
#num ⇒ Object
readonly
Number of domains.
-
#score ⇒ Object
(also: #bit_score)
readonly
Matching scores (total of all HSPs).
Instance Method Summary collapse
-
#append_hsp(hsp) ⇒ Object
Appends a Bio::HMMER::Report::Hsp object.
-
#each ⇒ Object
(also: #each_hsp)
Iterates on each Hsp object (Bio::HMMER::Report::Hsp).
-
#initialize(hit_data) ⇒ Hit
constructor
Sets hit data.
-
#target_def ⇒ Object
Shows the hit description.
Constructor Details
#initialize(hit_data) ⇒ Hit
Sets hit data.
391 392 393 394 395 396 397 |
# File 'lib/bio/appl/hmmer/report.rb', line 391 def initialize(hit_data) @hsps = Array.new if /^(\S+)\s+(.*?)\s+(\S+)\s+(\S+)\s+(\S+)$/ =~ hit_data @accession, @description, @score, @evalue, @num = \ [$1, $2, $3.to_f, $4.to_f, $5.to_i] end end |
Instance Attribute Details
#accession ⇒ Object (readonly) Also known as: target_id, hit_id, entry_id
Returns the value of attribute accession.
371 372 373 |
# File 'lib/bio/appl/hmmer/report.rb', line 371 def accession @accession end |
#description ⇒ Object (readonly) Also known as: definition
Returns the value of attribute description.
377 378 379 |
# File 'lib/bio/appl/hmmer/report.rb', line 377 def description @description end |
#evalue ⇒ Object (readonly)
E-value
385 386 387 |
# File 'lib/bio/appl/hmmer/report.rb', line 385 def evalue @evalue end |
#hsps ⇒ Object (readonly)
An Array of Bio::HMMER::Report::Hsp objects.
368 369 370 |
# File 'lib/bio/appl/hmmer/report.rb', line 368 def hsps @hsps end |
#num ⇒ Object (readonly)
Number of domains
388 389 390 |
# File 'lib/bio/appl/hmmer/report.rb', line 388 def num @num end |
#score ⇒ Object (readonly) Also known as: bit_score
Matching scores (total of all HSPs).
381 382 383 |
# File 'lib/bio/appl/hmmer/report.rb', line 381 def score @score end |
Instance Method Details
#append_hsp(hsp) ⇒ Object
Appends a Bio::HMMER::Report::Hsp object.
419 420 421 |
# File 'lib/bio/appl/hmmer/report.rb', line 419 def append_hsp(hsp) @hsps << hsp end |
#each ⇒ Object Also known as: each_hsp
Iterates on each Hsp object (Bio::HMMER::Report::Hsp).
401 402 403 404 405 |
# File 'lib/bio/appl/hmmer/report.rb', line 401 def each @hsps.each do |hsp| yield hsp end end |
#target_def ⇒ Object
Shows the hit description.
410 411 412 413 414 415 416 |
# File 'lib/bio/appl/hmmer/report.rb', line 410 def target_def if @hsps.size == 1 "<#{@hsps[0].domain}> #{@description}" else "<#{@num.to_s}> #{@description}" end end |