mspire 0.6.26 → 0.7.2

Sign up to get free protection for your applications and to get access to all the features.
Files changed (132) hide show
  1. data/VERSION +1 -1
  2. data/lib/mspire.rb +1 -1
  3. data/lib/{ms → mspire}/cv.rb +1 -1
  4. data/lib/{ms → mspire}/cv/param.rb +5 -5
  5. data/lib/{ms → mspire}/cv/paramable.rb +5 -5
  6. data/lib/{ms → mspire}/digester.rb +2 -2
  7. data/lib/{ms → mspire}/error_rate/decoy.rb +1 -1
  8. data/lib/{ms → mspire}/error_rate/qvalue.rb +4 -4
  9. data/lib/{ms → mspire}/fasta.rb +5 -5
  10. data/lib/{ms → mspire}/ident.rb +10 -10
  11. data/lib/{ms → mspire}/ident/peptide.rb +3 -3
  12. data/lib/{ms → mspire}/ident/peptide/db.rb +12 -12
  13. data/lib/{ms → mspire}/ident/peptide_hit.rb +6 -6
  14. data/lib/{ms → mspire}/ident/peptide_hit/qvalue.rb +7 -7
  15. data/lib/{ms → mspire}/ident/pepxml.rb +7 -7
  16. data/lib/{ms → mspire}/ident/pepxml/modifications.rb +7 -7
  17. data/lib/{ms → mspire}/ident/pepxml/msms_pipeline_analysis.rb +6 -6
  18. data/lib/{ms → mspire}/ident/pepxml/msms_run_summary.rb +9 -9
  19. data/lib/{ms → mspire}/ident/pepxml/parameters.rb +1 -1
  20. data/lib/{ms → mspire}/ident/pepxml/sample_enzyme.rb +4 -4
  21. data/lib/{ms → mspire}/ident/pepxml/search_database.rb +5 -5
  22. data/lib/{ms → mspire}/ident/pepxml/search_hit.rb +4 -4
  23. data/lib/{ms → mspire}/ident/pepxml/search_hit/modification_info.rb +7 -7
  24. data/lib/{ms → mspire}/ident/pepxml/search_result.rb +5 -5
  25. data/lib/{ms → mspire}/ident/pepxml/search_summary.rb +12 -12
  26. data/lib/{ms → mspire}/ident/pepxml/spectrum_query.rb +7 -7
  27. data/lib/{ms → mspire}/ident/protein.rb +2 -2
  28. data/lib/{ms → mspire}/ident/protein_group.rb +2 -2
  29. data/lib/{ms → mspire}/ident/search.rb +1 -1
  30. data/lib/{ms → mspire}/isotope.rb +3 -3
  31. data/lib/{ms → mspire}/isotope/aa.rb +1 -1
  32. data/lib/{ms → mspire}/isotope/distribution.rb +17 -17
  33. data/lib/{ms → mspire}/isotope/nist_isotope_info.yml +0 -0
  34. data/lib/{ms → mspire}/mascot.rb +1 -1
  35. data/lib/{ms → mspire}/mass.rb +7 -7
  36. data/lib/{ms → mspire}/mass/aa.rb +6 -6
  37. data/lib/{ms → mspire}/molecular_formula.rb +7 -7
  38. data/lib/{ms → mspire}/mzml.rb +55 -55
  39. data/lib/{ms → mspire}/mzml/activation.rb +3 -3
  40. data/lib/{ms → mspire}/mzml/chromatogram.rb +3 -3
  41. data/lib/{ms → mspire}/mzml/chromatogram_list.rb +1 -1
  42. data/lib/{ms → mspire}/mzml/component.rb +5 -5
  43. data/lib/{ms → mspire}/mzml/contact.rb +3 -3
  44. data/lib/{ms → mspire}/mzml/cv.rb +1 -1
  45. data/lib/{ms → mspire}/mzml/data_array.rb +12 -12
  46. data/lib/{ms → mspire}/mzml/data_array_container_like.rb +7 -7
  47. data/lib/{ms → mspire}/mzml/data_processing.rb +3 -3
  48. data/lib/{ms → mspire}/mzml/file_content.rb +3 -3
  49. data/lib/{ms → mspire}/mzml/file_description.rb +4 -4
  50. data/lib/{ms → mspire}/mzml/index_list.rb +2 -2
  51. data/lib/{ms → mspire}/mzml/instrument_configuration.rb +7 -7
  52. data/lib/{ms → mspire}/mzml/isolation_window.rb +3 -3
  53. data/lib/{ms → mspire}/mzml/list.rb +1 -1
  54. data/lib/{ms → mspire}/mzml/plms1.rb +3 -3
  55. data/lib/{ms → mspire}/mzml/precursor.rb +6 -6
  56. data/lib/{ms → mspire}/mzml/processing_method.rb +3 -3
  57. data/lib/{ms → mspire}/mzml/product.rb +3 -3
  58. data/lib/{ms → mspire}/mzml/referenceable_param_group.rb +4 -4
  59. data/lib/{ms → mspire}/mzml/run.rb +3 -3
  60. data/lib/{ms → mspire}/mzml/sample.rb +5 -5
  61. data/lib/{ms → mspire}/mzml/scan.rb +4 -4
  62. data/lib/{ms → mspire}/mzml/scan_list.rb +3 -3
  63. data/lib/{ms → mspire}/mzml/scan_settings.rb +5 -5
  64. data/lib/{ms → mspire}/mzml/selected_ion.rb +5 -5
  65. data/lib/{ms → mspire}/mzml/software.rb +5 -5
  66. data/lib/{ms → mspire}/mzml/source_file.rb +5 -5
  67. data/lib/{ms → mspire}/mzml/spectrum.rb +33 -20
  68. data/lib/{ms → mspire}/mzml/spectrum_list.rb +4 -4
  69. data/lib/{ms → mspire}/obo.rb +1 -1
  70. data/lib/{ms → mspire}/peak.rb +3 -3
  71. data/lib/{ms → mspire}/peak/point.rb +1 -1
  72. data/lib/{ms → mspire}/plms1.rb +4 -4
  73. data/lib/{ms → mspire}/quant/qspec.rb +4 -4
  74. data/lib/{ms → mspire}/quant/qspec/protein_group_comparison.rb +4 -4
  75. data/lib/{ms → mspire}/spectrum.rb +6 -6
  76. data/lib/{ms → mspire}/spectrum/centroid.rb +1 -1
  77. data/lib/{ms → mspire}/spectrum_like.rb +5 -5
  78. data/lib/{ms → mspire}/user_param.rb +2 -2
  79. data/script/mzml_read_binary.rb +1 -1
  80. data/spec/{ms → mspire}/cv/param_spec.rb +6 -6
  81. data/spec/{ms → mspire}/digester_spec.rb +10 -10
  82. data/spec/{ms → mspire}/error_rate/qvalue_spec.rb +3 -3
  83. data/spec/{ms → mspire}/fasta_spec.rb +10 -10
  84. data/spec/{ms → mspire}/ident/peptide/db_spec.rb +9 -9
  85. data/spec/{ms → mspire}/ident/pepxml/sample_enzyme_spec.rb +10 -10
  86. data/spec/{ms → mspire}/ident/pepxml/search_hit/modification_info_spec.rb +4 -4
  87. data/spec/{ms → mspire}/ident/pepxml_spec.rb +22 -22
  88. data/spec/{ms → mspire}/ident/protein_group_spec.rb +4 -4
  89. data/spec/{ms → mspire}/isotope/aa_spec.rb +3 -3
  90. data/spec/{ms → mspire}/isotope/distribution_spec.rb +4 -4
  91. data/spec/{ms → mspire}/isotope_spec.rb +9 -9
  92. data/spec/{ms → mspire}/mass_spec.rb +8 -8
  93. data/spec/{ms → mspire}/molecular_formula_spec.rb +4 -4
  94. data/spec/{ms → mspire}/mzml/cv_spec.rb +4 -4
  95. data/spec/{ms → mspire}/mzml/data_array_spec.rb +7 -7
  96. data/spec/{ms → mspire}/mzml/file_content_spec.rb +4 -4
  97. data/spec/{ms → mspire}/mzml/file_description_spec.rb +4 -4
  98. data/spec/{ms → mspire}/mzml/index_list_spec.rb +13 -13
  99. data/spec/{ms → mspire}/mzml/plms1_spec.rb +8 -8
  100. data/spec/{ms → mspire}/mzml/referenceable_param_group_spec.rb +6 -6
  101. data/spec/{ms → mspire}/mzml_spec.rb +30 -30
  102. data/spec/{ms → mspire}/peak_spec.rb +10 -10
  103. data/spec/{ms → mspire}/plms1_spec.rb +7 -7
  104. data/spec/{ms → mspire}/quant/qspec_spec.rb +2 -2
  105. data/spec/{ms → mspire}/spectrum_spec.rb +8 -8
  106. data/spec/{ms → mspire}/user_param_spec.rb +8 -8
  107. data/spec/testfiles/{ms → mspire}/ident/peptide/db/uni_11_sp_tr.fasta +0 -0
  108. data/spec/testfiles/{ms → mspire}/ident/peptide/db/uni_11_sp_tr.msd_clvg2.min_aaseq4.yml +0 -0
  109. data/spec/testfiles/{ms → mspire}/mzml/j24z.idx_comp.3.mzML +0 -0
  110. data/spec/testfiles/{ms → mspire}/mzml/mspire_simulated.MSn.check.mzML +0 -0
  111. data/spec/testfiles/{ms → mspire}/mzml/openms.noidx_nocomp.12.mzML +0 -0
  112. data/spec/testfiles/{ms → mspire}/quant/kill_extra_tabs.rb +0 -0
  113. data/spec/testfiles/{ms → mspire}/quant/max_quant_output.provenance.txt +0 -0
  114. data/spec/testfiles/{ms → mspire}/quant/max_quant_output.txt +0 -0
  115. data/spec/testfiles/{ms → mspire}/quant/pdcd5_final.killedextratabs.tsv +0 -0
  116. data/spec/testfiles/{ms → mspire}/quant/pdcd5_final.killedextratabs.tsv_qspecgp +0 -0
  117. data/spec/testfiles/{ms → mspire}/quant/pdcd5_final.killedextratabs.tsv_qspecgp.csv +0 -0
  118. data/spec/testfiles/{ms → mspire}/quant/pdcd5_final.txt +0 -0
  119. data/spec/testfiles/{ms → mspire}/quant/pdcd5_final.txt_qspecgp +0 -0
  120. data/spec/testfiles/{ms → mspire}/quant/pdcd5_lfq_qspec.CSV.csv +0 -0
  121. data/spec/testfiles/{ms → mspire}/quant/pdcd5_lfq_qspec.csv +0 -0
  122. data/spec/testfiles/{ms → mspire}/quant/pdcd5_lfq_qspec.oneprot.csv +0 -0
  123. data/spec/testfiles/{ms → mspire}/quant/pdcd5_lfq_qspec.oneprot.tsv +0 -0
  124. data/spec/testfiles/{ms → mspire}/quant/pdcd5_lfq_qspec.oneprot.tsv_qspecgp +0 -0
  125. data/spec/testfiles/{ms → mspire}/quant/pdcd5_lfq_qspec.oneprot.tsv_qspecgp.csv +0 -0
  126. data/spec/testfiles/{ms → mspire}/quant/pdcd5_lfq_qspec.txt +0 -0
  127. data/spec/testfiles/{ms → mspire}/quant/pdcd5_lfq_tabdel.txt +0 -0
  128. data/spec/testfiles/{ms → mspire}/quant/pdcd5_lfq_tabdel.txt_qspecgp +0 -0
  129. data/spec/testfiles/{ms → mspire}/quant/remove_rest_of_proteins.rb +0 -0
  130. data/spec/testfiles/{ms → mspire}/quant/unlog_transform.rb +0 -0
  131. metadata +148 -194
  132. data/lib/ms.rb +0 -3
