Class: Mspire::Mzml::ScanList
- Includes:
- CV::Paramable
- Defined in:
- lib/mspire/mzml/scan_list.rb
Overview
MUST supply a child term of MS:1000570 (spectra combination) only once
e.g.: MS:1000571 (sum of spectra)
e.g.: MS:1000573 (median of spectra)
e.g.: MS:1000575 (mean of spectra)
e.g.: MS:1000795 (no combination)
Instance Attribute Summary
Attributes included from CV::Paramable
#cv_params, #ref_param_groups, #user_params
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize {|_self| ... } ⇒ ScanList
constructor
A new instance of ScanList.
- #to_xml(builder, default_ids) ⇒ Object (also: #list_xml)
Methods included from CV::Paramable
#accessionable_params, #describe!, #describe_from_xml!, #describe_many!, #describe_self_from_xml!, #each_accessionable_param, #each_param, #fetch, #fetch_by_accession, #param?, #param_by_accession, #params, #params?, #reject!, #replace!, #replace_many!
Methods inherited from Array
Constructor Details
#initialize {|_self| ... } ⇒ ScanList
Returns a new instance of ScanList.
16 17 18 19 |
# File 'lib/mspire/mzml/scan_list.rb', line 16 def initialize params_init yield(self) if block_given? end |
Class Method Details
.from_xml(xml, link) ⇒ Object
31 32 33 34 35 36 37 38 39 40 41 |
# File 'lib/mspire/mzml/scan_list.rb', line 31 def self.from_xml(xml, link) scan_list = self.new scan_n = scan_list.describe_from_xml!(xml, link[:ref_hash]) if scan_n loop do scan_list << Mspire::Mzml::Scan.from_xml(scan_n, link) break unless scan_n = scan_n.next end end scan_list end |
Instance Method Details
#to_xml(builder, default_ids) ⇒ Object Also known as: list_xml
21 22 23 24 25 26 27 28 29 |
# File 'lib/mspire/mzml/scan_list.rb', line 21 def to_xml(builder, default_ids) builder.scanList(count: self.size) do |sl_n| super(sl_n) self.each do |scan| scan.to_xml(sl_n, default_ids) end end builder end |