Class: Bio::Sim4::Report::Hit
Overview
Hit object of the sim4 result. Similar to Bio::Blast::Report::Hit but lacks many methods.
Instance Attribute Summary collapse
-
#seq1 ⇒ Object
readonly
Returns sequence informations of ‘seq1’.
-
#seq2 ⇒ Object
readonly
Returns sequence informations of ‘seq2’.
Instance Method Summary collapse
-
#align ⇒ Object
Returns alignments.
-
#complement? ⇒ Boolean
Returns true if the hit reports ‘-’(complemental) strand search result.
-
#each(&x) ⇒ Object
Iterates over each exon of the hit.
-
#exons ⇒ Object
(also: #hsps)
Returns exons of the hit.
-
#initialize(str) ⇒ Hit
constructor
Parses part of sim4 result text and creates a new Hit object.
-
#introns ⇒ Object
Returns introns of the hit.
-
#query_def ⇒ Object
Definition of the query sequence Same as Bio::Sim4::Report#query_def.
-
#query_id ⇒ Object
Identifier of the query sequence.
-
#query_len ⇒ Object
Length of the query sequence.
-
#segmentpairs ⇒ Object
Returns segment pairs (exons and introns) of the hit.
-
#target_def ⇒ Object
(also: #definition)
Definition of the hit(target) sequence.
-
#target_id ⇒ Object
(also: #hit_id)
Identifier of the hit(target) sequence.
-
#target_len ⇒ Object
(also: #len)
length of the hit(target) sequence.
Constructor Details
#initialize(str) ⇒ Hit
Parses part of sim4 result text and creates a new Hit object. It is designed to be called internally from Bio::Sim4::Report class. Users shall not use it directly.
273 274 275 276 |
# File 'lib/bio/appl/sim4/report.rb', line 273 def initialize(str) @data = str.split(/\n(?:\r?\n)+/) parse_seqdesc end |
Instance Attribute Details
#seq1 ⇒ Object (readonly)
Returns sequence informations of ‘seq1’. Returns a Bio::Sim4::Report::SeqDesc object. This would be Bio::Sim4 specific method.
302 303 304 |
# File 'lib/bio/appl/sim4/report.rb', line 302 def seq1 @seq1 end |
#seq2 ⇒ Object (readonly)
Returns sequence informations of ‘seq2’. Returns a Bio::Sim4::Report::SeqDesc object. This would be Bio::Sim4 specific method.
307 308 309 |
# File 'lib/bio/appl/sim4/report.rb', line 307 def seq2 @seq2 end |
Instance Method Details
#align ⇒ Object
Returns alignments. Returns an Array of arrays. Each array contains sequence of seq1, midline, sequence of seq2, respectively. This would be a Bio::Sim4 specific method.
432 433 434 435 |
# File 'lib/bio/appl/sim4/report.rb', line 432 def align unless defined?(@align); parse_align; end @align end |
#complement? ⇒ Boolean
Returns true if the hit reports ‘-’(complemental) strand search result. Otherwise, return false or nil. This would be a Bio::Sim4 specific method.
313 314 315 |
# File 'lib/bio/appl/sim4/report.rb', line 313 def complement? @complement end |
#each(&x) ⇒ Object
Iterates over each exon of the hit. Yields a Bio::Sim4::Report::SegmentPair object.
470 471 472 |
# File 'lib/bio/appl/sim4/report.rb', line 470 def each(&x) #:yields: segmentpair exons.each(&x) end |
#exons ⇒ Object Also known as: hsps
Returns exons of the hit. Each exon is a Bio::Sim4::Report::SegmentPair object.
402 403 404 405 |
# File 'lib/bio/appl/sim4/report.rb', line 402 def exons unless defined?(@exons); parse_segmentpairs; end @exons end |
#introns ⇒ Object
Returns introns of the hit. Some of them would contain untranscribed regions. Returns an array of Bio::Sim4::Report::SegmentPair objects. (Note that intron data is not always available according to run-time options of the program.)
422 423 424 425 |
# File 'lib/bio/appl/sim4/report.rb', line 422 def introns unless defined?(@introns); parse_segmentpairs; end @introns end |
#query_def ⇒ Object
Definition of the query sequence Same as Bio::Sim4::Report#query_def.
451 |
# File 'lib/bio/appl/sim4/report.rb', line 451 def query_def; seq1.definition; end |
#query_id ⇒ Object
Identifier of the query sequence. Same as Bio::Sim4::Report#query_id.
447 |
# File 'lib/bio/appl/sim4/report.rb', line 447 def query_id; seq1.entry_id; end |
#query_len ⇒ Object
Length of the query sequence. Same as Bio::Sim4::Report#query_len.
443 |
# File 'lib/bio/appl/sim4/report.rb', line 443 def query_len; seq1.len; end |
#segmentpairs ⇒ Object
Returns segment pairs (exons and introns) of the hit. Each segment pair is a Bio::Sim4::Report::SegmentPair object. Returns an array of Bio::Sim4::Report::SegmentPair objects. (Note that intron data is not always available according to run-time options of the program.)
412 413 414 415 |
# File 'lib/bio/appl/sim4/report.rb', line 412 def segmentpairs unless defined?(@segmentpairs); parse_segmentpairs; end @segmentpairs end |
#target_def ⇒ Object Also known as: definition
Definition of the hit(target) sequence
460 |
# File 'lib/bio/appl/sim4/report.rb', line 460 def target_def; seq2.definition; end |
#target_id ⇒ Object Also known as: hit_id
Identifier of the hit(target) sequence
457 |
# File 'lib/bio/appl/sim4/report.rb', line 457 def target_id; seq2.entry_id; end |
#target_len ⇒ Object Also known as: len
length of the hit(target) sequence
454 |
# File 'lib/bio/appl/sim4/report.rb', line 454 def target_len; seq2.len; end |