Class: Mspire::Spectrum

Inherits:
Object
  • Object
show all
Includes:
SpectrumLike
Defined in:
lib/mspire/spectrum.rb,
lib/mspire/spectrum/centroid.rb

Defined Under Namespace

Modules: Centroidish Classes: Centroid

Instance Attribute Summary

Attributes included from SpectrumLike

#centroided, #data_arrays, #ms_level, #precursors, #products, #scans

Class Method Summary collapse

Methods included from SpectrumLike

#==, #[], #centroided?, #find_all_nearest, #find_all_nearest_index, #find_nearest, #find_nearest_index, #initialize, #intensities, #intensities=, #mzs, #mzs=, #mzs_and_intensities, #normalize, #peaks, #size, #sort!, #tic, #to_peaklist

Methods included from Enumerable

#index_by, #uniq_by

Class Method Details

.from_peaklist(peaklist) ⇒ Object



7
8
9
10
11
12
13
14
15
# File 'lib/mspire/spectrum.rb', line 7

def self.from_peaklist(peaklist)
  _mzs = []
  _ints = []
  peaklist.each do |mz, int|
    _mzs << mz
    _ints << int
  end
  self.new([_mzs, _ints])
end