Sha256: b49fe158acf4e392757cea2879dd36b451a20f0a4a8fb141f4532df0551b139e

Contents?: true

Size: 815 Bytes

Versions: 8

Compression:

Stored size: 815 Bytes

Contents

require 'ms/cv/paramable'

module MS
  class Mzml

    # 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)
    class ScanList < Array
      include MS::CV::Paramable

      def initialize(opts={params: []}, &block)
        describe!(*opts[:params])
        block.call(self) if block
      end

      def to_xml(builder)
        builder.scanList(count: self.size) do |sl_n|
          @params.each {|param| param.to_xml(sl_n) } if @params
          self.each do |scan|
            scan.to_xml(sl_n)
          end
        end
        builder
      end

      alias_method :list_xml, :to_xml
    end
  end
end

Version data entries

8 entries across 8 versions & 1 rubygems

Version Path
mspire-0.6.26 lib/ms/mzml/scan_list.rb
mspire-0.6.25 lib/ms/mzml/scan_list.rb
mspire-0.6.24 lib/ms/mzml/scan_list.rb
mspire-0.6.22 lib/ms/mzml/scan_list.rb
mspire-0.6.21 lib/ms/mzml/scan_list.rb
mspire-0.6.20 lib/ms/mzml/scan_list.rb
mspire-0.6.19 lib/ms/mzml/scan_list.rb
mspire-0.6.18 lib/ms/mzml/scan_list.rb