@@ -1,6 +1,6 @@
1
- require 'ms/mass'
1
+ require 'mspire/mass'
2
2
 
3
- module MS
3
+ module Mspire
4
4
  module Mass
5
5
  module AA
6
6
  # amino_acids keys as strings, average masses
@@ -69,11 +69,11 @@ module MS
69
69
  AVG_SYM = Hash[AVG_STRING.map {|aa,mass| [aa.to_sym, mass] } ]
70
70
 
71
71
  # Monoisotopic amino acid masses keyed as symbols and also strings (all
72
- # upper case). Also includes MS::Mass::MONO for things like protons ('h+')
73
- MONO = MONO_SYM.merge(MONO_STRING).merge(MS::Mass::MONO)
72
+ # upper case). Also includes Mspire::Mass::MONO for things like protons ('h+')
73
+ MONO = MONO_SYM.merge(MONO_STRING).merge(Mspire::Mass::MONO)
74
74
  # Average amino acid masses keyed as symbols and also strings (all
75
- # uppder case). Also includes MS::Mass::AVG for things like protons ('h+')
76
- AVG = AVG_SYM.merge(AVG_STRING).merge(MS::Mass::AVG)
75
+ # uppder case). Also includes Mspire::Mass::AVG for things like protons ('h+')
76
+ AVG = AVG_SYM.merge(AVG_STRING).merge(Mspire::Mass::AVG)
77
77
  end
