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.



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

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

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

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



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.

Returns:

  • (Boolean)


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

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

#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.)



389
390
391
392
# File 'lib/bio/appl/sim4/report.rb', line 389

def introns
  unless defined?(@introns); parse_segmentpairs; end
  @introns
end

#query_defObject

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_idObject

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_lenObject

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

#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.)



379
380
381
382
# File 'lib/bio/appl/sim4/report.rb', line 379

def segmentpairs
  unless defined?(@segmentpairs); parse_segmentpairs; end
  @segmentpairs
end

#target_defObject 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_idObject 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_lenObject 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