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,12 +1,12 @@
1
1
  require 'spec_helper'
2
2
 
3
- require 'ms/mzml'
4
- require 'ms/mzml/index_list'
3
+ require 'mspire/mzml'
4
+ require 'mspire/mzml/index_list'
5
5
 
6
6
  describe 'non-indexed uncompressed peaks, mzML file' do
7
- subject { TESTFILES + "/ms/mzml/openms.noidx_nocomp.12.mzML" }
7
+ subject { TESTFILES + "/mspire/mzml/openms.noidx_nocomp.12.mzML" }
8
8
 
9
- describe 'MS::Mzml getting the IndexList' do
9
+ describe 'Mspire::Mzml getting the IndexList' do
10
10
  before do
11
11
  @io = File.open(subject)
12
12
  end
@@ -15,7 +15,7 @@ describe 'non-indexed uncompressed peaks, mzML file' do
15
15
  end
16
16
 
17
17
  it 'works for an un-indexed file' do
18
- mzml = MS::Mzml.new(@io)
18
+ mzml = Mspire::Mzml.new(@io)
19
19
  index_list = mzml.index_list
20
20
  spectrum_idx = index_list[:spectrum]
21
21
  spectrum_idx.name.should == :spectrum
@@ -38,10 +38,10 @@ end
38
38
 
39
39
 
40
40
  describe 'indexed, compressed peaks, mzML file' do
41
- subject { TESTFILES + "/ms/mzml/j24z.idx_comp.3.mzML" }
41
+ subject { TESTFILES + "/mspire/mzml/j24z.idx_comp.3.mzML" }
42
42
 
43
43
 
44
- describe 'MS::Mzml getting the IndexList' do
44
+ describe 'Mspire::Mzml getting the IndexList' do
45
45
  before do
46
46
  @io = File.open(subject)
47
47
  end
@@ -65,21 +65,21 @@ describe 'indexed, compressed peaks, mzML file' do
65
65
  end
66
66
 
67
67
  it 'works for an indexed file' do
68
- mzml = MS::Mzml.new(@io)
68
+ mzml = Mspire::Mzml.new(@io)
69
69
  index_list = mzml.index_list
70
70
  correct_index_list.call(index_list)
71
71
  end
72
72
 
73
73
  it 'can create the index manually, if requested' do
74
- mzml = MS::Mzml.new(@io)
74
+ mzml = Mspire::Mzml.new(@io)
75
75
  index_list = mzml.create_index_list
76
76
  correct_index_list.call(index_list)
77
77
  end
78
78
 
79
- describe 'an MS::Mzxml::IndexList' do
79
+ describe 'an Mspire::Mzxml::IndexList' do
80
80
  before do
81
81
  @inner_io = File.open(subject)
82
- mzml = MS::Mzml.new(@inner_io)
82
+ mzml = Mspire::Mzml.new(@inner_io)
83
83
  @index_list = mzml.index_list
84
84
  end
85
85
  after do
@@ -96,10 +96,10 @@ describe 'indexed, compressed peaks, mzML file' do
96
96
  end
97
97
  end
98
98
 
99
- describe 'an MS::Mzxml::Index' do
99
+ describe 'an Mspire::Mzxml::Index' do
100
100
  before do
101
101
  @inner_io = File.open(subject)
102
- mzml = MS::Mzml.new(@inner_io)
102
+ mzml = Mspire::Mzml.new(@inner_io)
103
103
  @spec_index = mzml.index_list[:spectrum]
104
104
  end
105
105
  after do
@@ -1,13 +1,13 @@
1
1
  require 'spec_helper'
2
2
 
3
- require 'ms/mzml'
4
- require 'ms/mzml/plms1'
3
+ require 'mspire/mzml'
4
+ require 'mspire/mzml/plms1'
5
5
 
6
6
  describe 'converting mzml to plms1' do
7
7
  describe 'converting no spectra mzml' do
8
8
  before do
9
- @mzml_file = File.open( TESTFILES + "/ms/mzml/openms.noidx_nocomp.12.mzML" )
10
- @mzml = MS::Mzml.new(@mzml_file)
9
+ @mzml_file = File.open( TESTFILES + "/mspire/mzml/openms.noidx_nocomp.12.mzML" )
10
+ @mzml = Mspire::Mzml.new(@mzml_file)
11
11
  end
12
12
 
13
13
  after do