78
78
  end
79
79
  end
@@ -1,8 +1,8 @@
1
- require 'ms/isotope'
2
- require 'ms/isotope/aa'
3
- require 'ms/mass'
1
+ require 'mspire/isotope'
2
+ require 'mspire/isotope/aa'
3
+ require 'mspire/mass'
4
4
 
5
- module MS
5
+ module Mspire
6
6
  class MolecularFormula < Hash
7
7
 
8
8
  # integer desribing the charge state
@@ -25,7 +25,7 @@ module MS
25
25
 
26
26
  def self.from_aaseq(aaseq)
27
27
  hash = aaseq.each_char.inject({}) do |hash,aa|
28
- hash.merge(MS::Isotope::AA::ATOM_COUNTS[aa]) {|h,o,n| (o ? o : 0) +n }
28
+ hash.merge(Mspire::Isotope::AA::ATOM_COUNTS[aa]) {|h,o,n| (o ? o : 0) +n }
29
29
  end
30
30
  hash[:h] += 2
31
31
  hash[:o] += 1
@@ -34,8 +34,8 @@ module MS
34
34
 
35
35
  # gives the monoisotopic mass adjusted by the current charge
36
36
  def mass
37
- mss = inject(0.0) {|sum,(el,cnt)| sum + (MS::Mass::MONO[el]*cnt) }
38
- mss - (MS::Mass::ELECTRON * charge)
37
+ mss = inject(0.0) {|sum,(el,cnt)| sum + (Mspire::Mass::MONO[el]*cnt) }
38
+ mss - (Mspire::Mass::ELECTRON * charge)
39
39
  end
