mspire 0.6.26 → 0.7.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
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,9 +1,9 @@
1
1
 
2
2
  require 'spec_helper'
3
- require 'ms/ident/pepxml/sample_enzyme'
3
+ require 'mspire/ident/pepxml/sample_enzyme'
4
4
  require 'nokogiri'
5
5
 
6
- describe 'creating an MS::Ident::Pepxml::SampleEnzyme' do
6
+ describe 'creating an Mspire::Ident::Pepxml::SampleEnzyme' do
7
7
  before do
8
8
  @hash = {
9
9
  :name => 'trypsin',
@@ -13,23 +13,23 @@ describe 'creating an MS::Ident::Pepxml::SampleEnzyme' do
13
13
  }
14
14
  end
15
15
  it 'can be set by a known enzyme name' do
16
- se = MS::Ident::Pepxml::SampleEnzyme.new('trypsin')
16
+ se = Mspire::Ident::Pepxml::SampleEnzyme.new('trypsin')
17
17
  @hash.each do |k,v|
18
18
  se.send(k).should == v
19
19
  end
20
20
  end
21
21
 
22
22
  it 'can be set manually with a hash' do
23
- se = MS::Ident::Pepxml::SampleEnzyme.new(@hash)
23
+ se = Mspire::Ident::Pepxml::SampleEnzyme.new(@hash)
24
24
  @hash.each do |k,v|
25
25
  se.send(k).should == v
26
26
  end
27
27
  end
28
28
  end
29
29
 
30
- describe 'an MS::Ident::Pepxml::SampleEnzyme' do
30
+ describe 'an Mspire::Ident::Pepxml::SampleEnzyme' do
31
31
  before do
32
- @sample_enzyme = MS::Ident::Pepxml::SampleEnzyme.new(:name=>'trypsin',:cut=>'KR',:no_cut=>'P',:sense=>'C')
32
+ @sample_enzyme = Mspire::Ident::Pepxml::SampleEnzyme.new(:name=>'trypsin',:cut=>'KR',:no_cut=>'P',:sense=>'C')
33
33
  end
34
34
  it 'generates a valid xml fragment' do
35
35
  string = @sample_enzyme.to_xml
@@ -48,15 +48,15 @@ describe 'an MS::Ident::Pepxml::SampleEnzyme' do
48
48
  end
49
49
  end
50
50
 
51
- describe 'an MS::Ident::Pepxml::SampleEnzyme making enzyme digestion calculations' do
51
+ describe 'an Mspire::Ident::Pepxml::SampleEnzyme making enzyme digestion calculations' do
52
52
  before do