@@ -23,7 +23,7 @@ describe 'converting mzml to plms1' do
23
23
  plms1.scan_numbers.should == scan_nums
24
24
  plms1.spectra.each do |spec|
25
25
  spec.size.should == 2
26
- spec.should be_a_kind_of(MS::SpectrumLike)
26
+ spec.should be_a_kind_of(Mspire::SpectrumLike)
27
27
  spec.mzs.should == []
28
28
  spec.intensities.should == []
29
29
  end
@@ -34,8 +34,8 @@ describe 'converting mzml to plms1' do
34
34
 
35
35
  describe 'converting normal mzml' do
36
36
  before do
37
- @mzml_file = File.open( TESTFILES + "/ms/mzml/j24z.idx_comp.3.mzML" )
38
- @mzml = MS::Mzml.new(@mzml_file)
37
+ @mzml_file = File.open( TESTFILES + "/mspire/mzml/j24z.idx_comp.3.mzML" )
38
+ @mzml = Mspire::Mzml.new(@mzml_file)
39
39
  end
40
40
 
41
41
  after do
@@ -51,7 +51,7 @@ describe 'converting mzml to plms1' do
51
51
  plms1.scan_numbers.should == [1, 2, 3]
52
52
  sizes = [20168, 315, 634]
53
53
  plms1.spectra.zip(sizes).each do |spec,exp_size|
54
- spec.should be_a_kind_of(MS::SpectrumLike)
54
+ spec.should be_a_kind_of(Mspire::SpectrumLike)
55
55
  spec.size.should == 2
56
56
  spec.mzs.size.should == exp_size
57
57
  spec.intensities.size.should == exp_size
@@ -1,18 +1,18 @@
1
1
  require 'spec_helper'
2
2
  require 'builder'
3
3
 
4
- require 'ms/mzml/referenceable_param_group'
4
+ require 'mspire/mzml/referenceable_param_group'
5
5
 
6
- describe MS::Mzml::ReferenceableParamGroup do
6
+ describe Mspire::Mzml::ReferenceableParamGroup do
7
7
 
8
8
  it 'is created with an id and params' do
9
9
  # the id is required for these objects
10
10
  # no compression
11
- rfgroup1 = MS::Mzml::ReferenceableParamGroup.new("mzArray", params: ['MS:1000576', 'MS:1000514'])
12
- rfgroup2 = MS::Mzml::ReferenceableParamGroup.new("intensityArray", params: ['MS:1000576', 'MS:1000515'])
11
+ rfgroup1 = Mspire::Mzml::ReferenceableParamGroup.new("mzArray", params: ['MS:1000576', 'MS:1000514'])
12
+ rfgroup2 = Mspire::Mzml::ReferenceableParamGroup.new("intensityArray", params: ['MS:1000576', 'MS:1000515'])
13
13
 
14
14
  b = Builder::XmlMarkup.new(:indent => 2)
15
- z = MS::Mzml::ReferenceableParamGroup.list_xml([rfgroup1, rfgroup2], b)
15
+ z = Mspire::Mzml::ReferenceableParamGroup.list_xml([rfgroup1, rfgroup2], b)
16
16
  xml = b.to_xml