40
40
 
41
41
  end
@@ -3,28 +3,28 @@ require 'builder'
3
3
  require 'nokogiri'
4
4
  require 'io/bookmark'
5
5
  require 'zlib'
6
- require 'ms/mzml/index_list'
7
- require 'ms/mzml/spectrum'
8
- require 'ms/mzml/file_description'
9
- require 'ms/mzml/software'
10
- require 'ms/mzml/scan_list'
11
- require 'ms/mzml/selected_ion'
12
- require 'ms/mzml/scan'
13
- require 'ms/mzml/scan_settings'
14
- require 'ms/mzml/processing_method'
15
- require 'ms/mzml/run'
16
- require 'ms/mzml/spectrum_list'
17
- require 'ms/mzml/chromatogram_list'
18
- require 'ms/mzml/instrument_configuration'
19
- require 'ms/mzml/data_processing'
20
- require 'ms/mzml/referenceable_param_group'
21
- require 'ms/mzml/cv'
22
- require 'ms/mzml/sample'
23
-
24
- module MS
6
+ require 'mspire/mzml/index_list'
7
+ require 'mspire/mzml/spectrum'
8
+ require 'mspire/mzml/file_description'
9
+ require 'mspire/mzml/software'
10
+ require 'mspire/mzml/scan_list'
11
+ require 'mspire/mzml/selected_ion'
12
+ require 'mspire/mzml/scan'
13
+ require 'mspire/mzml/scan_settings'
14
+ require 'mspire/mzml/processing_method'
15
+ require 'mspire/mzml/run'
16
+ require 'mspire/mzml/spectrum_list'
17
+ require 'mspire/mzml/chromatogram_list'
18
+ require 'mspire/mzml/instrument_configuration'
19
+ require 'mspire/mzml/data_processing'
20
+ require 'mspire/mzml/referenceable_param_group'
21
+ require 'mspire/mzml/cv'
22
+ require 'mspire/mzml/sample'
23
+
24
+ module Mspire
25
25
  # Reading an mzxml file:
26
26
  #
27
- # MS::Mzml.open("somefile.mzML") do |mzml|
27
+ # Mspire::Mzml.open("somefile.mzML") do |mzml|
28
28
  # mzml.each do |spectrum|
29
29
  # scan = spectrum.scan
30
30
  # spectrum.mzs # array of m/zs
@@ -42,10 +42,10 @@ module MS
42
42
  #
