Class Bio::Fasta::Report::Hit
In: lib/bio/appl/fasta/format10.rb
Parent: Object

Methods

Classes and Modules

Class Bio::Fasta::Report::Hit::Query
Class Bio::Fasta::Report::Hit::Target

Attributes

definition  [R] 
query  [R] 
score  [R] 
target  [R] 

Public Class methods

[Source]

     # File lib/bio/appl/fasta/format10.rb, line 201
201:     def initialize(data)
202:       score, query, target = data.split(/\n>/)
203: 
204:       @definition, *score = score.split(/\n/)
205:       @score = {}
206: 
207:       pat = /;\s+([^:]+):\s+(.*)/
208: 
209:       score.each do |x|
210:         if pat.match(x)
211:           @score[$1] = $2
212:         end
213:       end
214: 
215:       @query = Query.new(query)
216:       @target = Target.new(target)
217:     end

Public Instance methods

Bit score

[Source]

     # File lib/bio/appl/fasta/format10.rb, line 234
234:     def bit_score
235:       if @score['fa_bits']
236:         @score['fa_bits'].to_f
237:       elsif @score['sw_bits']
238:         @score['sw_bits'].to_f
239:       elsif @score['fx_bits']
240:         @score['fx_bits'].to_f
241:       elsif @score['tx_bits']
242:         @score['tx_bits'].to_f
243:       end
244:     end

[Source]

     # File lib/bio/appl/fasta/format10.rb, line 246
246:     def direction
247:       @score['fa_frame'] || @score['sw_frame'] || @score['fx_frame'] || @score['tx_frame']
248:     end

E-value score

[Source]

     # File lib/bio/appl/fasta/format10.rb, line 221
221:     def evalue
222:       if @score['fa_expect']
223:         @score['fa_expect'].to_f
224:       elsif @score['sw_expect']
225:         @score['sw_expect'].to_f
226:       elsif @score['fx_expect']
227:         @score['fx_expect'].to_f
228:       elsif @score['tx_expect']
229:         @score['tx_expect'].to_f
230:       end
231:     end

percent identity

[Source]

     # File lib/bio/appl/fasta/format10.rb, line 256
256:     def identity
257:       @score['sw_ident'].to_f
258:     end

[Source]

     # File lib/bio/appl/fasta/format10.rb, line 327
327:     def lap_at
328:       [ query_start, query_end, target_start, target_end ]
329:     end

overlap length

[Source]

     # File lib/bio/appl/fasta/format10.rb, line 261
261:     def overlap
262:       @score['sw_overlap'].to_i
263:     end

[Source]

     # File lib/bio/appl/fasta/format10.rb, line 275
275:     def query_def
276:       @query.definition
277:     end

[Source]

     # File lib/bio/appl/fasta/format10.rb, line 315
315:     def query_end
316:       @query.stop
317:     end

Shortcuts for the methods of Bio::Fasta::Report::Hit::Query

[Source]

     # File lib/bio/appl/fasta/format10.rb, line 267
267:     def query_id
268:       @query.entry_id
269:     end

[Source]

     # File lib/bio/appl/fasta/format10.rb, line 283
283:     def query_len
284:       @query.length
285:     end

[Source]

     # File lib/bio/appl/fasta/format10.rb, line 293
293:     def query_seq
294:       @query.sequence
295:     end

Information on matching region

[Source]

     # File lib/bio/appl/fasta/format10.rb, line 311
311:     def query_start
312:       @query.start
313:     end

[Source]

     # File lib/bio/appl/fasta/format10.rb, line 301
301:     def query_type
302:       @query.moltype
303:     end

Smith-Waterman score

[Source]

     # File lib/bio/appl/fasta/format10.rb, line 251
251:     def sw
252:       @score['sw_score'].to_i
253:     end

[Source]

     # File lib/bio/appl/fasta/format10.rb, line 279
279:     def target_def
280:       @target.definition
281:     end

[Source]

     # File lib/bio/appl/fasta/format10.rb, line 323
323:     def target_end
324:       @target.stop
325:     end

[Source]

     # File lib/bio/appl/fasta/format10.rb, line 271
271:     def target_id
272:       @target.entry_id
273:     end

Shortcuts for the methods of Bio::Fasta::Report::Hit::Target

[Source]

     # File lib/bio/appl/fasta/format10.rb, line 289
289:     def target_len
290:       @target.length
291:     end

[Source]

     # File lib/bio/appl/fasta/format10.rb, line 297
297:     def target_seq
298:       @target.sequence
299:     end

[Source]

     # File lib/bio/appl/fasta/format10.rb, line 319
319:     def target_start
320:       @target.start
321:     end

[Source]

     # File lib/bio/appl/fasta/format10.rb, line 305
305:     def target_type
306:       @target.moltype
307:     end

[Validate]