Class: Bio::Sim4::Report::Hit

Inherits:
Object
  • Object
show all
Defined in:
lib/bio/appl/sim4/report.rb

Overview

Hit object of the sim4 result. Similar to Bio::Blast::Report::Hit but lacks many methods.

Instance Attribute Summary collapse

Instance Method Summary collapse

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

#seq1Object (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

#seq2Object (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

#alignObject

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.

Returns:

  • (Boolean)


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

#exonsObject 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

#intronsObject

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_defObject

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_idObject

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_lenObject

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

#segmentpairsObject

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_defObject 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_idObject 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_lenObject 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