43
43
  # Writing an mzml file from scratch:
44
44
  #
45
- # spec1 = MS::Mzml::Spectrum.new('scan=1', params: ['MS:1000127', ['MS:1000511', 1]]) do |spec|
45
+ # spec1 = Mspire::Mzml::Spectrum.new('scan=1', params: ['MS:1000127', ['MS:1000511', 1]]) do |spec|
46
46
  # spec.data_arrays = [[1,2,3], [4,5,6]]
47
- # spec.scan_list = MS::Mzml::ScanList.new do |sl|
48
- # scan = MS::Mzml::Scan.new do |scan|
47
+ # spec.scan_list = Mspire::Mzml::ScanList.new do |sl|
48
+ # scan = Mspire::Mzml::Scan.new do |scan|
49
49
  # # retention time of 40 seconds
50
50
  # scan.describe! ['MS:1000016', 40.0, 'UO:0000010']
51
51
  # end
@@ -53,21 +53,21 @@ module MS
53
53
  # end
54
54
  # end
55
55
  #
56
- # mzml = MS::Mzml.new do |mzml|
56
+ # mzml = Mspire::Mzml.new do |mzml|
57
57
  # mzml.id = 'the_little_example'
58
- # mzml.cvs = MS::Mzml::CV::DEFAULT_CVS
59
- # mzml.file_description = MS::Mzml::FileDescription.new do |fd|
60
- # fd.file_content = MS::Mzml::FileContent.new
61
- # fd.source_files << MS::Mzml::SourceFile.new
58
+ # mzml.cvs = Mspire::Mzml::CV::DEFAULT_CVS
59
+ # mzml.file_description = Mspire::Mzml::FileDescription.new do |fd|
60
+ # fd.file_content = Mspire::Mzml::FileContent.new
61
+ # fd.source_files << Mspire::Mzml::SourceFile.new
62
62
  # end
63
- # default_instrument_config = MS::Mzml::InstrumentConfiguration.new("IC",[], params: ['MS:1000031'])
63
+ # default_instrument_config = Mspire::Mzml::InstrumentConfiguration.new("IC",[], params: ['MS:1000031'])
64
64
  # mzml.instrument_configurations << default_instrument_config
65
- # software = MS::Mzml::Software.new
65
+ # software = Mspire::Mzml::Software.new
66
66
  # mzml.software_list << software
67
- # default_data_processing = MS::Mzml::DataProcessing.new("did_nothing")
67
+ # default_data_processing = Mspire::Mzml::DataProcessing.new("did_nothing")
68
68
  # mzml.data_processing_list << default_data_processing
69
- # mzml.run = MS::Mzml::Run.new("little_run", default_instrument_config) do |run|
70
- # spectrum_list = MS::Mzml::SpectrumList.new(default_data_processing)
69
+ # mzml.run = Mspire::Mzml::Run.new("little_run", default_instrument_config) do |run|
70
+ # spectrum_list = Mspire::Mzml::SpectrumList.new(default_data_processing)
71
71
  # spectrum_list.push(spec1)
72
72
  # run.spectrum_list = spectrum_list
73
73
  # end
@@ -101,31 +101,31 @@ module MS
101
101
  # SUBELEMENTS
102
102
  ###############################################
103
103
 
104
- # (required) an array of MS::Mzml::CV objects
104
+ # (required) an array of Mspire::Mzml::CV objects
105
105
  attr_accessor :cvs
106
106
 
107
- # (required) an MS::Mzml::FileDescription
107
+ # (required) an Mspire::Mzml::FileDescription
108
108
  attr_accessor :file_description
109
109
 
110
110
  # (optional) an array of CV::ReferenceableParamGroup objects
111
111
  attr_accessor :referenceable_param_groups
112
112
 
113
- # (optional) an array of MS::Mzml::Sample objects
113
+ # (optional) an array of Mspire::Mzml::Sample objects
114
114
  attr_accessor :samples
115
115
 
116
- # (required) an array of MS::Mzml::Software objects
116
+ # (required) an array of Mspire::Mzml::Software objects
117
117
  attr_accessor :software_list
118
118
 
119
- # (optional) an array of MS::Mzml::ScanSettings objects
119
+ # (optional) an array of Mspire::Mzml::ScanSettings objects
120
120
  attr_accessor :scan_settings_list
121
121
 