17
17
  [/referenceableParamGroupList.*count="2/, /cvParam.*cvRef/, /id="intensityArray"/].each do |regexp|
18
18
  xml.should match(regexp)
@@ -20,7 +20,7 @@ describe MS::Mzml::ReferenceableParamGroup do
20
20
  end
21
21
 
22
22
  it '#to_xml gives a ReferenceableParamGroupRef' do
23
- rfgroup1 = MS::Mzml::ReferenceableParamGroup.new("mzArray", params: ['MS:1000576', 'MS:1000514'])
23
+ rfgroup1 = Mspire::Mzml::ReferenceableParamGroup.new("mzArray", params: ['MS:1000576', 'MS:1000514'])
24
24
  builder = Builder::XmlMarkup.new(:indent => 2)
25
25
  rfgroup1.to_xml(builder)
26
26
  xml = builder.to_xml
@@ -1,17 +1,17 @@
1
1
  require 'spec_helper'
2
2
  require 'builder'
3
3
 
4
- require 'ms/mzml'
4
+ require 'mspire/mzml'
5
5
 
6
- describe MS::Mzml do
6
+ describe Mspire::Mzml do
7
7
 
8
8
  describe 'reading an indexed, compressed peaks, mzML file' do
9
9
  describe 'reading a spectrum' do
10
10
 
11
11
  before do
12
- @file = TESTFILES + "/ms/mzml/j24z.idx_comp.3.mzML"
12
+ @file = TESTFILES + "/mspire/mzml/j24z.idx_comp.3.mzML"
13
13
  @io = File.open(@file)
14
- @mzml = MS::Mzml.new(@io)
14
+ @mzml = Mspire::Mzml.new(@io)
15
15
  end
16
16
  after do
17
17
  @io.close
@@ -22,7 +22,7 @@ describe MS::Mzml do
22
22
  spectrum1 = @mzml[1] # can get with brackets
23
23
  spectrum.ms_level.should == 2
24
24
  spectrum.should == spectrum1
25
- spectrum.should be_a(MS::Mzml::Spectrum)
25
+ spectrum.should be_a(Mspire::Mzml::Spectrum)
26
26
  spectrum.should respond_to(:mzs)
27
27
  spectrum.should respond_to(:intensities)
28
28
  spectrum.mzs.size.should == 315
@@ -35,13 +35,13 @@ describe MS::Mzml do
35
35
  spectrum1 = @mzml["controllerType=0 controllerNumber=1 scan=2"]
36
36
  spectrum.ms_level.should == 2
37
37
  spectrum.should == spectrum1
38
- spectrum.should be_a(MS::Mzml::Spectrum)
38
+ spectrum.should be_a(Mspire::Mzml::Spectrum)
39
39
  end
40
40
 
41
41
  it 'each spectrum knows its retention_time' do
42
42
  spec = @mzml[1]
43
43
  rt = @mzml[1].retention_time
44
- rt.should == 33.035128333333333
44
+ rt.should == 1982.1077
45
45
  end
46
46
 
47
47
  it 'goes through spectrum with #each or #each_spectrum' do
@@ -62,13 +62,13 @@ describe MS::Mzml do
62
62
 
63
63
  it 'iterates with foreach' do
64
64
  mz_sizes = [20168, 315, 634]
65
- iter = MS::Mzml.foreach(@file)
65
+ iter = Mspire::Mzml.foreach(@file)
66
66
  3.times { iter.next.mzs.size.should == mz_sizes.shift }
67
67
  lambda {iter.next}.should raise_error
68
68
  end
69
69
 
70
70
  it 'can gracefully determine the m/z with highest peak in select scans' do
71
- highest_mzs = MS::Mzml.foreach(@file).select {|v| v.ms_level > 1 }.map do |spec|
71
+ highest_mzs = Mspire::Mzml.foreach(@file).select {|v| v.ms_level > 1 }.map do |spec|
72
72
  spec.points.sort_by(&:last).first.first
73
73
  end
74
74
  highest_mzs.map(&:round).should == [453, 866]
@@ -84,10 +84,10 @@ describe MS::Mzml do
84
84
 
85
85
  it 'writes MS1 and MS2 spectra' do
86
86
  # params: profile and ms_level 1
87
- spec1 = MS::Mzml::Spectrum.new('scan=1', params: ['MS:1000128', ['MS:1000511', 1]]) do |spec|
87
+ spec1 = Mspire::Mzml::Spectrum.new('scan=1', params: ['MS:1000128', ['MS:1000511', 1]]) do |spec|
88
88
  spec.data_arrays = [[1,2,3], [4,5,6]]
89
- spec.scan_list = MS::Mzml::ScanList.new do |sl|
90
- scan = MS::Mzml::Scan.new do |scan|
89
+ spec.scan_list = Mspire::Mzml::ScanList.new do |sl|
90
+ scan = Mspire::Mzml::Scan.new do |scan|
91
91
  # retention time of 42 seconds
92
92
  scan.describe! ['MS:1000016', 40.0, 'UO:0000010']
93
93
  end
@@ -98,17 +98,17 @@ describe MS::Mzml do
98
98
  # centroid, ms_level 2, MSn spectrum,
99
99
  spec_params = ['MS:1000127', ['MS:1000511', 2], "MS:1000580"]
100
100
 
101
- spec2 = MS::Mzml::Spectrum.new('scan=2', params: spec_params) do |spec|
101
+ spec2 = Mspire::Mzml::Spectrum.new('scan=2', params: spec_params) do |spec|
102
102
  spec.data_arrays = [[1,2,3.5], [5,6,5]]
103
- spec.scan_list = MS::Mzml::ScanList.new do |sl|
104
- scan = MS::Mzml::Scan.new do |scan|
103
+ spec.scan_list = Mspire::Mzml::ScanList.new do |sl|
104
+ scan = Mspire::Mzml::Scan.new do |scan|
105
105
  # retention time of 42 seconds
106
106
  scan.describe! ['MS:1000016', 45.0, 'UO:0000010']
107
107
  end
108
108
  sl << scan
109
109
  end
110
- precursor = MS::Mzml::Precursor.new( spec1 )
111
- si = MS::Mzml::SelectedIon.new
110
+ precursor = Mspire::Mzml::Precursor.new( spec1 )
111
+ si = Mspire::Mzml::SelectedIon.new
112
112
  # the selected ion m/z:
113
113
  si.describe! ["MS:1000744", 2.0]
114
114
  # the selected ion charge state
@@ -119,31 +119,31 @@ describe MS::Mzml do
119
119
  spec.precursors = [precursor]
120
120
  end
121
121
 
122
- mzml = MS::Mzml.new do |mzml|
122
+ mzml = Mspire::Mzml.new do |mzml|
123
123
  mzml.id = 'ms1_and_ms2'
124
- mzml.cvs = MS::Mzml::CV::DEFAULT_CVS
125
- mzml.file_description = MS::Mzml::FileDescription.new do |fd|
126
- fd.file_content = MS::Mzml::FileContent.new
127
- fd.source_files << MS::Mzml::SourceFile.new
124
+ mzml.cvs = Mspire::Mzml::CV::DEFAULT_CVS
125
+ mzml.file_description = Mspire::Mzml::FileDescription.new do |fd|
126
+ fd.file_content = Mspire::Mzml::FileContent.new
127
+ fd.source_files << Mspire::Mzml::SourceFile.new
128
128
  end
129
- default_instrument_config = MS::Mzml::InstrumentConfiguration.new("IC",[], params: ['MS:1000031'])
129
+ default_instrument_config = Mspire::Mzml::InstrumentConfiguration.new("IC",[], params: ['MS:1000031'])
130
130
  mzml.instrument_configurations << default_instrument_config
131
- software = MS::Mzml::Software.new
131
+ software = Mspire::Mzml::Software.new
132
132
  mzml.software_list << software
133
- default_data_processing = MS::Mzml::DataProcessing.new("did_nothing")
133
+ default_data_processing = Mspire::Mzml::DataProcessing.new("did_nothing")
134
134
  mzml.data_processing_list << default_data_processing
135
- mzml.run = MS::Mzml::Run.new("little_run", default_instrument_config) do |run|
136
- spectrum_list = MS::Mzml::SpectrumList.new(default_data_processing)
135
+ mzml.run = Mspire::Mzml::Run.new("little_run", default_instrument_config) do |run|
136
+ spectrum_list = Mspire::Mzml::SpectrumList.new(default_data_processing)
137
137
  spectrum_list.push(spec1, spec2)
138
138
  run.spectrum_list = spectrum_list
139
139
  end
140
140
  end
141
141
 
142
- #check = TESTFILES + '/ms/mzml/mspire_simulated.noidx.check.mzML'
143
- tmpfile = TESTFILES + '/ms/mzml/mspire_simulated.MSn.TMP.mzML'
142
+ #check = TESTFILES + '/mspire/mzml/mspire_simulated.noidx.check.mzML'
143
+ tmpfile = TESTFILES + '/mspire/mzml/mspire_simulated.MSn.TMP.mzML'
144
144
  mzml.to_xml(tmpfile)
145
145
  as_string = mzml.to_xml
146
- check_string = IO.read(TESTFILES + '/ms/mzml/mspire_simulated.MSn.check.mzML')
146
+ check_string = IO.read(TESTFILES + '/mspire/mzml/mspire_simulated.MSn.check.mzML')
147
147
 
148
148
  [IO.read(tmpfile), as_string].each do |st|
149
149
  sanitize_version(check_string).should == sanitize_version(st)
@@ -1,9 +1,9 @@
1
1
  require 'spec_helper'
2
2
 
3
- require 'ms/peak'
4
- require 'ms/peak/point'
3
+ require 'mspire/peak'
4
+ require 'mspire/peak/point'
5
5
 
6
- describe MS::Peak do
6
+ describe Mspire::Peak do
7
7
 
8
8
  describe '#split' do
9
9
 
@@ -25,11 +25,11 @@ describe MS::Peak do
25
25
  mz += diff
26
26
  end
27
27
  @xs.map! {|mz| mz.round(2) }
28
- @points = @xs.zip(@intensities).map {|pair| MS::Peak::Point.new(pair) }
28
+ @points = @xs.zip(@intensities).map {|pair| Mspire::Peak::Point.new(pair) }
29
29
  end
30
30
 
31
31
  it 'splits on zeros by default' do
32
- peak = MS::Peak.new(@points) # <- maybe more like a collection of peaks, but Peak is flexible
32
+ peak = Mspire::Peak.new(@points) # <- maybe more like a collection of peaks, but Peak is flexible
33
33
  peaks = peak.split
34
34
  peaks.size.should == 4
35
35
  peaks.should == [
@@ -46,17 +46,17 @@ describe MS::Peak do
46
46
 
47
47
  # which it should since zeros are the ultimate local min!
48
48
  it 'always cleans up surrounding zeros and does not split non-multipeaks' do
49
- peak = MS::Peak.new(@points[0,7]) # simple
49
+ peak = Mspire::Peak.new(@points[0,7]) # simple
50
50
  [:share, :greedy_y].each do |multipeak_split_method|
51
51
  peaks = peak.split(multipeak_split_method)
52
- peaks.first.should be_an_instance_of(MS::Peak)
52
+ peaks.first.should be_an_instance_of(Mspire::Peak)
53
53
  peaks.first.to_a.should == [[50.01, 3], [50.02, 8], [50.03, 9], [50.04, 7], [50.05, 2]]
54
54
  end
55
55
  end
56
56
 
57
57
  it 'does #split(:share) and shares the peak proportional to adjacent peaks' do
58
58
  data = [[50.07, 0], [50.08, 3], [50.09, 8], [50.1, 2], [50.11, 9], [50.12, 7], [50.13, 1], [50.14, 3], [50.15, 0]]
59
- multipeak1 = MS::Peak.new( data )
59
+ multipeak1 = Mspire::Peak.new( data )
60
60
 
61
61
  answer = [
62
62
  [[50.08, 3], [50.09, 8], [50.1, (2*8.0/17)]],
@@ -80,8 +80,8 @@ describe MS::Peak do
80
80
 
81
81
  # test a tie -> goes left!
82
82
  points = @points[7,9]
83
- points[2] = MS::Peak::Point.new([points[2][0], 9])
84
- multipeak2 = MS::Peak.new( points )
83
+ points[2] = Mspire::Peak::Point.new([points[2][0], 9])
84
+ multipeak2 = Mspire::Peak.new( points )
85
85
  multipeak2.split(:greedy_y).should == answer
86
86
 
87
87
  end
@@ -1,7 +1,7 @@
1
1
  require 'spec_helper'
2
2
 
3
- require 'ms/plms1'
4
- require 'ms/spectrum'
3
+ require 'mspire/plms1'
4
+ require 'mspire/spectrum'
5
5
 
6
6
  describe 'plms1 - Prince Lab MS 1 specification' do
7
7
  before do
@@ -9,15 +9,15 @@ describe 'plms1 - Prince Lab MS 1 specification' do
9
9
  times = [0.55, 0.9]
10
10
  scan_numbers = [1,2]
11
11
  spectra = [
12
- MS::Spectrum.new([[300.0, 301.5, 303.1], [10, 20, 35.5]]),
13
- MS::Spectrum.new([[300.5, 302, 303.6], [11, 21, 36.5]])
12
+ Mspire::Spectrum.new([[300.0, 301.5, 303.1], [10, 20, 35.5]]),
13
+ Mspire::Spectrum.new([[300.5, 302, 303.6], [11, 21, 36.5]])
14
14
  ]
15
- @plms1_obj = MS::Plms1.new(scan_numbers, times, spectra)
15
+ @plms1_obj = Mspire::Plms1.new(scan_numbers, times, spectra)
16
16
  @outfile = @keyfile.sub(/\.key$/, ".tmp")
17
17
  end
18
18
 
19
19
  it 'has a detailed specification' do
20
- specification = MS::Plms1::SPECIFICATION
20
+ specification = Mspire::Plms1::SPECIFICATION
21
21
  specification.should be_an_instance_of String
22
22
  (specification.size > 50).should == true
23
23
  end
@@ -30,7 +30,7 @@ describe 'plms1 - Prince Lab MS 1 specification' do
30
30
  end
31
31
 
32
32
  it 'reads a plms1 file' do
33
- obj = MS::Plms1.new.read(@keyfile)
33
+ obj = Mspire::Plms1.new.read(@keyfile)
34
34
  [:scan_numbers, :times, :spectra].each do |val|
35
35
  obj.send(val).should == @plms1_obj.send(val)
36
36
  end
@@ -1,11 +1,11 @@
1
1
  require 'spec_helper'
2
2
 
3
- require 'ms/quant/qspec'
3
+ require 'mspire/quant/qspec'
4
4
  require 'csv'
5
5
 
6
6
  describe 'running qspec' do
7
7
  before do
8
- #@file = TESTFILES + '/ms/quant/max_quant_output.txt'
8
+ #@file = TESTFILES + '/mspire/quant/max_quant_output.txt'
9
9
  #rows = IO.readlines(@file).map {|line| line.chomp.split("\t") }
10
10
  #p rows.map(&:size)
11
11
  #abort 'here'
@@ -1,11 +1,11 @@
1
1
  require 'spec_helper'
2
2
 
3
- require 'ms/spectrum'
3
+ require 'mspire/spectrum'
4
4
 
5
- describe MS::Spectrum do
5
+ describe Mspire::Spectrum do
6
6
 
7
7
  describe 'useful utilities' do
8
- subject { MS::Spectrum.new [ [10.1, 10.5, 10.7, 11.5], [1, 2, 3, 4] ] }
8
+ subject { Mspire::Spectrum.new [ [10.1, 10.5, 10.7, 11.5], [1, 2, 3, 4] ] }
9
9
  it 'finds the nearest m/z or index' do
10
10
 
11
11
  queries = {
@@ -38,7 +38,7 @@ describe MS::Spectrum do
38
38
  end
39
39
 
40
40
  it 'can sort itself by m/z' do
41
- spec = MS::Spectrum.new [[10.5, 10.1, 11.5, 10.7], [2, 1, 4, 3]]
41
+ spec = Mspire::Spectrum.new [[10.5, 10.1, 11.5, 10.7], [2, 1, 4, 3]]
42
42
  spec.sort!
43
43
  spec.mzs.should == subject.mzs
44
44
  spec.intensities.should == subject.intensities
@@ -51,13 +51,13 @@ describe MS::Spectrum do
51
51
  [ [10.11, 10.49, 10.71, 11.48], [5, 6, 7, 8] ],
52
52
  [ [10.09, 10.51, 10.72, 11.51], [9, 10, 11, 12]
53
53
  ]
54
- data.map {|datum| MS::Spectrum.new( datum ) }
54
+ data.map {|datum| Mspire::Spectrum.new( datum ) }
55
55
  end
56
56
  it 'merges, giving exact weighted average m/z values for each cluster' do
57
- (spec1, data) = MS::Spectrum.merge(subject, :bin_width => 0.08, :bin_unit => :amu, :return_data => true)
58
- spec2 = MS::Spectrum.merge(subject, :bin_width => 0.08, :bin_unit => :amu)
57
+ (spec1, data) = Mspire::Spectrum.merge(subject, :bin_width => 0.08, :bin_unit => :amu, :return_data => true)
58
+ spec2 = Mspire::Spectrum.merge(subject, :bin_width => 0.08, :bin_unit => :amu)
59
59
  spec1.should == spec2
60
- spec1.should == MS::Spectrum.new([[10.097333333333331, 10.502222222222223, 10.713809523809525, 11.498333333333333], [5.0, 6.0, 7.0, 8.0]])
60
+ spec1.should == Mspire::Spectrum.new([[10.097333333333331, 10.502222222222223, 10.713809523809525, 11.498333333333333], [5.0, 6.0, 7.0, 8.0]])
61
61
  data.should == [[[10.1, 1], [10.11, 5], [10.09, 9]], [[10.5, 2], [10.49, 6], [10.51, 10]], [[10.7, 3], [10.71, 7], [10.72, 11]], [[11.5, 4], [11.48, 8], [11.51, 12]]]
62
62
  end
63
63
  end