Class: Bio::HMMER::Report::Hsp
Overview
Container class for HMMER search hsps.
Instance Attribute Summary collapse
-
#accession ⇒ Object
(also: #target_id)
readonly
Returns the value of attribute accession.
-
#csline ⇒ Object
readonly
CS Line.
-
#domain ⇒ Object
readonly
Returns the value of attribute domain.
-
#evalue ⇒ Object
readonly
E-value.
-
#flatseq ⇒ Object
readonly
Returns the value of attribute flatseq.
-
#hmm_f ⇒ Object
readonly
Returns the value of attribute hmm_f.
-
#hmm_ft ⇒ Object
readonly
Returns the value of attribute hmm_ft.
-
#hmm_t ⇒ Object
readonly
Returns the value of attribute hmm_t.
-
#hmmseq ⇒ Object
readonly
Returns the value of attribute hmmseq.
-
#midline ⇒ Object
readonly
Alignment midline.
-
#query_frame ⇒ Object
readonly
Returns the value of attribute query_frame.
-
#rfline ⇒ Object
readonly
RF Line.
-
#score ⇒ Object
(also: #bit_score)
readonly
Score.
-
#seq_f ⇒ Object
readonly
Returns the value of attribute seq_f.
-
#seq_ft ⇒ Object
readonly
Returns the value of attribute seq_ft.
-
#seq_t ⇒ Object
readonly
Returns the value of attribute seq_t.
-
#target_frame ⇒ Object
readonly
Returns the value of attribute target_frame.
Instance Method Summary collapse
-
#initialize(hsp_data, is_hmmsearch) ⇒ Hsp
constructor
Sets hsps.
- #query_from ⇒ Object
- #query_seq ⇒ Object
- #query_to ⇒ Object
- #set_alignment(alignment) ⇒ Object
- #target_from ⇒ Object
- #target_seq ⇒ Object
- #target_to ⇒ Object
Constructor Details
#initialize(hsp_data, is_hmmsearch) ⇒ Hsp
Sets hsps.
483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 |
# File 'lib/bio/appl/hmmer/report.rb', line 483 def initialize(hsp_data, is_hmmsearch) @is_hmmsearch = is_hmmsearch @accession, @domain, seq_f, seq_t, @seq_ft, hmm_f, hmm_t, @hmm_ft,\ score, evalue = hsp_data.split(' ') @seq_f = seq_f.to_i @seq_t = seq_t.to_i @hmm_f = hmm_f.to_i @hmm_t = hmm_t.to_i @score = score.to_f @evalue = evalue.to_f @hmmseq = '' @flatseq = '' @midline = '' @query_frame = 1 @target_frame = 1 # CS and RF lines are rarely used. @csline = nil @rfline = nil end |
Instance Attribute Details
#accession ⇒ Object (readonly) Also known as: target_id
Returns the value of attribute accession.
430 431 432 |
# File 'lib/bio/appl/hmmer/report.rb', line 430 def accession @accession end |
#csline ⇒ Object (readonly)
CS Line
477 478 479 |
# File 'lib/bio/appl/hmmer/report.rb', line 477 def csline @csline end |
#domain ⇒ Object (readonly)
Returns the value of attribute domain.
434 435 436 |
# File 'lib/bio/appl/hmmer/report.rb', line 434 def domain @domain end |
#evalue ⇒ Object (readonly)
E-value
459 460 461 |
# File 'lib/bio/appl/hmmer/report.rb', line 459 def evalue @evalue end |
#flatseq ⇒ Object (readonly)
Returns the value of attribute flatseq.
468 469 470 |
# File 'lib/bio/appl/hmmer/report.rb', line 468 def flatseq @flatseq end |
#hmm_f ⇒ Object (readonly)
Returns the value of attribute hmm_f.
446 447 448 |
# File 'lib/bio/appl/hmmer/report.rb', line 446 def hmm_f @hmm_f end |
#hmm_ft ⇒ Object (readonly)
Returns the value of attribute hmm_ft.
452 453 454 |
# File 'lib/bio/appl/hmmer/report.rb', line 452 def hmm_ft @hmm_ft end |
#hmm_t ⇒ Object (readonly)
Returns the value of attribute hmm_t.
449 450 451 |
# File 'lib/bio/appl/hmmer/report.rb', line 449 def hmm_t @hmm_t end |
#hmmseq ⇒ Object (readonly)
Returns the value of attribute hmmseq.
465 466 467 |
# File 'lib/bio/appl/hmmer/report.rb', line 465 def hmmseq @hmmseq end |
#midline ⇒ Object (readonly)
Alignment midline
462 463 464 |
# File 'lib/bio/appl/hmmer/report.rb', line 462 def midline @midline end |
#query_frame ⇒ Object (readonly)
Returns the value of attribute query_frame.
471 472 473 |
# File 'lib/bio/appl/hmmer/report.rb', line 471 def query_frame @query_frame end |
#rfline ⇒ Object (readonly)
RF Line
480 481 482 |
# File 'lib/bio/appl/hmmer/report.rb', line 480 def rfline @rfline end |
#score ⇒ Object (readonly) Also known as: bit_score
Score
455 456 457 |
# File 'lib/bio/appl/hmmer/report.rb', line 455 def score @score end |
#seq_f ⇒ Object (readonly)
Returns the value of attribute seq_f.
437 438 439 |
# File 'lib/bio/appl/hmmer/report.rb', line 437 def seq_f @seq_f end |
#seq_ft ⇒ Object (readonly)
Returns the value of attribute seq_ft.
443 444 445 |
# File 'lib/bio/appl/hmmer/report.rb', line 443 def seq_ft @seq_ft end |
#seq_t ⇒ Object (readonly)
Returns the value of attribute seq_t.
440 441 442 |
# File 'lib/bio/appl/hmmer/report.rb', line 440 def seq_t @seq_t end |
#target_frame ⇒ Object (readonly)
Returns the value of attribute target_frame.
474 475 476 |
# File 'lib/bio/appl/hmmer/report.rb', line 474 def target_frame @target_frame end |
Instance Method Details
#query_from ⇒ Object
550 551 552 |
# File 'lib/bio/appl/hmmer/report.rb', line 550 def query_from @is_hmmsearch ? @hmm_f : @seq_f end |
#query_seq ⇒ Object
530 531 532 |
# File 'lib/bio/appl/hmmer/report.rb', line 530 def query_seq @is_hmmsearch ? @hmmseq : @flatseq end |
#query_to ⇒ Object
555 556 557 |
# File 'lib/bio/appl/hmmer/report.rb', line 555 def query_to @is_hmmsearch ? @hmm_t : @seq_t end |
#set_alignment(alignment) ⇒ Object
505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 |
# File 'lib/bio/appl/hmmer/report.rb', line 505 def set_alignment(alignment) # First, split the input alignment into an array of # "alignment blocks." One block usually has three lines, # i.e. hmmseq, midline and flatseq. # However, although infrequent, it can contain CS or RF lines. alignment.split(/ (?:\d+|-)\s*\n\n/).each do |blk| lines = blk.split(/\n/) cstmp = (lines[0] =~ /^ {16}CS/) ? lines.shift : nil rftmp = (lines[0] =~ /^ {16}RF/) ? lines.shift : nil aln_width = lines[0][/\S+/].length @csline = @csline.to_s + cstmp[19, aln_width] if cstmp @rfline = @rfline.to_s + rftmp[19, aln_width] if rftmp @hmmseq += lines[0][19, aln_width] @midline += lines[1][19, aln_width] @flatseq += lines[2][19, aln_width] end @csline = @csline[3...-3] if @csline @rfline = @rfline[3...-3] if @rfline @hmmseq = @hmmseq[3...-3] @midline = @midline[3...-3] @flatseq = @flatseq[3...-3] end |
#target_from ⇒ Object
540 541 542 |
# File 'lib/bio/appl/hmmer/report.rb', line 540 def target_from @is_hmmsearch ? @seq_f : @hmm_f end |
#target_seq ⇒ Object
535 536 537 |
# File 'lib/bio/appl/hmmer/report.rb', line 535 def target_seq @is_hmmsearch ? @flatseq : @hmmseq end |
#target_to ⇒ Object
545 546 547 |
# File 'lib/bio/appl/hmmer/report.rb', line 545 def target_to @is_hmmsearch ? @seq_t : @hmm_t end |