Class: Bio::Fasta::Report::Hit
Defined Under Namespace
Instance Attribute Summary collapse
-
#definition ⇒ Object
readonly
Returns the value of attribute definition.
-
#query ⇒ Object
readonly
Returns the value of attribute query.
-
#score ⇒ Object
readonly
Returns the value of attribute score.
-
#target ⇒ Object
readonly
Returns the value of attribute target.
Instance Method Summary collapse
-
#bit_score ⇒ Object
Bit score.
- #direction ⇒ Object
-
#evalue ⇒ Object
E-value score.
-
#identity ⇒ Object
percent identity.
-
#initialize(data) ⇒ Hit
constructor
A new instance of Hit.
- #lap_at ⇒ Object
-
#overlap ⇒ Object
overlap length.
- #query_def ⇒ Object
- #query_end ⇒ Object
-
#query_id ⇒ Object
Shortcuts for the methods of Bio::Fasta::Report::Hit::Query.
- #query_len ⇒ Object
- #query_seq ⇒ Object
-
#query_start ⇒ Object
Information on matching region.
- #query_type ⇒ Object
-
#sw ⇒ Object
Smith-Waterman score.
- #target_def ⇒ Object
- #target_end ⇒ Object
- #target_id ⇒ Object
-
#target_len ⇒ Object
Shortcuts for the methods of Bio::Fasta::Report::Hit::Target.
- #target_seq ⇒ Object
- #target_start ⇒ Object
- #target_type ⇒ Object
Constructor Details
#initialize(data) ⇒ Hit
Returns a new instance of Hit.
201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 |
# File 'lib/bio/appl/fasta/format10.rb', line 201 def initialize(data) score, query, target = data.split(/\n>/) @definition, *score = score.split(/\n/) @score = {} pat = /;\s+([^:]+):\s+(.*)/ score.each do |x| if pat.match(x) @score[$1] = $2 end end @query = Query.new(query) @target = Target.new(target) end |
Instance Attribute Details
#definition ⇒ Object (readonly)
Returns the value of attribute definition.
218 219 220 |
# File 'lib/bio/appl/fasta/format10.rb', line 218 def definition @definition end |
#query ⇒ Object (readonly)
Returns the value of attribute query.
218 219 220 |
# File 'lib/bio/appl/fasta/format10.rb', line 218 def query @query end |
#score ⇒ Object (readonly)
Returns the value of attribute score.
218 219 220 |
# File 'lib/bio/appl/fasta/format10.rb', line 218 def score @score end |
#target ⇒ Object (readonly)
Returns the value of attribute target.
218 219 220 |
# File 'lib/bio/appl/fasta/format10.rb', line 218 def target @target end |
Instance Method Details
#bit_score ⇒ Object
Bit score
234 235 236 237 238 239 240 241 242 243 244 |
# File 'lib/bio/appl/fasta/format10.rb', line 234 def bit_score if @score['fa_bits'] @score['fa_bits'].to_f elsif @score['sw_bits'] @score['sw_bits'].to_f elsif @score['fx_bits'] @score['fx_bits'].to_f elsif @score['tx_bits'] @score['tx_bits'].to_f end end |
#direction ⇒ Object
246 247 248 |
# File 'lib/bio/appl/fasta/format10.rb', line 246 def direction @score['fa_frame'] || @score['sw_frame'] || @score['fx_frame'] || @score['tx_frame'] end |
#evalue ⇒ Object
E-value score
221 222 223 224 225 226 227 228 229 230 231 |
# File 'lib/bio/appl/fasta/format10.rb', line 221 def evalue if @score['fa_expect'] @score['fa_expect'].to_f elsif @score['sw_expect'] @score['sw_expect'].to_f elsif @score['fx_expect'] @score['fx_expect'].to_f elsif @score['tx_expect'] @score['tx_expect'].to_f end end |
#identity ⇒ Object
percent identity
256 257 258 |
# File 'lib/bio/appl/fasta/format10.rb', line 256 def identity @score['sw_ident'].to_f end |
#lap_at ⇒ Object
327 328 329 |
# File 'lib/bio/appl/fasta/format10.rb', line 327 def lap_at [ query_start, query_end, target_start, target_end ] end |
#overlap ⇒ Object
overlap length
261 262 263 |
# File 'lib/bio/appl/fasta/format10.rb', line 261 def overlap @score['sw_overlap'].to_i end |
#query_def ⇒ Object
275 276 277 |
# File 'lib/bio/appl/fasta/format10.rb', line 275 def query_def @query.definition end |
#query_end ⇒ Object
315 316 317 |
# File 'lib/bio/appl/fasta/format10.rb', line 315 def query_end @query.stop end |
#query_id ⇒ Object
Shortcuts for the methods of Bio::Fasta::Report::Hit::Query
267 268 269 |
# File 'lib/bio/appl/fasta/format10.rb', line 267 def query_id @query.entry_id end |
#query_len ⇒ Object
283 284 285 |
# File 'lib/bio/appl/fasta/format10.rb', line 283 def query_len @query.length end |
#query_seq ⇒ Object
293 294 295 |
# File 'lib/bio/appl/fasta/format10.rb', line 293 def query_seq @query.sequence end |
#query_start ⇒ Object
Information on matching region
311 312 313 |
# File 'lib/bio/appl/fasta/format10.rb', line 311 def query_start @query.start end |
#query_type ⇒ Object
301 302 303 |
# File 'lib/bio/appl/fasta/format10.rb', line 301 def query_type @query.moltype end |
#sw ⇒ Object
Smith-Waterman score
251 252 253 |
# File 'lib/bio/appl/fasta/format10.rb', line 251 def sw @score['sw_score'].to_i end |
#target_def ⇒ Object
279 280 281 |
# File 'lib/bio/appl/fasta/format10.rb', line 279 def target_def @target.definition end |
#target_end ⇒ Object
323 324 325 |
# File 'lib/bio/appl/fasta/format10.rb', line 323 def target_end @target.stop end |
#target_id ⇒ Object
271 272 273 |
# File 'lib/bio/appl/fasta/format10.rb', line 271 def target_id @target.entry_id end |
#target_len ⇒ Object
Shortcuts for the methods of Bio::Fasta::Report::Hit::Target
289 290 291 |
# File 'lib/bio/appl/fasta/format10.rb', line 289 def target_len @target.length end |
#target_seq ⇒ Object
297 298 299 |
# File 'lib/bio/appl/fasta/format10.rb', line 297 def target_seq @target.sequence end |
#target_start ⇒ Object
319 320 321 |
# File 'lib/bio/appl/fasta/format10.rb', line 319 def target_start @target.start end |
#target_type ⇒ Object
305 306 307 |
# File 'lib/bio/appl/fasta/format10.rb', line 305 def target_type @target.moltype end |