Model class contains one of the models of a codeml run (e.g. M0) which is used as a test hypothesis for positive selection. This class is used by Codeml::Report.
Return codeml alpha of model, when available
# File lib/bio/appl/paml/codeml/report.rb, line 438 def alpha return nil if @buf !~ /alpha/ @buf[/alpha .+ =\s+(-?\d+(\.\d+)?)/,1].to_f end
Return classes when available. For M3 it parses
dN/dS (w) for site classes (K=3) p: 0.56413 0.35613 0.07974 w: 0.00928 1.98252 23.44160
and turns it into an array of Hash
>> m3.classes[0] => {:w=>0.00928, :p=>0.56413}
# File lib/bio/appl/paml/codeml/report.rb, line 463 def classes return nil if @buf !~ /classes/ # probs = @buf.scan(/\np:\s+(\w+)\s+(\S+)\s+(\S+)/) probs = @buf.scan(/\np:.*?\n/).to_s.split[1..3].map { |f| f.to_f } ws = @buf.scan(/\nw:.*?\n/).to_s.split[1..3].map { |f| f.to_f } ret = [] probs.each_with_index do | prob, i | ret.push :p => prob, :w => ws[i] end ret end
Return codeml kappa of model, when available
# File lib/bio/appl/paml/codeml/report.rb, line 432 def kappa return nil if @buf !~ /kappa/ @buf[/kappa \(ts\/tv\)\s+=\s+ (-?\d+(\.\d+)?)/,1].to_f end
Return codeml log likelihood of model
# File lib/bio/appl/paml/codeml/report.rb, line 420 def lnL @buf[/lnL\(.+\):\s+(-?\d+(\.\d+)?)/,1].to_f end
Return the model number
# File lib/bio/appl/paml/codeml/report.rb, line 410 def modelnum @buf[0..0].to_i end
Return the model name, e.g. ‘M0’ or ‘M7’
# File lib/bio/appl/paml/codeml/report.rb, line 415 def name 'M'.to_s+modelnum.to_s end
Return codeml omega of model
# File lib/bio/appl/paml/codeml/report.rb, line 425 def omega @buf[/omega \(dN\/dS\)\s+=\s+ (-?\d+(\.\d+)?)/,1].to_f end
Return the model information as a String
# File lib/bio/appl/paml/codeml/report.rb, line 476 def to_s @buf end
Generated with the Darkfish Rdoc Generator 2.