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 collapse

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)


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

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.


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

def exon_type
  @exon_type
end

#firstObject (readonly)

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


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

def first
  @first
end

#frameObject (readonly)

Returns “Fr” field.


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

def frame
  @frame
end

#gene_numberObject (readonly)

Returns


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

def gene_number
  @gene_number
end

#lastObject (readonly)

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


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

def last
  @last
end

#numberObject (readonly)

Returns “Ex”, exon number field


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

def number
  @number
end

#p_valueObject (readonly)

Returns “P” field.


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

def p_value
  @p_value
end

#phaseObject (readonly)

Returns “Ph” field.


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

def phase
  @phase
end

#scoreObject (readonly) Also known as: coding_region_score

Returns “CodRg” field.


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

def score
  @score
end

#strandObject (readonly)

Returns “S” field.


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

def strand
  @strand
end

#t_scoreObject (readonly)

Returns “Tscr” field.


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

def t_score
  @t_score
end

Class Method Details

.parser(line) ⇒ Object

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


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

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.


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

def acceptor_score
  @i_ac
end

#donor_scoreObject Also known as: termination_score

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

“Do/T” field.


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

def donor_score
  @do_t
end

#exon_type_longObject

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

Returns a human-readable “Type” of exon.


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

def exon_type_long
  TYPES[exon_type]
end

#rangeObject

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

Returns Range object of the region.


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

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