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

Public Instance methods

Bit score

[Source]

     # 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

[Source]

     # 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

[Source]

     # 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

percent identity

[Source]

     # File lib/bio/appl/fasta/format10.rb, line 166
166:     def identity
167:       @score['sw_ident'].to_f
168:     end

[Source]

     # File lib/bio/appl/fasta/format10.rb, line 237
237:     def lap_at
238:       [ query_start, query_end, target_start, target_end ]
239:     end

overlap length

[Source]

     # File lib/bio/appl/fasta/format10.rb, line 171
171:     def overlap
172:       @score['sw_overlap'].to_i
173:     end

[Source]

     # File lib/bio/appl/fasta/format10.rb, line 185
185:     def query_def
186:       @query.definition
187:     end

[Source]

     # File lib/bio/appl/fasta/format10.rb, line 225
225:     def query_end
226:       @query.stop
227:     end

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

[Source]

     # File lib/bio/appl/fasta/format10.rb, line 177
177:     def query_id
178:       @query.entry_id
179:     end

[Source]

     # File lib/bio/appl/fasta/format10.rb, line 193
193:     def query_len
194:       @query.length
195:     end

[Source]

     # File lib/bio/appl/fasta/format10.rb, line 203
203:     def query_seq
204:       @query.sequence
205:     end

Information on matching region

[Source]

     # File lib/bio/appl/fasta/format10.rb, line 221
221:     def query_start
222:       @query.start
223:     end

[Source]

     # File lib/bio/appl/fasta/format10.rb, line 211
211:     def query_type
212:       @query.moltype
213:     end

Smith-Waterman score

[Source]

     # File lib/bio/appl/fasta/format10.rb, line 161
161:     def sw
162:       @score['sw_score'].to_i
163:     end

[Source]

     # File lib/bio/appl/fasta/format10.rb, line 189
189:     def target_def
190:       @target.definition
191:     end

[Source]

     # File lib/bio/appl/fasta/format10.rb, line 233
233:     def target_end
234:       @target.stop
235:     end

[Source]

     # File lib/bio/appl/fasta/format10.rb, line 181
181:     def target_id
182:       @target.entry_id
183:     end

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

[Source]

     # File lib/bio/appl/fasta/format10.rb, line 199
199:     def target_len
200:       @target.length
201:     end

[Source]

     # File lib/bio/appl/fasta/format10.rb, line 207
207:     def target_seq
208:       @target.sequence
209:     end

[Source]

     # File lib/bio/appl/fasta/format10.rb, line 229
229:     def target_start
230:       @target.start
231:     end

[Source]

     # File lib/bio/appl/fasta/format10.rb, line 215
215:     def target_type
216:       @target.moltype
217:     end

[Validate]