122
- # (required) an array of MS::Mzml::InstrumentConfiguration objects
122
+ # (required) an array of Mspire::Mzml::InstrumentConfiguration objects
123
123
  attr_accessor :instrument_configurations
124
124
 
125
- # (required) an array of MS::Mzml::DataProcessing objects
125
+ # (required) an array of Mspire::Mzml::DataProcessing objects
126
126
  attr_accessor :data_processing_list
127
127
 
128
- # (required) an MS::Mzml::Run object
128
+ # (required) an Mspire::Mzml::Run object
129
129
  attr_accessor :run
130
130
 
131
131
  module Parser
@@ -219,11 +219,11 @@ module MS
219
219
  end
220
220
 
221
221
  # @param [Object] arg an index number (Integer) or id string (String)
222
- # @return [MS::Spectrum] a spectrum object
222
+ # @return [Mspire::Spectrum] a spectrum object
223
223
  def spectrum(arg)
224
224
  start_byte = index_list[0].start_byte(arg)
225
225
  spec_n = spectrum_node_from_start_byte(start_byte)
226
- MS::Mzml::Spectrum.from_xml(spec_n)
226
+ Mspire::Mzml::Spectrum.from_xml(spec_n)
227
227
  end
228
228
 
229
229
  # returns the number of spectra
@@ -234,7 +234,7 @@ module MS
234
234
  alias_method :'[]', :spectrum
235
235
 
236
236
  # @param [Integer] scan_num the scan number
237
- # @return [MS::Spectrum] a spectrum object, or nil if not found
237
+ # @return [Mspire::Spectrum] a spectrum object, or nil if not found
238
238
  # @raise [ScanNumbersNotUnique] if scan numbers are not unique
239
239
  # @raise [ScanNumbersNotFound] if spectra exist but scan numbers were not
240
240
  # found
@@ -245,10 +245,10 @@ module MS
245
245
  spectrum(@scan_to_index[scan_num])
246
246
  end
247
247
 
248
- # @return [MS::Mzml::IndexList] or nil if there is no indexList in the
248
+ # @return [Mspire::Mzml::IndexList] or nil if there is no indexList in the
249
249
  # mzML
250
250
  def read_index_list
251
- if offset=MS::Mzml::Index.index_offset(@io)
251
+ if offset=Mspire::Mzml::Index.index_offset(@io)
252
252
  @io.seek(offset)
253
253
  xml = Nokogiri::XML.parse(@io.read, nil, @encoding, Parser::NOBLANKS)
254
254
  index_list = xml.root
@@ -269,7 +269,7 @@ module MS
269
269
  end
270
270
  end
271
271
  # Reads through and captures start bytes
272
- # @return [MS::Mzml::IndexList]
272
+ # @return [Mspire::Mzml::IndexList]
273
273
  def create_index_list
274
274
  indices_hash = @io.bookmark(true) do |inner_io| # sets to beginning of file
275
275
  indices = {:spectrum => {}, :chromatogram => {}}
@@ -316,21 +316,21 @@ module MS
316
316
 
317
317
  xml.mzML(mzml_atts) do |mzml_n|
318
318
  # the 'if' statements capture whether or not the list is required or not
319
- raise "#{self.class}#cvs must have > 0 MS::Mzml::CV objects" unless @cvs.size > 0
320
- MS::Mzml::CV.list_xml(@cvs, mzml_n)
319
+ raise "#{self.class}#cvs must have > 0 Mspire::Mzml::CV objects" unless @cvs.size > 0
320
+ Mspire::Mzml::CV.list_xml(@cvs, mzml_n)
321
321
  @file_description.to_xml(mzml_n)
322
322
  if @referenceable_param_groups
323
- MS::Mzml::ReferenceableParamGroup.list_xml(@referenceable_param_groups, mzml_n)
323
+ Mspire::Mzml::ReferenceableParamGroup.list_xml(@referenceable_param_groups, mzml_n)
324
324
  end
325
325
  if @samples
326
- MS::Mzml::Sample.list_xml(@samples, mzml_n)
326
+ Mspire::Mzml::Sample.list_xml(@samples, mzml_n)
327
327
  end
328
- MS::Mzml::Software.list_xml(@software_list, mzml_n)
328
+ Mspire::Mzml::Software.list_xml(@software_list, mzml_n)
329
329
  if @scan_settings_list && @scan_settings_list.size > 0
