Module: Mspire::Mzml::Convenience
- Included in:
- Mspire::Mzml
- Defined in:
- lib/mspire/mzml.rb
Instance Method Summary collapse
-
#chromatogram(arg) ⇒ Mspire::Mzml::Chromatogram
A spectrum object.
- #each_chromatogram(&block) ⇒ Object
- #each_spectrum(&block) ⇒ Object (also: #each)
-
#length ⇒ Object
(also: #size)
returns the number of spectra.
- #num_chromatograms ⇒ Object
-
#spectrum(arg) ⇒ Mspire::Mzml::Spectrum
(also: #[])
A spectrum object.
-
#spectrum_from_scan_num(scan_num) ⇒ Mspire::Spectrum
A spectrum object, or nil if not found.
Instance Method Details
#chromatogram(arg) ⇒ Mspire::Mzml::Chromatogram
Returns a spectrum object.
234 235 236 |
# File 'lib/mspire/mzml.rb', line 234 def chromatogram(arg) run.chromatogram_list[arg] end |
#each_chromatogram(&block) ⇒ Object
215 216 217 |
# File 'lib/mspire/mzml.rb', line 215 def each_chromatogram(&block) @run.chromatogram_list.each(&block) end |
#each_spectrum(&block) ⇒ Object Also known as: each
219 220 221 |
# File 'lib/mspire/mzml.rb', line 219 def each_spectrum(&block) @run.spectrum_list.each(&block) end |
#length ⇒ Object Also known as: size
returns the number of spectra
243 244 245 |
# File 'lib/mspire/mzml.rb', line 243 def length run.spectrum_list.size end |
#num_chromatograms ⇒ Object
238 239 240 |
# File 'lib/mspire/mzml.rb', line 238 def num_chromatograms run.chromatogram_list.size end |
#spectrum(arg) ⇒ Mspire::Mzml::Spectrum Also known as: []
Returns a spectrum object.
227 228 229 |
# File 'lib/mspire/mzml.rb', line 227 def spectrum(arg) run.spectrum_list[arg] end |
#spectrum_from_scan_num(scan_num) ⇒ Mspire::Spectrum
Returns a spectrum object, or nil if not found.
253 254 255 256 257 258 |
# File 'lib/mspire/mzml.rb', line 253 def spectrum_from_scan_num(scan_num) @scan_to_index ||= @index_list[0].create_scan_index raise ScanNumbersNotUnique if @scan_to_index == false raise ScanNumbersNotFound if @scan_to_index == nil spectrum(@scan_to_index[scan_num]) end |