module SpectrumHash
Constants
- VERSION
Public Class Methods
from_peaks(spectrum,options={})
click to toggle source
# File lib/spectrum_hash.rb, line 12 def self.from_peaks(spectrum,options={}) Splash.new spectrum, options end
from_splash_string(splash)
click to toggle source
# File lib/spectrum_hash.rb, line 16 def self.from_splash_string(splash) Splash.new nil, splash: splash end
from_string(spectrum_string,options={})
click to toggle source
# File lib/spectrum_hash.rb, line 7 def self.from_string(spectrum_string,options={}) peaks = parse_peaks_string(spectrum_string) self.from_peaks peaks, options end
Private Class Methods
parse_peaks_string(spectrum_string)
click to toggle source
# File lib/spectrum_hash.rb, line 22 def self.parse_peaks_string(spectrum_string) spectrum_string.split(/\n/).map do |line| line.split(/\s+/).map(&:to_f) end end