330
- MS::Mzml::ScanSettings.list_xml(@scan_settings_list, mzml_n)
330
+ Mspire::Mzml::ScanSettings.list_xml(@scan_settings_list, mzml_n)
331
331
  end
332
- icl = MS::Mzml::InstrumentConfiguration.list_xml(@instrument_configurations, mzml_n)
333
- MS::Mzml::DataProcessing.list_xml(@data_processing_list, mzml_n)
332
+ icl = Mspire::Mzml::InstrumentConfiguration.list_xml(@instrument_configurations, mzml_n)
333
+ Mspire::Mzml::DataProcessing.list_xml(@data_processing_list, mzml_n)
334
334
  @run.to_xml(mzml_n)
335
335
  end
336
336
 
@@ -1,6 +1,6 @@
1
- require 'ms/cv/paramable'
1
+ require 'mspire/cv/paramable'
2
2
 
3
- module MS
3
+ module Mspire
4
4
  class Mzml
5
5
 
6
6
  # MAY supply a *child* term of MS:1000510 (precursor activation attribute) one or more times
@@ -27,7 +27,7 @@ module MS
27
27
  # e.g.: MS:1000433 (low-energy collision-induced dissociation)
28
28
  # et al.
29
29
  class Activation
30
- include MS::CV::Paramable
30
+ include Mspire::CV::Paramable
31
31
  end
32
32
  end
33
33
  end
@@ -1,9 +1,9 @@
1
- require 'ms/mzml/data_array_container_like'
1
+ require 'mspire/mzml/data_array_container_like'
2
2
 
3
- module MS
3
+ module Mspire
4
4
  class Mzml
5
5
  class Chromatogram
6
- include MS::Mzml::DataArrayContainerLike
6
+ include Mspire::Mzml::DataArrayContainerLike
7
7
 
8
8
  # (optional) precursor isolations to the chromatogram currently being
9
9
  # described
@@ -1,6 +1,6 @@
1
1
 
2
2
 
3
- module MS
3
+ module Mspire
4
4
  class Mzml
5
5
  class ChromatogramList < Array
6
6
 
@@ -1,10 +1,10 @@
1
- require 'ms/cv/paramable'
2
- require 'ms/mzml/list'
1
+ require 'mspire/cv/paramable'
2
+ require 'mspire/mzml/list'
3
3
 
4
- module MS
4
+ module Mspire
5
5
  class Mzml
6
6
  module Component
7
- include MS::CV::Paramable
7
+ include Mspire::CV::Paramable
8
8
 
9
9
  attr_accessor :order
10
10
 
@@ -15,7 +15,7 @@ module MS
15
15
  builder
16
16
  end
17
17
 
18
- extend(MS::Mzml::List)
18
+ extend(Mspire::Mzml::List)
19
19
  end
20
20
  end
21
21
  end
@@ -1,6 +1,6 @@
1
- require 'ms/cv/paramable'
1
+ require 'mspire/cv/paramable'
2
2
 
3
- module MS
3
+ module Mspire
4
4
  class Mzml
5
5
  class Contact
6
6
 
@@ -11,7 +11,7 @@ module MS
11
11
  email: 'MS:1000589'
12
12
  }
13
13
 
14
- include MS::CV::Paramable
14
+ include Mspire::CV::Paramable
15
15
 
16
16
  def to_xml(builder)
17
17
  builder.contact do |fc_n|
@@ -1,5 +1,5 @@
1
1
 
2
- module MS
2
+ module Mspire
3
3
  class Mzml
4
4
  class CV
5
5
 
@@ -1,12 +1,12 @@
1
1
  require 'base64'
2
2
  require 'zlib'
3
- require 'ms/cv/paramable'
3
+ require 'mspire/cv/paramable'
4
4
 
5
- module MS
5
+ module Mspire
6
6
  class Mzml
7
7
  class DataArray < Array
8
8
  alias_method :array_initialize, :initialize
9
- include MS::CV::Paramable
9
+ include Mspire::CV::Paramable
10
10
 
11
11
  DEFAULT_DTYPE = :float64
12
12
  DEFAULT_COMPRESSION = true
@@ -25,16 +25,16 @@ module MS
25
25
  array_initialize(*args)
26
26
  end
27
27
 
28
- # returns a new MS::Mzml::DataArray object (an array)
28
+ # returns a new Mspire::Mzml::DataArray object (an array)
29
29
  #
30
30
  # args:
31
31
  # base64, set-like # where set-like responds to include?
32
32
  # base64, type=:float64, compression=true
