Class: Bio::Genscan::Report::Exon

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

Overview

Container class of a predicted gene structure.

Constant Summary

TYPES =
{
  'Init' => 'Initial exon', 
  'Intr' => 'Internal exon',
  'Term' => 'Terminal exon',
  'Sngl' => 'Single-exon gene',
  'Prom' => 'Promoter',
  'PlyA' => 'poly-A signal'
}

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(gnex, t, s, b, e, len, fr, ph, iac, dot, cr, prob, ts) ⇒ Exon

Bio::Genescan::Report::Exon.new(gene_number, exon_type, strand, first, end, length, frame, phase, acceptor_score, donor_score, score, p_value, t_score)



318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
# File 'lib/bio/appl/genscan/report.rb', line 318

def initialize(gnex, t, s, b, e, len, fr, ph, iac, dot, cr, prob, ts)
  @gene_number, @number = gnex.split(".").map {|n| n.to_i }
  @exon_type = t
  @strand    = s
  @first     = b.to_i
  @last      = e.to_i
  @length    = len.to_i
  @frame     = fr
  @phase     = ph
  @i_ac      = iac.to_i
  @do_t      = dot.to_i
  @score     = cr.to_i
  @p_value   = prob.to_f
  @t_score   = ts.to_f
end

Instance Attribute Details

#exon_typeObject (readonly)

Returns “Type” field.



287
288
289
# File 'lib/bio/appl/genscan/report.rb', line 287

def exon_type
  @exon_type
end

#firstObject (readonly)

Returns Returns first position of the region. “Begin” field.



293
294
295
# File 'lib/bio/appl/genscan/report.rb', line 293

def first
  @first
end

#frameObject (readonly)

Returns “Fr” field.



299
300
301
# File 'lib/bio/appl/genscan/report.rb', line 299

def frame
  @frame
end

#gene_numberObject (readonly)

Returns



281
282
283
# File 'lib/bio/appl/genscan/report.rb', line 281

def gene_number
  @gene_number
end

#lastObject (readonly)

Returns Returns last position of the region. “End” field.



296
297
298
# File 'lib/bio/appl/genscan/report.rb', line 296

def last
  @last
end

#numberObject (readonly)

Returns “Ex”, exon number field



284
285
286
# File 'lib/bio/appl/genscan/report.rb', line 284

def number
  @number
end

#p_valueObject (readonly)

Returns “P” field.



308
309
310
# File 'lib/bio/appl/genscan/report.rb', line 308

def p_value
  @p_value
end

#phaseObject (readonly)

Returns “Ph” field.



302
303
304
# File 'lib/bio/appl/genscan/report.rb', line 302

def phase
  @phase
end

#scoreObject (readonly) Also known as: coding_region_score

Returns “CodRg” field.



305
306
307
# File 'lib/bio/appl/genscan/report.rb', line 305

def score
  @score
end

#strandObject (readonly)

Returns “S” field.



290
291
292
# File 'lib/bio/appl/genscan/report.rb', line 290

def strand
  @strand
end

#t_scoreObject (readonly)

Returns “Tscr” field.



311
312
313
# File 'lib/bio/appl/genscan/report.rb', line 311

def t_score
  @t_score
end

Class Method Details

.parser(line) ⇒ Object

Bio::Genescan::Report::Exon.parser



267
268
269
270
271
272
273
274
275
276
277
# File 'lib/bio/appl/genscan/report.rb', line 267

def self.parser(line)
  e = line.strip.split(/ +/)
  case line
  when /PlyA/, /Prom/
    e[12] = e[6].clone
    e[11] = 0
    [6,7,8,9,10].each {|i| e[i] = nil }
  end
  self.new(e[0], e[1], e[2], e[3], e[4], e[5], e[6], 
           e[7], e[8], e[9], e[10], e[11], e[12])
end

Instance Method Details

#acceptor_scoreObject Also known as: initiation_score

Bio::Genescan::Report::Exon#acceptor_score

“I/Ac” field.



355
356
357
# File 'lib/bio/appl/genscan/report.rb', line 355

def acceptor_score
  @i_ac
end

#donor_scoreObject Also known as: termination_score

Bio::Genescan::Report::Exon#donor_score

“Do/T” field.



364
365
366
# File 'lib/bio/appl/genscan/report.rb', line 364

def donor_score
  @do_t
end

#exon_type_longObject

Bio::Genescan::Report::Exon#exon_type_long

Returns a human-readable “Type” of exon.



339
340
341
# File 'lib/bio/appl/genscan/report.rb', line 339

def exon_type_long
  TYPES[exon_type]
end

#rangeObject

Bio::Genescan::Report::Exon#range

Returns Range object of the region.



347
348
349
# File 'lib/bio/appl/genscan/report.rb', line 347

def range 
  Range.new(@first, @last)
end