Class: Bio::PAML::Codeml::PositiveSite

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

Overview

A record of codon sites, across the sequences in the alignment, showing evidence of positive selection.

This class is used for storing both codeml's full Bayesian and naive Bayesian analysis

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(fields) ⇒ PositiveSite

Returns a new instance of PositiveSite



492
493
494
495
496
497
# File 'lib/bio/appl/paml/codeml/report.rb', line 492

def initialize fields
  @position    = fields[0].to_i
  @aaref       = fields[1].to_s
  @probability = fields[2].to_f
  @omega       = fields[3].to_f
end

Instance Attribute Details

#aarefObject (readonly)

Returns the value of attribute aaref



488
489
490
# File 'lib/bio/appl/paml/codeml/report.rb', line 488

def aaref
  @aaref
end

#omegaObject (readonly)

Returns the value of attribute omega



490
491
492
# File 'lib/bio/appl/paml/codeml/report.rb', line 490

def omega
  @omega
end

#positionObject (readonly)

Returns the value of attribute position



487
488
489
# File 'lib/bio/appl/paml/codeml/report.rb', line 487

def position
  @position
end

#probabilityObject (readonly) Also known as: p

Returns the value of attribute probability



489
490
491
# File 'lib/bio/appl/paml/codeml/report.rb', line 489

def probability
  @probability
end

Instance Method Details

#dN_dSObject Also known as: w

Return dN/dS (or omega) for this codon



500
501
502
# File 'lib/bio/appl/paml/codeml/report.rb', line 500

def dN_dS
  omega
end

#to_aObject

Return contents as Array - useful for printing



509
510
511
# File 'lib/bio/appl/paml/codeml/report.rb', line 509

def to_a
  [ @position, @aaref, @probability, @omega ]
end