Class: Bio::Spidey::Report::Hit
Overview
Hit object of Spidey result. Similar to Bio::Blast::Report::Hit but lacks many methods.
Instance Method Summary collapse
-
#align ⇒ Object
Returns alignments.
-
#complement? ⇒ Boolean
Returns true if the result reports ‘Reverse complement’.
-
#each(&x) ⇒ Object
Iterates over each exon of the hit.
-
#exons ⇒ Object
(also: #hsps)
Returns exons of the hit.
-
#genomic ⇒ Object
Returns sequence informations of the ‘Genomic’.
-
#initialize(data, d0) ⇒ Hit
constructor
Creates a new Hit object.
-
#introns ⇒ Object
Returns introns of the hit.
-
#missing_mrna_ends ⇒ Object
Returns missing mRNA ends of the hit.
-
#mrna ⇒ Object
Returns sequence informations of the mRNA.
-
#number_of_exons ⇒ Object
Returns number of exons in the hit.
-
#number_of_splice_sites ⇒ Object
Returns number of splice sites of the hit.
-
#percent_identity ⇒ Object
Returns overall percent identity of the hit.
-
#query_def ⇒ Object
Definition of the mRNA (query).
-
#query_id ⇒ Object
Identifier of the mRNA (query).
-
#query_len ⇒ Object
Length of the mRNA (query) sequence.
-
#segmentpairs ⇒ Object
Returns segment pairs (exons and introns) of the hit.
-
#strand ⇒ Object
Returns strand information of the hit.
-
#target_def ⇒ Object
(also: #definition)
Definition of the genomic (target) sequence.
-
#target_id ⇒ Object
(also: #hit_id)
Identifier of the genomic (target) sequence.
-
#target_len ⇒ Object
(also: #len)
The genomic (target) sequence length.
Constructor Details
#initialize(data, d0) ⇒ Hit
Creates a new Hit object. It is designed to be called internally from Bio::Spidey::Report::* classes. Users shall not call it directly.
290 291 292 293 |
# File 'lib/bio/appl/spidey/report.rb', line 290 def initialize(data, d0) @data = data @d0 = d0 end |
Instance Method Details
#align ⇒ Object
Returns alignments. Returns an Array of arrays. This would be a Bio::Spidey specific method.
465 466 467 468 |
# File 'lib/bio/appl/spidey/report.rb', line 465 def align unless defined?(@align); parse_align; end @align end |
#complement? ⇒ Boolean
Returns true if the result reports ‘Reverse complement’. Otherwise, return false or nil. This would be a Bio::Spidey specific method.
330 331 332 333 |
# File 'lib/bio/appl/spidey/report.rb', line 330 def complement? unless defined?(@complement); parse_strand; end @complement end |
#each(&x) ⇒ Object
Iterates over each exon of the hit. Yields Bio::Spidey::Report::SegmentPair object.
555 556 557 |
# File 'lib/bio/appl/spidey/report.rb', line 555 def each(&x) #:yields: segmentpair exons.each(&x) end |
#exons ⇒ Object Also known as: hsps
Returns exons of the hit. Returns an array of Bio::Spidey::Report::SegmentPair object.
437 438 439 440 |
# File 'lib/bio/appl/spidey/report.rb', line 437 def exons unless defined?(@exons); parse_segmentpairs; end @exons end |
#genomic ⇒ Object
Returns sequence informations of the ‘Genomic’. Returns a Bio::Spidey::Report::SeqDesc object. This would be a Bio::Spidey specific method.
373 374 375 376 377 378 |
# File 'lib/bio/appl/spidey/report.rb', line 373 def genomic unless defined?(@genomic) @genomic = SeqDesc.parse(@d0.find { |x| /^Genomic\:/ =~ x }) end @genomic end |
#introns ⇒ Object
Returns introns of the hit. Some of them would contain untranscribed regions. Returns an array of Bio::Spidey::Report::SegmentPair objects. (Note that intron data is not always available according to run-time options of the program.)
447 448 449 450 |
# File 'lib/bio/appl/spidey/report.rb', line 447 def introns unless defined?(@introns); parse_segmentpairs; end @introns end |
#missing_mrna_ends ⇒ Object
Returns missing mRNA ends of the hit.
363 364 365 366 367 368 |
# File 'lib/bio/appl/spidey/report.rb', line 363 def missing_mrna_ends unless defined?(@missing_mrna_ends) @missing_mrna_ends = field_fetch('Missing mRNA ends', @d0) end @missing_mrna_ends end |
#mrna ⇒ Object
Returns sequence informations of the mRNA. Returns a Bio::Spidey::Report::SeqDesc object. This would be a Bio::Spidey specific method.
383 384 385 386 387 388 |
# File 'lib/bio/appl/spidey/report.rb', line 383 def mrna unless defined?(@mrna) @mrna = SeqDesc.parse(@d0.find { |x| /^mRNA\:/ =~ x }) end @mrna end |
#number_of_exons ⇒ Object
Returns number of exons in the hit.
336 337 338 339 340 341 |
# File 'lib/bio/appl/spidey/report.rb', line 336 def number_of_exons unless defined?(@number_of_exons) @number_of_exons = field_fetch('Number of exons', @d0).to_i end @number_of_exons end |
#number_of_splice_sites ⇒ Object
Returns number of splice sites of the hit.
344 345 346 347 348 349 350 |
# File 'lib/bio/appl/spidey/report.rb', line 344 def number_of_splice_sites unless defined?(@number_of_splice_sites) @number_of_splice_sites = field_fetch('Number of splice sites', @d0).to_i end @number_of_splice_sites end |
#percent_identity ⇒ Object
Returns overall percent identity of the hit.
353 354 355 356 357 358 359 360 |
# File 'lib/bio/appl/spidey/report.rb', line 353 def percent_identity unless defined?(@percent_identity) x = field_fetch('overall percent identity', @d0) @percent_identity = (/([\d\.]+)\s*\%/ =~ x.to_s) ? $1 : nil end @percent_identity end |
#query_def ⇒ Object
Definition of the mRNA (query). Same as Bio::Spidey::Report#query_def.
536 |
# File 'lib/bio/appl/spidey/report.rb', line 536 def query_def; mrna.definition; end |
#query_id ⇒ Object
Identifier of the mRNA (query). Same as Bio::Spidey::Report#query_id.
532 |
# File 'lib/bio/appl/spidey/report.rb', line 532 def query_id; mrna.entry_id; end |
#query_len ⇒ Object
Length of the mRNA (query) sequence. Same as Bio::Spidey::Report#query_len.
528 |
# File 'lib/bio/appl/spidey/report.rb', line 528 def query_len; mrna.len; end |
#segmentpairs ⇒ Object
Returns segment pairs (exons and introns) of the hit. Each segment pair is a Bio::Spidey::Report::SegmentPair object. Returns an array of Bio::Spidey::Report::SegmentPair objects. (Note that intron data is not always available according to run-time options of the program.)
457 458 459 460 |
# File 'lib/bio/appl/spidey/report.rb', line 457 def segmentpairs unless defined?(@segmentparis); parse_segmentpairs; end @segmentpairs end |
#strand ⇒ Object
Returns strand information of the hit. Returns ‘plus’, ‘minus’, or nil. This would be a Bio::Spidey specific method.
322 323 324 325 |
# File 'lib/bio/appl/spidey/report.rb', line 322 def strand unless defined?(@strand); parse_strand; end @strand end |
#target_def ⇒ Object Also known as: definition
Definition of the genomic (target) sequence.
545 |
# File 'lib/bio/appl/spidey/report.rb', line 545 def target_def; genomic.definition; end |
#target_id ⇒ Object Also known as: hit_id
Identifier of the genomic (target) sequence.
542 |
# File 'lib/bio/appl/spidey/report.rb', line 542 def target_id; genomic.entry_id; end |
#target_len ⇒ Object Also known as: len
The genomic (target) sequence length.
539 |
# File 'lib/bio/appl/spidey/report.rb', line 539 def target_len; genomic.len; end |