Class: Bio::PAML::Codeml::Rates

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

Overview

Description

A simple class for parsing the codeml rates file.

WARNING: The order of the parsed data should be correct, however will not necessarily correspond to the position in the alignment. For instance codeml ignores columns that contains gaps, and therefore there will not be any estimated rate data.

Usage

site_rates = Bio::PAML::Codeml::Rates.new(File.open(@tmp_dir + “/rates”).read) site_rate.first # => Number of times that column appears site_rate.[:rate] # => Estimated rate of evolution site_rate.last # => The content of the column, as a string

# This class delegates to an array, so will respond to all array methods site_rates.max {|x,y| x <=> y } # => Fastest evolving column site_rates.detect {|x| x > 1 } # => Columns appearing more than once

Instance Method Summary collapse

Constructor Details

#initialize(rates) ⇒ Rates

Returns a new instance of Rates.



44
45
46
# File 'lib/bio/appl/paml/codeml/rates.rb', line 44

def initialize(rates)
  super(parse_rates(rates))
end