Module: Bioinform::ConversionAlgorithms::PCM2PPMConverter
- Defined in:
- lib/bioinform/conversion_algorithms/pcm2ppm_converter.rb
Class Method Summary collapse
-
.convert(pcm, parameters = {}) ⇒ Object
parameters hash is ignored.
Class Method Details
.convert(pcm, parameters = {}) ⇒ Object
parameters hash is ignored
6 7 8 9 10 11 12 13 |
# File 'lib/bioinform/conversion_algorithms/pcm2ppm_converter.rb', line 6 def self.convert(pcm, parameters = {}) matrix = pcm.each_position.map do |pos| pos.map do |el| el.to_f / pcm.count end end PPM.new(pcm.get_parameters.merge(matrix: matrix)) end |