Module: Mspire::Mzml::DataArrayContainerLike

Includes:
CV::Paramable
Included in:
Chromatogram, Spectrum
Defined in:
lib/mspire/mzml/data_array_container_like.rb

Instance Attribute Summary collapse

Attributes included from CV::Paramable

#cv_params, #ref_param_groups, #user_params

Instance Method Summary collapse

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, #initialize, #param?, #param_by_accession, #params, #params?, #to_xml

Instance Attribute Details

#data_arraysObject

(optional) an array of Mspire::Mzml::DataArray



27
28
29
# File 'lib/mspire/mzml/data_array_container_like.rb', line 27

def data_arrays
  @data_arrays
end

#data_processingObject

(optional) an Mspire::Mzml::DataProcessing object



20
21
22
# File 'lib/mspire/mzml/data_array_container_like.rb', line 20

def data_processing
  @data_processing
end

#idObject

(required) the spectrum id matching this general pattern: S+=S+( S+=S+)*)



14
15
16
# File 'lib/mspire/mzml/data_array_container_like.rb', line 14

def id
  @id
end

#indexObject

(required [at xml write time]) the index in the spectrum list



17
18
19
# File 'lib/mspire/mzml/data_array_container_like.rb', line 17

def index
  @index
end

Instance Method Details

#data_array_xml_atts(default_ids) ⇒ Object

returns a hash with id, index, defaultArrayLength and the proper dataProcessing attributes filled out.



43
44
45
46
47
48
49
# File 'lib/mspire/mzml/data_array_container_like.rb', line 43

def data_array_xml_atts(default_ids)
  atts = {id: @id, index: @index, defaultArrayLength: default_array_length}
  if @data_processing && default_ids[:data_processing] != @data_processing.id 
    atts[:dataProcessingRef] = @data_processing.id 
  end
  atts
end

#default_array_lengthObject



29
30
31
32
33
34
35
36
37
38
39
# File 'lib/mspire/mzml/data_array_container_like.rb', line 29

def default_array_length
  if @data_arrays
    if @data_arrays.first
      @data_arrays.first.size
    else
      0
    end
  else
    0
  end
end