33
33
  #
34
34
  # examples:
35
- # MS::Mzml::Spectrum.unpack_binary('eJxjYACBD/YMEOAAoTgcABe3Abg=', ['MS:1000574', MS:1000523']).
36
- # MS::Mzml::Spectrum.unpack_binary("ADBA/=", :float32, true)
37
- # MS::Mzml::Spectrum.unpack_binary("ADBA/=") # uses float64 and compression
35
+ # Mspire::Mzml::Spectrum.unpack_binary('eJxjYACBD/YMEOAAoTgcABe3Abg=', ['MS:1000574', MS:1000523']).
36
+ # Mspire::Mzml::Spectrum.unpack_binary("ADBA/=", :float32, true)
37
+ # Mspire::Mzml::Spectrum.unpack_binary("ADBA/=") # uses float64 and compression
38
38
  def self.from_binary(base64, *args)
39
39
  if args.first.respond_to?(:include?)
40
40
  accessions = args.first
@@ -119,11 +119,11 @@ module MS
119
119
  builder.binaryDataArray(encodedLength: encoded_length) do |bda_n|
120
120
  @params.each {|param| param.to_xml(bda_n) } if @params
121
121
  unless @external
122
- MS::CV::Param[ DTYPE_TO_ACC[dtype] ].to_xml(bda_n)
123
- MS::CV::Param[ compression ? 'MS:1000574' : 'MS:1000576' ].to_xml(bda_n)
122
+ Mspire::CV::Param[ DTYPE_TO_ACC[dtype] ].to_xml(bda_n)
123
+ Mspire::CV::Param[ compression ? 'MS:1000574' : 'MS:1000576' ].to_xml(bda_n)
124
124
  if @type
125
125
  accession = ( (@type == :mz) ? 'MS:1000514' : 'MS:1000515' )
126
- MS::CV::Param[accession].to_xml(bda_n)
126
+ Mspire::CV::Param[accession].to_xml(bda_n)
127
127
  bda_n.binary(base64)
128
128
  end
129
129
  end
@@ -135,10 +135,10 @@ module MS
135
135
  builder.binaryDataArrayList(count: arrays.size) do |bdal_n|
136
136
  arrays.zip([:mz, :intensity]) do |data_ar, typ|
137
137
  ar =
138
- if data_ar.is_a?(MS::Mzml::DataArray)
138
+ if data_ar.is_a?(Mspire::Mzml::DataArray)
139
139
  data_ar
140
140
  else
141
- real_data_array = MS::Mzml::DataArray.new(data_ar)
141
+ real_data_array = Mspire::Mzml::DataArray.new(data_ar)
142
142
  real_data_array.type = typ
143
143
  real_data_array
144
144
  end
@@ -1,10 +1,10 @@
1
- require 'ms/cv/paramable'
2
- require 'ms/mzml/data_array'
1
+ require 'mspire/cv/paramable'
2
+ require 'mspire/mzml/data_array'
3
3
 
4
- module MS
4
+ module Mspire
5
5
  class Mzml
6
6
  module DataArrayContainerLike
7
- include MS::CV::Paramable
7
+ include Mspire::CV::Paramable
8
8
 
9
9
  ###########################################
10
10
  # ATTRIBUTES
@@ -16,14 +16,14 @@ module MS
16
16
  # (required [at xml write time]) the index in the spectrum list
17
17
  attr_accessor :index
18
18
 
19
- # (optional) an MS::Mzml::DataProcessing object
19
+ # (optional) an Mspire::Mzml::DataProcessing object
20
20
  attr_accessor :data_processing
21
21
 
22
22
  ###########################################
23
23
  # SUBELEMENTS
24
24
  ###########################################
25
25
 
26
- # (optional) an array of MS::Mzml::DataArray
26
+ # (optional) an array of Mspire::Mzml::DataArray
27
27
  attr_accessor :data_arrays
28
28
 
29
29
  def initialize(id, opts={params: []})
@@ -55,7 +55,7 @@ module MS
55
55
  builder.spectrum(atts) do |sp_n|
56
56
  super(sp_n) # params
57
57
  block.call(sp_n) if block
58
- MS::Mzml::DataArray.list_xml(@data_arrays, sp_n) if @data_arrays
58
+ Mspire::Mzml::DataArray.list_xml(@data_arrays, sp_n) if @data_arrays
59
59
  end
60
60
  builder
61
61
  end