| Class | Bio::Fasta::Report::Hit |
| In: |
lib/bio/appl/fasta/format10.rb
|
| Parent: | Object |
| definition | [R] | |
| query | [R] | |
| score | [R] | |
| target | [R] |
# File lib/bio/appl/fasta/format10.rb, line 111
111: def initialize(data)
112: score, query, target = data.split(/\n>/)
113:
114: @definition, *score = score.split(/\n/)
115: @score = {}
116:
117: pat = /;\s+([^:]+):\s+(.*)/
118:
119: score.each do |x|
120: if pat.match(x)
121: @score[$1] = $2
122: end
123: end
124:
125: @query = Query.new(query)
126: @target = Target.new(target)
127: end
Bit score
# File lib/bio/appl/fasta/format10.rb, line 144
144: def bit_score
145: if @score['fa_bits']
146: @score['fa_bits'].to_f
147: elsif @score['sw_bits']
148: @score['sw_bits'].to_f
149: elsif @score['fx_bits']
150: @score['fx_bits'].to_f
151: elsif @score['tx_bits']
152: @score['tx_bits'].to_f
153: end
154: end
# File lib/bio/appl/fasta/format10.rb, line 156
156: def direction
157: @score['fa_frame'] || @score['sw_frame'] || @score['fx_frame'] || @score['tx_frame']
158: end
E-value score
# File lib/bio/appl/fasta/format10.rb, line 131
131: def evalue
132: if @score['fa_expect']
133: @score['fa_expect'].to_f
134: elsif @score['sw_expect']
135: @score['sw_expect'].to_f
136: elsif @score['fx_expect']
137: @score['fx_expect'].to_f
138: elsif @score['tx_expect']
139: @score['tx_expect'].to_f
140: end
141: end
# File lib/bio/appl/fasta/format10.rb, line 237
237: def lap_at
238: [ query_start, query_end, target_start, target_end ]
239: end
Shortcuts for the methods of Bio::Fasta::Report::Hit::Query
# File lib/bio/appl/fasta/format10.rb, line 177
177: def query_id
178: @query.entry_id
179: end
Information on matching region
# File lib/bio/appl/fasta/format10.rb, line 221
221: def query_start
222: @query.start
223: end
Smith-Waterman score
# File lib/bio/appl/fasta/format10.rb, line 161
161: def sw
162: @score['sw_score'].to_i
163: end
# File lib/bio/appl/fasta/format10.rb, line 189
189: def target_def
190: @target.definition
191: end
Shortcuts for the methods of Bio::Fasta::Report::Hit::Target
# File lib/bio/appl/fasta/format10.rb, line 199
199: def target_len
200: @target.length
201: end