Class: Bio::Blast::Report::Hit

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

Overview

Bio::Blast::Report::Hit

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeHit

Returns a new instance of Hit.



212
213
214
# File 'lib/bio/appl/blast/report.rb', line 212

def initialize
  @hsps = []
end

Instance Attribute Details

#accessionObject Also known as: target_id

Accession



228
229
230
# File 'lib/bio/appl/blast/report.rb', line 228

def accession
  @accession
end

#definitionObject Also known as: target_def

Definition line of subject



226
227
228
# File 'lib/bio/appl/blast/report.rb', line 226

def definition
  @definition
end

#hit_idObject

SeqId of subject



222
223
224
# File 'lib/bio/appl/blast/report.rb', line 222

def hit_id
  @hit_id
end

#hspsObject (readonly)

Returns an Array of Bio::Blast::Report::Hsp objects.



217
218
219
# File 'lib/bio/appl/blast/report.rb', line 217

def hsps
  @hsps
end

#lenObject Also known as: target_len

Length of subject



224
225
226
# File 'lib/bio/appl/blast/report.rb', line 224

def len
  @len
end

#numObject

Hit number



220
221
222
# File 'lib/bio/appl/blast/report.rb', line 220

def num
  @num
end

#query_defObject

Compatible method with Bio::Fasta::Report::Hit class.



240
241
242
# File 'lib/bio/appl/blast/report.rb', line 240

def query_def
  @query_def
end

#query_idObject

Compatible method with Bio::Fasta::Report::Hit class.



238
239
240
# File 'lib/bio/appl/blast/report.rb', line 238

def query_id
  @query_id
end

#query_lenObject

Compatible method with Bio::Fasta::Report::Hit class.



242
243
244
# File 'lib/bio/appl/blast/report.rb', line 242

def query_len
  @query_len
end

Instance Method Details

#bit_scoreObject



254
# File 'lib/bio/appl/blast/report.rb', line 254

def bit_score;        @hsps.first.bit_score;        end

#eachObject

Iterates on each Hsp object.



231
232
233
234
235
# File 'lib/bio/appl/blast/report.rb', line 231

def each
  @hsps.each do |x|
    yield x
  end
end

#evalueObject

Shortcut methods for the best Hsp, some are also compatible with Bio::Fasta::Report::Hit class.



253
# File 'lib/bio/appl/blast/report.rb', line 253

def evalue;           @hsps.first.evalue;           end

#identityObject



255
# File 'lib/bio/appl/blast/report.rb', line 255

def identity;         @hsps.first.identity;         end

#lap_atObject



267
268
269
# File 'lib/bio/appl/blast/report.rb', line 267

def lap_at
  [ query_start, query_end, target_start, target_end ]
end

#midlineObject



261
# File 'lib/bio/appl/blast/report.rb', line 261

def midline;          @hsps.first.midline;          end

#overlapObject



257
# File 'lib/bio/appl/blast/report.rb', line 257

def overlap;          @hsps.first.align_len;        end

#percent_identityObject



256
# File 'lib/bio/appl/blast/report.rb', line 256

def percent_identity; @hsps.first.percent_identity; end

#query_endObject



264
# File 'lib/bio/appl/blast/report.rb', line 264

def query_end;        @hsps.first.query_to;         end

#query_seqObject



259
# File 'lib/bio/appl/blast/report.rb', line 259

def query_seq;        @hsps.first.qseq;             end

#query_startObject



263
# File 'lib/bio/appl/blast/report.rb', line 263

def query_start;      @hsps.first.query_from;       end

#target_endObject



266
# File 'lib/bio/appl/blast/report.rb', line 266

def target_end;       @hsps.first.hit_to;           end

#target_seqObject



260
# File 'lib/bio/appl/blast/report.rb', line 260

def target_seq;       @hsps.first.hseq;             end

#target_startObject



265
# File 'lib/bio/appl/blast/report.rb', line 265

def target_start;     @hsps.first.hit_from;         end