53
- @full_KRP = MS::Ident::Pepxml::SampleEnzyme.new(
53
+ @full_KRP = Mspire::Ident::Pepxml::SampleEnzyme.new(
54
54
  :name => 'trypsin',
55
55
  :cut => 'KR',
56
56
  :no_cut => 'P',
57
57
  :sense => 'C',
58
58
  )
59
- @just_KR = MS::Ident::Pepxml::SampleEnzyme.new(
59
+ @just_KR = Mspire::Ident::Pepxml::SampleEnzyme.new(
60
60
  :name => 'trypsin',
61
61
  :cut => 'KR',
62
62
  :no_cut => '',
@@ -138,7 +138,7 @@ end
138
138
  =begin
139
139
  require 'set'
140
140
 
141
- describe 'MS::Ident::Pepxml::SampleEnzyme digesting sequences' do
141
+ describe 'Mspire::Ident::Pepxml::SampleEnzyme digesting sequences' do
142
142
  it 'can digest with no missed cleavages' do
143
143
  st = "CRGATKKTAGRPMEK"
144
144
  SampleEnzyme.tryptic(st).should == %w(CR GATK K TAGRPMEK)
@@ -1,12 +1,12 @@
1
1
  require 'spec_helper'
2
2
 
3
- require 'ms/ident/pepxml/search_hit/modification_info'
3
+ require 'mspire/ident/pepxml/search_hit/modification_info'
4
4
 
5
- describe 'MS::Ident::Pepxml::SearchHit::ModificationInfo' do
5
+ describe 'Mspire::Ident::Pepxml::SearchHit::ModificationInfo' do
6
6
 
7
7
  before do
8
8
  modaaobjs = [[3, 150.3], [6, 345.2]].map do |ar|
9
- MS::Ident::Pepxml::SearchHit::ModificationInfo::ModAminoacidMass.new(*ar)
9
+ Mspire::Ident::Pepxml::SearchHit::ModificationInfo::ModAminoacidMass.new(*ar)
10
10
  end
11
11
  hash = {
12
12
  :mod_nterm_mass => 520.2,
@@ -14,7 +14,7 @@ describe 'MS::Ident::Pepxml::SearchHit::ModificationInfo' do
14
14
  :mod_aminoacid_masses => modaaobjs,
15
15
  }
16
16
  #answ = "<modification_info mod_nterm_mass=\"520.2\" modified_peptide=\"MOD*IFI^E&amp;D\">\n\t<mod_aminoacid_mass position=\"3\" mass=\"150.3\"/>\n\t<mod_aminoacid_mass position=\"6\" mass=\"345.2\"/>\n</modification_info>\n"
17
- @obj = MS::Ident::Pepxml::SearchHit::ModificationInfo.new(hash)
17
+ @obj = Mspire::Ident::Pepxml::SearchHit::ModificationInfo.new(hash)
18
18
  end
19
19
 
20
20
  it 'can produce valid pepxml xml' do
@@ -1,20 +1,20 @@
1
1
  require 'spec_helper'
2
2
 
3
- require 'ms/mass'
4
- require 'ms/mass/aa'
5
- require 'ms/ident/pepxml'
6
- require 'ms/ident/pepxml/modifications'
7
- require 'ms/ident/pepxml/spectrum_query'
8
- require 'ms/ident/pepxml/search_result'
9
- require 'ms/ident/pepxml/search_hit'
10
- require 'ms/ident/pepxml/search_hit/modification_info'
3
+ require 'mspire/mass'
4
+ require 'mspire/mass/aa'
5
+ require 'mspire/ident/pepxml'
6
+ require 'mspire/ident/pepxml/modifications'
7
+ require 'mspire/ident/pepxml/spectrum_query'
8
+ require 'mspire/ident/pepxml/search_result'
9
+ require 'mspire/ident/pepxml/search_hit'
10
+ require 'mspire/ident/pepxml/search_hit/modification_info'
11
11
 
12
- describe "creating an MS::Ident::Pepxml" do
12
+ describe "creating an Mspire::Ident::Pepxml" do
13
13
 
14
14
  it "can be creating in a nested fashion reflecting internal structure" do
15
15
  tags_that_should_be_present = %w(msms_pipeline_analysis msms_run_summary sample_enzyme search_summary spectrum_query search_result search_hit modification_info mod_aminoacid_mass search_score)
16
16
 
17
- pepxml = MS::Ident::Pepxml.new do |msms_pipeline_analysis|
17
+ pepxml = Mspire::Ident::Pepxml.new do |msms_pipeline_analysis|
18
18
  msms_pipeline_analysis.merge!(:summary_xml => "020.xml") do |msms_run_summary|
19
19
  # prep the sample enzyme and search_summary
20
20
  msms_run_summary.merge!(
@@ -38,17 +38,17 @@ describe "creating an MS::Ident::Pepxml" do
38
38
  :max_num_internal_cleavages => 2,
39
39
  :min_number_termini => 2
40
40
  )
41
- modifications << MS::Ident::Pepxml::AminoacidModification.new(
42
- :aminoacid => 'M', :massdiff => 15.9994, :mass => MS::Mass::AA::MONO['M']+15.9994,
41
+ modifications << Mspire::Ident::Pepxml::AminoacidModification.new(
42
+ :aminoacid => 'M', :massdiff => 15.9994, :mass => Mspire::Mass::AA::MONO['M']+15.9994,
43
43
  :variable => 'Y', :symbol => '*')
44
44
  # invented, for example, a protein terminating mod
45
- modifications << MS::Ident::Pepxml::TerminalModification.new(
46
- :terminus => 'c', :massdiff => 23.3333, :mass => MS::Mass::MONO['oh'] + 23.3333,
45
+ modifications << Mspire::Ident::Pepxml::TerminalModification.new(
46
+ :terminus => 'c', :massdiff => 23.3333, :mass => Mspire::Mass::MONO['oh'] + 23.3333,
47
47
  :variable => 'Y', :symbol => '[', :protein_terminus => 'c',
48
48
  :description => 'leave protein_terminus off if not protein mod'
49
49
  )
50
- modifications << MS::Ident::Pepxml::TerminalModification.new(
51
- :terminus => 'c', :massdiff => 25.42322, :mass => MS::Mass::MONO['h+'] + 25.42322,
50
+ modifications << Mspire::Ident::Pepxml::TerminalModification.new(
51
+ :terminus => 'c', :massdiff => 25.42322, :mass => Mspire::Mass::MONO['h+'] + 25.42322,
52
52
  :variable => 'N', :symbol => ']', :description => 'example: c term mod'
53
53
  )
54
54
  parameters.merge!(
@@ -57,18 +57,18 @@ describe "creating an MS::Ident::Pepxml" do
57
57
  :enzyme_info => 'Trypsin(KR/P) 1 1 KR P', # etc....
58
58
  )
59
59
  end
60
- spectrum_query1 = MS::Ident::Pepxml::SpectrumQuery.new(
60
+ spectrum_query1 = Mspire::Ident::Pepxml::SpectrumQuery.new(
61
61
  :spectrum => '020.3.3.1', :start_scan => 3, :end_scan => 3,
62
62
  :precursor_neutral_mass => 1120.93743421875, :assumed_charge => 1
63
63
  ) do |search_results|
64
- search_result1 = MS::Ident::Pepxml::SearchResult.new do |search_hits|
64
+ search_result1 = Mspire::Ident::Pepxml::SearchResult.new do |search_hits|
65
65
  modpositions = [[1, 243.1559], [6, 167.0581], [7,181.085]].map do |pair|
66
- MS::Ident::Pepxml::SearchHit::ModificationInfo::ModAminoacidMass.new(*pair)
66
+ Mspire::Ident::Pepxml::SearchHit::ModificationInfo::ModAminoacidMass.new(*pair)
67
67
  end
68
68
  # order(modified_peptide, mod_aminoacid_masses, :mod_nterm_mass, :mod_cterm_mass)
69
69
  # or can be set by hash
70
- mod_info = MS::Ident::Pepxml::SearchHit::ModificationInfo.new('Y#RLGGS#T#K', modpositions)
71
- search_hit1 = MS::Ident::Pepxml::SearchHit.new(
70
+ mod_info = Mspire::Ident::Pepxml::SearchHit::ModificationInfo.new('Y#RLGGS#T#K', modpositions)
71
+ search_hit1 = Mspire::Ident::Pepxml::SearchHit.new(
72
72
  :hit_rank=>1, :peptide=>'YRLGGSTK', :peptide_prev_aa => "R", :peptide_next_aa => "K",
73
73
  :protein => "gi|16130113|ref|NP_416680.1|", :num_tot_proteins => 1, :num_matched_ions => 5,
74
74
  :tot_num_ions => 35, :calc_neutral_pep_mass => 1120.93163442, :massdiff => 0.00579979875010395,
@@ -141,7 +141,7 @@ end
141
141
 
142
142
 
143
143
  =begin
144
- describe "MS::Ident::Pepxml created from small bioworks.xml" do
144
+ describe "Mspire::Ident::Pepxml created from small bioworks.xml" do
145
145
 
146
146
  spec_large do
147
147
  before(:all) do
@@ -1,6 +1,6 @@
1
1
  require 'spec_helper'
2
2
 
3
- require 'ms/ident/protein_group'
3
+ require 'mspire/ident/protein_group'
4
4
 
5
5
  PeptideHit = Struct.new(:aaseq, :charge, :proteins) do
6
6
  def inspect # easier to read output
@@ -36,21 +36,21 @@ describe 'creating minimal protein groups from peptide hits' do
36
36
  it 'is a greedy algorithm' do
37
37
  @prot_hits.each {|prthit| @prot_hits_hash[prthit.id].each {|pep| pep.proteins << prthit } }
38
38
  # big_guy has all the peptides, so it takes them all
39
- protein_groups = MS::Ident::ProteinGroup.peptide_hits_to_protein_groups(@pep_hits)
39
+ protein_groups = Mspire::Ident::ProteinGroup.peptide_hits_to_protein_groups(@pep_hits)
40
40
  protein_groups.first.size.should == 1# the group
41
41
  protein_groups.first.first.id.should == 'big_guy'
42
42
  end
43
43
 
44
44
  it 'removes proteins accounted for only as little pieces of larger proteins' do
45
45
  @prot_hits[1..-1].each {|prthit| @prot_hits_hash[prthit.id].each {|pep| pep.proteins << prthit } }
46
- protein_groups = MS::Ident::ProteinGroup.peptide_hits_to_protein_groups(@pep_hits)
46
+ protein_groups = Mspire::Ident::ProteinGroup.peptide_hits_to_protein_groups(@pep_hits)
47
47
  # no subsumed_by_medium
48
48
  protein_groups.any? {|prot_group| prot_group.any? {|v| v.id == 'subsumed_by_medium' }}.should == false
49
49
  end
50
50
 
51
51
  it 'allows alternate sorting algorithms for greediness' do
52
52
  @prot_hits.each {|prthit| @prot_hits_hash[prthit.id].each {|pep| pep.proteins << prthit } }
53
- prot_groups = MS::Ident::ProteinGroup.peptide_hits_to_protein_groups(@pep_hits) do |prot_and_peptide_hits|
53
+ prot_groups = Mspire::Ident::ProteinGroup.peptide_hits_to_protein_groups(@pep_hits) do |prot_and_peptide_hits|
54
54
  # deliberate using a counterintuitive sorting method to give little guys
55
55
  # a chance
56
56
  -prot_and_peptide_hits.last.size
@@ -1,6 +1,6 @@
1
1
  require 'spec_helper'
2
2
 
3
- require 'ms/isotope/aa'
3
+ require 'mspire/isotope/aa'
4
4
 
5
5
  describe 'accessing an amino acid atom count' do
6
6
  before do
@@ -8,12 +8,12 @@ describe 'accessing an amino acid atom count' do
8
8
  end
9
9
 
10
10
  it 'residue can be accessed with a symbol' do
11
- hash = MS::Isotope::AA::ATOM_COUNTS[:A]
11
+ hash = Mspire::Isotope::AA::ATOM_COUNTS[:A]
12
12
  [:c, :h, :o, :n, :s].each {|key| hash[key].should == @alanine[key] }
13
13
  end
14
14
 
15
15
  it 'residue can be accessed with a string' do
16
- hash = MS::Isotope::AA::ATOM_COUNTS['A']
16
+ hash = Mspire::Isotope::AA::ATOM_COUNTS['A']
17
17
  [:c, :h, :o, :n, :s].each {|key| hash[key].should == @alanine[key] }
18
18
  end
19
19
 
@@ -1,19 +1,19 @@
1
1
  require 'spec_helper'
2
2
 
3
- require 'ms/isotope/distribution'
3
+ require 'mspire/isotope/distribution'
4
4
 
5
- describe 'MS::Isotope::Distribution class methods' do
5
+ describe 'Mspire::Isotope::Distribution class methods' do
6
6
  before do
7
7
  @data = [1.0, 0.08919230588715289, 0.017894161377222082, 0.0013573997600723623, 0.0001398330738144092]
8
8
  end
9
9
 
10
10
  it 'can calculate isotope distributions' do
11
- MS::Isotope::Distribution.calculate('C8O7', :max).should == @data
11
+ Mspire::Isotope::Distribution.calculate('C8O7', :max).should == @data
12
12
  end
13
13
 
14
14
  # no m/z values, just mass values
15
15
  it 'can calculate isotope distribution spectrum' do
16
- spec = MS::Isotope::Distribution.spectrum('C8O7', :max)
16
+ spec = Mspire::Isotope::Distribution.spectrum('C8O7', :max)
17
17
  spec.mzs.should == [207.96440233692, 208.97306725252, 209.98173216812, 210.99039708372, 211.99906199932002]
18
18
  spec.intensities.should == [1.0, 0.08919230588715289, 0.017894161377222082, 0.0013573997600723623, 0.0001398330738144092]
19
19
  end
@@ -1,12 +1,12 @@
1
1
  require 'spec_helper'
2
2
 
3
- require 'ms/isotope'
3
+ require 'mspire/isotope'
4
4
 
5
- describe 'MS::Isotope constants' do
6
- it 'has all the common isotopes: MS::Isotope::ISOTOPES' do
5
+ describe 'Mspire::Isotope constants' do
6
+ it 'has all the common isotopes: Mspire::Isotope::ISOTOPES' do
7
7
  # frozen
8
- MS::Isotope::ISOTOPES.size.should == 288
9
- hydrogen_isotopes = MS::Isotope::ISOTOPES.select {|iso| iso.element == :h }
8
+ Mspire::Isotope::ISOTOPES.size.should == 288
9
+ hydrogen_isotopes = Mspire::Isotope::ISOTOPES.select {|iso| iso.element == :h }
10
10
  hydrogen_isotopes.size.should == 2
11
11
 
12
12
  { atomic_number: 1, element: :h, mass_number: 1, atomic_mass: 1.00782503207, relative_abundance: 0.999885, average_mass: 1.00794, mono: true }.each do |k,v|
@@ -15,17 +15,17 @@ describe 'MS::Isotope constants' do
15
15
  {atomic_number: 1, element: :h, mass_number: 2, atomic_mass: 2.0141017778, relative_abundance: 0.000115, average_mass: 1.00794, mono: false}.each do |k,v|
16
16
  hydrogen_isotopes.last.send(k).should == v
17
17
  end
18
- u = MS::Isotope::ISOTOPES.last
18
+ u = Mspire::Isotope::ISOTOPES.last
19
19
  {atomic_number: 92, element: :u, mass_number: 238, atomic_mass: 238.0507882, relative_abundance: 0.992742, average_mass: 238.02891, mono: true}.each do |k,v|
20
20
  u.send(k).should == v
21
21
  end
22
22
  end
23
- it 'has all common isotopes by element: MS::Isotope::BY_ELEMENT' do
24
- [{atomic_number: 6, element: :c, mass_number: 12, atomic_mass: 12.0, relative_abundance: 0.9893, average_mass: 12.0107, mono: true}, {atomic_number: 6, element: :c, mass_number: 13, atomic_mass: 13.0033548378, relative_abundance: 0.0107, average_mass: 12.0107, mono: false}].zip(MS::Isotope::BY_ELEMENT[:c]) do |hash, iso|
23
+ it 'has all common isotopes by element: Mspire::Isotope::BY_ELEMENT' do
24
+ [{atomic_number: 6, element: :c, mass_number: 12, atomic_mass: 12.0, relative_abundance: 0.9893, average_mass: 12.0107, mono: true}, {atomic_number: 6, element: :c, mass_number: 13, atomic_mass: 13.0033548378, relative_abundance: 0.0107, average_mass: 12.0107, mono: false}].zip(Mspire::Isotope::BY_ELEMENT[:c]) do |hash, iso|
25
25
  hash.each do |k,v|
26
26
  iso.send(k).should == v
27
27
  end
28
28
  end
29
- MS::Isotope::BY_ELEMENT[:h].size.should == 2
29
+ Mspire::Isotope::BY_ELEMENT[:h].size.should == 2
30
30
  end
31
31
  end
@@ -1,8 +1,8 @@
1
1
  require 'spec_helper'
2
2
 
3
- require 'ms/mass'
3
+ require 'mspire/mass'
4
4
 
5
- describe 'MS::Mass' do
5
+ describe 'Mspire::Mass' do
6
6
  it 'can access elemental masses by string or symbol' do
7
7
  {
8
8
  'c' => 12.0, # +
@@ -26,16 +26,16 @@ describe 'MS::Mass' do
26
26
  'e' => 0.0005486,
27
27
  'se' => 79.9165196
28
28
  }.each do |el, mass|
29
- MS::Mass::MONO[el].should_not be_nil
30
- MS::Mass::MONO[el].should == MS::Mass::MONO[el.to_sym]
31
- MS::Mass::MONO[el].should be_within(0.00001).of(mass)
29
+ Mspire::Mass::MONO[el].should_not be_nil
30
+ Mspire::Mass::MONO[el].should == Mspire::Mass::MONO[el.to_sym]
31
+ Mspire::Mass::MONO[el].should be_within(0.00001).of(mass)
32
32
  end
33
33
 
34
34
 
35
35
  { h: 1.00794, he: 4.002602, ni: 58.6934 }.each do |el, mass|
36
- MS::Mass::AVG[el].should_not be_nil
37
- MS::Mass::AVG[el].should == MS::Mass::AVG[el.to_sym]
38
- MS::Mass::AVG[el].should be_within(0.00001).of(mass)
36
+ Mspire::Mass::AVG[el].should_not be_nil
37
+ Mspire::Mass::AVG[el].should == Mspire::Mass::AVG[el.to_sym]
38
+ Mspire::Mass::AVG[el].should be_within(0.00001).of(mass)
39
39
  end
40
40
 
41
41
  end
@@ -1,14 +1,14 @@
1
1
  require 'spec_helper'
2
2
 
3
- require 'ms/molecular_formula'
3
+ require 'mspire/molecular_formula'
4
4
 
5
- describe MS::MolecularFormula do
5
+ describe Mspire::MolecularFormula do
6
6
 
7
7
  it 'can be initialized with a String or Hash' do
8
8
  data = {h: 22, c: 12, n: 1, o: 3, s: 2}
9
- mf = MS::MolecularFormula.new "H22BeC12N1O3S2Li2"
9
+ mf = Mspire::MolecularFormula.new "H22BeC12N1O3S2Li2"
10
10
  mf.should == {:h=>22, :be=>1, :c=>12, :n=>1, :o=>3, :s=>2, :li=>2}
11
- mf = MS::MolecularFormula.new(data)
11
+ mf = Mspire::MolecularFormula.new(data)
12
12
  mf.should == data
13
13
  end
14
14
 
@@ -1,13 +1,13 @@
1
1
  require 'spec_helper'
2
2
  require 'builder'
3
- require 'ms/mzml/cv'
3
+ require 'mspire/mzml/cv'
4
4
 
5
- describe MS::Mzml::CV do
5
+ describe Mspire::Mzml::CV do
6
6
 
7
7
  it 'can make CVList xml' do
8
- cvs = [MS::Mzml::CV::MS, MS::Mzml::CV::UO, MS::Mzml::CV::IMS]
8
+ cvs = [Mspire::Mzml::CV::MS, Mspire::Mzml::CV::UO, Mspire::Mzml::CV::IMS]
9
9
  b = Builder::XmlMarkup.new(:indent => 2)
10
- MS::Mzml::CV.list_xml(cvs, b)
10
+ Mspire::Mzml::CV.list_xml(cvs, b)
11
11
  xml = b.to_xml
12
12
  [/cvList\s+count=/, /id="MS"/, /id="UO"/, /id="IMS"/, /URI="/].each do |regexp|
13
13
  xml.should match(regexp)
@@ -1,26 +1,26 @@
1
1
  require 'spec_helper'
2
2
 
3
- require 'ms/mzml/data_array'
3
+ require 'mspire/mzml/data_array'
4
4
 
5
- describe MS::Mzml::DataArray do
5
+ describe Mspire::Mzml::DataArray do
6
6
 
7
7
  it 'can be created from base64 binary data' do
8
- d_ar = MS::Mzml::DataArray.from_binary('eJxjYACBD/YMEOAAoTgcABe3Abg=', :float64, zlib=true)
8
+ d_ar = Mspire::Mzml::DataArray.from_binary('eJxjYACBD/YMEOAAoTgcABe3Abg=', :float64, zlib=true)
9
9
  d_ar.is_a?(Array)
10
10
  d_ar.should == [1.0, 2.0, 3.0]
11
- d_ar = MS::Mzml::DataArray.from_binary('eJxjYACBD/YMEOAAoTgcABe3Abg=', ['MS:1000523', 'MS:1000574'])
11
+ d_ar = Mspire::Mzml::DataArray.from_binary('eJxjYACBD/YMEOAAoTgcABe3Abg=', ['MS:1000523', 'MS:1000574'])
12
12
  d_ar.is_a?(Array)
13
13
  d_ar.should == [1.0, 2.0, 3.0]
14
14
  end
15
15
 
16
16
  it "can be initialized like any ol' array" do
17
17
  data = [1,2,3]
18
- d_ar = MS::Mzml::DataArray.new( data )
18
+ d_ar = Mspire::Mzml::DataArray.new( data )
19
19
  d_ar.should == data
20
20
  end
21
21
 
22
- describe 'an instantiated MS::Mzml::DataArray' do
23
- subject { MS::Mzml::DataArray.new [1,2,3] }
22
+ describe 'an instantiated Mspire::Mzml::DataArray' do
23
+ subject { Mspire::Mzml::DataArray.new [1,2,3] }
24
24
 
25
25
  it "can have a 'type'" do
26
26
  subject.type = :mz
@@ -1,16 +1,16 @@
1
1
  require 'spec_helper'
2
2
  require 'builder'
3
3
 
4
- require 'ms/mzml/file_content'
4
+ require 'mspire/mzml/file_content'
5
5
 
6
- describe MS::Mzml::FileContent do
6
+ describe Mspire::Mzml::FileContent do
7
7
 
8
8
  it 'can be initialized with params' do
9
- filecontent = MS::Mzml::FileContent.new(:params => ['MS:1000579', ['IMS:1000080', "{9D501BDC-5344-4916-B7E9-7E795B02C856}"]])
9
+ filecontent = Mspire::Mzml::FileContent.new(:params => ['MS:1000579', ['IMS:1000080', "{9D501BDC-5344-4916-B7E9-7E795B02C856}"]])
10
10
 
11
11
  desc = filecontent.params
12
12
  desc.size.should == 2
13
- desc.all? {|par| par.class == MS::CV::Param }.should be_true
13
+ desc.all? {|par| par.class == Mspire::CV::Param }.should be_true
14
14
  b = Builder::XmlMarkup.new
15
15
  filecontent.to_xml(b)
16
16
  xml = b.to_xml
@@ -1,5 +1,5 @@
1
1
  require 'spec_helper'
2
- require 'ms/mzml/file_description'
2
+ require 'mspire/mzml/file_description'
3
3
  require 'builder'
4
4
 
5
5
  describe 'creating mzml xml' do
@@ -9,11 +9,11 @@ describe 'creating mzml xml' do
9
9
 
10
10
  describe 'making a SourceFile' do
11
11
  it 'can be generated with params and a block' do
12
- source_file = MS::Mzml::SourceFile.new("someFileID", "filename.mzML", "/home/jtprince/tmp", params: ['MS:1000584'])
12
+ source_file = Mspire::Mzml::SourceFile.new("someFileID", "filename.mzML", "/home/jtprince/tmp", params: ['MS:1000584'])
13
13
 
14
14
  params = source_file.params
15
15
  params.size.should == 1
16
- params.all? {|par| par.class == MS::CV::Param }.should be_true
16
+ params.all? {|par| par.class == Mspire::CV::Param }.should be_true
17
17
  b = Builder::XmlMarkup.new(:indent => 2)
18
18
  source_file.to_xml(b)
19
19
  xml = b.to_xml
@@ -24,7 +24,7 @@ describe 'creating mzml xml' do
24
24
 
25
25
  end
26
26
 
27
- describe MS::Mzml::FileDescription do
27
+ describe Mspire::Mzml::FileDescription do
28
28
 
29
29
  it 'creates valid xml' do
30
30
  #MS::Mzml::FileDescription