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.
262 263 264 265 |
# File 'lib/bio/appl/sim4/report.rb', line 262 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.
291 292 293 |
# File 'lib/bio/appl/sim4/report.rb', line 291 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.
296 297 298 |
# File 'lib/bio/appl/sim4/report.rb', line 296 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.
399 400 401 402 |
# File 'lib/bio/appl/sim4/report.rb', line 399 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.
302 303 304 |
# File 'lib/bio/appl/sim4/report.rb', line 302 def complement? @complement end |
#each(&x) ⇒ Object
Iterates over each exon of the hit. Yields a Bio::Sim4::Report::SegmentPair object.
437 438 439 |
# File 'lib/bio/appl/sim4/report.rb', line 437 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.
369 370 371 372 |
# File 'lib/bio/appl/sim4/report.rb', line 369 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.)
389 390 391 392 |
# File 'lib/bio/appl/sim4/report.rb', line 389 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.
418 |
# File 'lib/bio/appl/sim4/report.rb', line 418 def query_def; seq1.definition; end |
#query_id ⇒ Object
Identifier of the query sequence. Same as Bio::Sim4::Report#query_id.
414 |
# File 'lib/bio/appl/sim4/report.rb', line 414 def query_id; seq1.entry_id; end |
#query_len ⇒ Object
Length of the query sequence. Same as Bio::Sim4::Report#query_len.
410 |
# File 'lib/bio/appl/sim4/report.rb', line 410 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.)
379 380 381 382 |
# File 'lib/bio/appl/sim4/report.rb', line 379 def segmentpairs unless defined?(@segmentpairs); parse_segmentpairs; end @segmentpairs end |
#target_def ⇒ Object Also known as: definition
Definition of the hit(target) sequence
427 |
# File 'lib/bio/appl/sim4/report.rb', line 427 def target_def; seq2.definition; end |
#target_id ⇒ Object Also known as: hit_id
Identifier of the hit(target) sequence
424 |
# File 'lib/bio/appl/sim4/report.rb', line 424 def target_id; seq2.entry_id; end |
#target_len ⇒ Object Also known as: len
length of the hit(target) sequence
421 |
# File 'lib/bio/appl/sim4/report.rb', line 421 def target_len; seq2.len; end |