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,12 +1,12 @@
1
1
  require 'merge'
2
2
 
3
- require 'ms/ident/pepxml/msms_run_summary'
3
+ require 'mspire/ident/pepxml/msms_run_summary'
4
4
 
5
- module MS ; end
6
- module MS::Ident ; end
7
- class MS::Ident::Pepxml; end
5
+ module Mspire ; end
6
+ module Mspire::Ident ; end
7
+ class Mspire::Ident::Pepxml; end
8
8
 
9
- class MS::Ident::Pepxml::MsmsPipelineAnalysis
9
+ class Mspire::Ident::Pepxml::MsmsPipelineAnalysis
10
10
  include Merge
11
11
  XMLNS = "http://regis-web.systemsbiology.net/pepXML"
12
12
  XMLNS_XSI = "http://www.w3.org/2001/XMLSchema-instance"
@@ -32,7 +32,7 @@ class MS::Ident::Pepxml::MsmsPipelineAnalysis
32
32
  attr_writer :date
33
33
 
34
34
  def block_arg
35
- @msms_run_summary = MS::Ident::Pepxml::MsmsRunSummary.new
35
+ @msms_run_summary = Mspire::Ident::Pepxml::MsmsRunSummary.new
36
36
  end
37
37
 
38
38
  # if block given, yields a new msms_run_summary to return value of block
@@ -1,15 +1,15 @@
1
1
  require 'merge'
2
2
  require 'nokogiri'
3
3
 
4
- require 'ms/ident/pepxml/sample_enzyme'
5
- require 'ms/ident/pepxml/search_summary'
6
- require 'ms/ident/pepxml/spectrum_query'
4
+ require 'mspire/ident/pepxml/sample_enzyme'
5
+ require 'mspire/ident/pepxml/search_summary'
6
+ require 'mspire/ident/pepxml/spectrum_query'
7
7
 
8
- module MS ; end
9
- module MS::Ident ; end
10
- class MS::Ident::Pepxml; end
8
+ module Mspire ; end
9
+ module Mspire::Ident ; end
10
+ class Mspire::Ident::Pepxml; end
11
11
 
12
- class MS::Ident::Pepxml::MsmsRunSummary
12
+ class Mspire::Ident::Pepxml::MsmsRunSummary
13
13
  include Merge
14
14
  # The name of the pep xml file without any extension
15
15
  attr_accessor :base_name
@@ -31,8 +31,8 @@ class MS::Ident::Pepxml::MsmsRunSummary
31
31
  attr_accessor :spectrum_queries
32
32
 
33
33
  def block_arg
34
- [@sample_enzyme = MS::Ident::Pepxml::SampleEnzyme.new,
35
- @search_summary = MS::Ident::Pepxml::SearchSummary.new,
34
+ [@sample_enzyme = Mspire::Ident::Pepxml::SampleEnzyme.new,
35
+ @search_summary = Mspire::Ident::Pepxml::SearchSummary.new,
36
36
  @spectrum_queries ]
37
37
  end
38
38
 
@@ -1,4 +1,4 @@
1
- module MS
1
+ module Mspire
2
2
  module Ident
3
3
  class Pepxml
4
4
  class Parameters < Hash
@@ -1,11 +1,11 @@
1
1
  require 'merge'
2
2
  require 'strscan'
3
3
 
4
- module MS ; end
5
- module MS::Ident ; end
6
- class MS::Ident::Pepxml ; end
4
+ module Mspire ; end
5
+ module Mspire::Ident ; end
6
+ class Mspire::Ident::Pepxml ; end
7
7
 
8
- class MS::Ident::Pepxml::SampleEnzyme
8
+ class Mspire::Ident::Pepxml::SampleEnzyme
9
9
  include Merge
10
10
  # an identifier
11
11
  attr_accessor :name
@@ -1,9 +1,9 @@
1
- require 'ms/fasta'
1
+ require 'mspire/fasta'
2
2
  require 'merge'
3
- module MS ; end
4
- module MS::Ident ; end
3
+ module Mspire ; end
4
+ module Mspire::Ident ; end
5
5
 
6
- class MS::Ident::Pepxml
6
+ class Mspire::Ident::Pepxml
7
7
  class SearchDatabase
8
8
  include Merge
9
9
  # required! the local, full path to the protein sequence database
@@ -33,7 +33,7 @@ class MS::Ident::Pepxml
33
33
  # returns self for chaining
34
34
  def set_size_of_residues!
35
35
  @size_of_residues = 0
36
- MS::Fasta.foreach(@local_path) do |entry|
36
+ Mspire::Fasta.foreach(@local_path) do |entry|
37
37
  @size_of_residues += entry.sequence.size
38
38
  end
39
39
  self
@@ -2,13 +2,13 @@ require 'set'
2
2
  require 'merge'
3
3
  require 'nokogiri'
4
4
 
5
- module MS ; end
6
- module MS::Ident ; end
5
+ module Mspire ; end
6
+ module Mspire::Ident ; end
7
7
 
8
8
 
9
- class MS::Ident::Pepxml
9
+ class Mspire::Ident::Pepxml
10
10
 
11
- class MS::Ident::Pepxml::SearchHit
11
+ class Mspire::Ident::Pepxml::SearchHit
12
12
  include Merge
13
13
 
14
14
  DEFAULT_MEMBERS = [:hit_rank, :peptide, :peptide_prev_aa, :peptide_next_aa, :num_matched_ions, :tot_num_ions, :calc_neutral_pep_mass, :massdiff, :num_tol_term, :num_missed_cleavages, :is_rejected, :protein, :num_tot_proteins, :protein_desc, :calc_pI, :protein_mw, :modification_info, :search_scores, :spectrum_query]
@@ -1,14 +1,14 @@
1
1
  require 'andand'
2
2
  require 'nokogiri'
3
3
 
4
- module MS ; end
5
- module MS::Ident ; end
6
- class MS::Ident::Pepxml ; end
7
- class MS::Ident::Pepxml::SearchHit ; end
4
+ module Mspire ; end
5
+ module Mspire::Ident ; end
6
+ class Mspire::Ident::Pepxml ; end
7
+ class Mspire::Ident::Pepxml::SearchHit ; end
8
8
 
9
9
 
10
10
  # Positions and masses of modifications
11
- MS::Ident::Pepxml::SearchHit::ModificationInfo = Struct.new(:modified_peptide, :mod_aminoacid_masses, :mod_nterm_mass, :mod_cterm_mass) do
11
+ Mspire::Ident::Pepxml::SearchHit::ModificationInfo = Struct.new(:modified_peptide, :mod_aminoacid_masses, :mod_nterm_mass, :mod_cterm_mass) do
12
12
  ## Should be something like this:
13
13
  # <modification_info mod_nterm_mass=" " mod_nterm_mass=" " modified_peptide=" ">
14
14
  # <mod_aminoacid_mass position=" " mass=" "/>
@@ -64,14 +64,14 @@ MS::Ident::Pepxml::SearchHit::ModificationInfo = Struct.new(:modified_peptide, :
64
64
  self[3] = node['mod_cterm_mass']
65
65
  _masses = []
66
66
  node.children do |mass_n|
67
- _masses << MS::Ident::Pepxml::SearchHit::ModificationInfo::ModAminoacidMass.new([mass_n['position'].to_i, mass_n['mass'].to_f])
67
+ _masses << Mspire::Ident::Pepxml::SearchHit::ModificationInfo::ModAminoacidMass.new([mass_n['position'].to_i, mass_n['mass'].to_f])
68
68
  end
69
69
  self.mod_aminoacid_masses = _masses
70
70
  self
71
71
  end
72
72
  end
73
73
 
74
- MS::Ident::Pepxml::SearchHit::ModificationInfo::ModAminoacidMass = Struct.new(:position, :mass) do
74
+ Mspire::Ident::Pepxml::SearchHit::ModificationInfo::ModAminoacidMass = Struct.new(:position, :mass) do
75
75
  def to_xml(builder)
76
76
  builder.mod_aminoacid_mass(:position => position, :mass => mass)
77
77
  builder
@@ -1,12 +1,12 @@
1
1
  require 'nokogiri'
2
2
 
3
- require 'ms/ident/pepxml/search_hit'
3
+ require 'mspire/ident/pepxml/search_hit'
4
4
 
5
- module MS ; end
6
- module MS::Ident ; end
7
- class MS::Ident::Pepxml ; end
5
+ module Mspire ; end
6
+ module Mspire::Ident ; end
7
+ class Mspire::Ident::Pepxml ; end
8
8
 
9
- class MS::Ident::Pepxml::SearchResult
9
+ class Mspire::Ident::Pepxml::SearchResult
10
10
  # an array of search_hits
11
11
  attr_accessor :search_hits
12
12
 
@@ -1,13 +1,13 @@
1
- require 'ms/ident/pepxml/search_database'
2
- require 'ms/ident/pepxml/modifications'
3
- require 'ms/ident/pepxml/parameters'
1
+ require 'mspire/ident/pepxml/search_database'
2
+ require 'mspire/ident/pepxml/modifications'
3
+ require 'mspire/ident/pepxml/parameters'
4
4
 
5
5
  require 'nokogiri'
6
6
  require 'merge'
7
7
 
8
- module MS ; end
9
- module MS::Ident ; end
10
- class MS::Ident::Pepxml ; end
8
+ module Mspire ; end
9
+ module Mspire::Ident ; end
10
+ class Mspire::Ident::Pepxml ; end
11
11
 
12
12
 
13
13
  # requires these keys:
@@ -15,10 +15,10 @@ class MS::Ident::Pepxml ; end
15
15
  # :enzyme => a valid enzyme name
16
16
  # :max_num_internal_cleavages => max number of internal cleavages allowed
17
17
  # :min_number_termini => minimum number of termini??
18
- class MS::Ident::Pepxml::EnzymaticSearchConstraint < Hash
18
+ class Mspire::Ident::Pepxml::EnzymaticSearchConstraint < Hash
19
19
  end
20
20
 
21
- class MS::Ident::Pepxml::SearchSummary
21
+ class Mspire::Ident::Pepxml::SearchSummary
22
22
  include Merge
23
23
 
24
24
  DEFAULT_SEARCH_ID = '1'
@@ -30,7 +30,7 @@ class MS::Ident::Pepxml::SearchSummary
30
30
  attr_accessor :out_data
31
31
  # by default, "1"
32
32
  attr_accessor :search_id
33
- # an array of MS::Ident::Pepxml::Modification objects
33
+ # an array of Mspire::Ident::Pepxml::Modification objects
34
34
  attr_accessor :modifications
35
35
  # A SearchDatabase object (responds to :local_path and :type)
36
36
  attr_accessor :search_database
@@ -47,10 +47,10 @@ class MS::Ident::Pepxml::SearchSummary
47
47
  attr_accessor :enzymatic_search_constraint
48
48
 
49
49
  def block_arg
50
- [@search_database = MS::Ident::Pepxml::SearchDatabase.new,
51
- @enzymatic_search_constraint = MS::Ident::Pepxml::EnzymaticSearchConstraint.new,
50
+ [@search_database = Mspire::Ident::Pepxml::SearchDatabase.new,
51
+ @enzymatic_search_constraint = Mspire::Ident::Pepxml::EnzymaticSearchConstraint.new,
52
52
  @modifications,
53
- @parameters = MS::Ident::Pepxml::Parameters.new,
53
+ @parameters = Mspire::Ident::Pepxml::Parameters.new,
54
54
  ]
55
55
  end
56
56
 
@@ -1,15 +1,15 @@
1
1
  require 'nokogiri'
2
- require 'ms/mass'
2
+ require 'mspire/mass'
3
3
  require 'merge'
4
4
 
5
- require 'ms/ident/pepxml/search_result'
5
+ require 'mspire/ident/pepxml/search_result'
6
6
 
7
- module MS ; end
8
- module MS::Ident ; end
9
- class MS::Ident::Pepxml ; end
7
+ module Mspire ; end
8
+ module Mspire::Ident ; end
9
+ class Mspire::Ident::Pepxml ; end
10
10
 
11
11
  # search_specification is a search constraint applied specifically to this query (a String)
12
- class MS::Ident::Pepxml::SpectrumQuery
12
+ class Mspire::Ident::Pepxml::SpectrumQuery
13
13
  include Merge
14
14
  DEFAULT_MEMBERS = [:spectrum, :start_scan, :end_scan, :precursor_neutral_mass, :index, :assumed_charge, :retention_time_sec, :search_specification, :search_results, :pepxml_version]
15
15
 
@@ -77,7 +77,7 @@ class MS::Ident::Pepxml::SpectrumQuery
77
77
  self
78
78
  end
79
79
 
80
- def self.calc_precursor_neutral_mass(m_plus_h, deltamass, h_plus=MS::Mass::H_PLUS)
80
+ def self.calc_precursor_neutral_mass(m_plus_h, deltamass, h_plus=Mspire::Mass::H_PLUS)
81
81
  m_plus_h - h_plus + deltamass
82
82
  end
83
83
  end
@@ -1,7 +1,7 @@
1
1
  require 'andand'
2
2
 
3
- module MS ; end
4
- module MS::Ident
3
+ module Mspire ; end
4
+ module Mspire::Ident
5
5
  module ProteinLike
6
6
  # an id for the protein
7
7
  attr_accessor :id
@@ -1,6 +1,6 @@
1
1
  require 'set'
2
2
 
3
- module MS
3
+ module Mspire
4
4
  module Ident
5
5
  # represents a group of proteins, typically indistinguishable in the
6
6
  # experiment.
@@ -47,7 +47,7 @@ module MS
47
47
  peptides_to_protein_group[peptide_set] << protein
48
48
  end
49
49
  peptides_to_protein_group.each do |pephits,ar_of_prots|
50
- pg = MS::Ident::ProteinGroup.new(ar_of_prots)
50
+ pg = Mspire::Ident::ProteinGroup.new(ar_of_prots)
51
51
  pg.peptide_hits = pephits
52
52
  peptides_to_protein_group[pephits] = pg
53
53
  end
@@ -1,5 +1,5 @@
1
1
 
2
- module MS
2
+ module Mspire
3
3
  module Ident
4
4
 
5
5
  module SearchLike
@@ -1,6 +1,6 @@
1
1
  require 'yaml'
2
2
 
3
- module MS
3
+ module Mspire
4
4
  class Isotope
5
5
  MEMBERS = [:atomic_number, :element, :mass_number, :atomic_mass, :relative_abundance, :average_mass, :mono]
6
6
  MEMBERS.each {|key| attr_accessor key }
@@ -30,7 +30,7 @@ module MS
30
30
 
31
31
  if File.exist?(INFO_FILE_FULL_PATH)
32
32
 
33
- ISOTOPES = YAML.load_file(INFO_FILE_FULL_PATH).map {|ar| MS::Isotope.new *ar }
33
+ ISOTOPES = YAML.load_file(INFO_FILE_FULL_PATH).map {|ar| Mspire::Isotope.new *ar }
34
34
  BY_ELEMENT = ISOTOPES.group_by(&:element)
35
35
 
36
36
  else
@@ -89,5 +89,5 @@ module MS
89
89
  end
90
90
 
91
91
  if __FILE__ == $0
92
- MS::Isotope::Updater.write_nist_info(MS::Isotope::INFO_FILE_FULL_PATH)
92
+ Mspire::Isotope::Updater.write_nist_info(Mspire::Isotope::INFO_FILE_FULL_PATH)
93
93
  end
@@ -1,5 +1,5 @@
1
1
 
2
- module MS
2
+ module Mspire
3
3
  class Isotope
4
4
  module AA
5
5
  # These represent counts for the individual residues (i.e., no extra H
@@ -1,12 +1,12 @@
1
1
 
2
- require 'ms/mass'
3
- require 'ms/isotope'
4
- require 'ms/molecular_formula'
5
- require 'ms/spectrum'
2
+ require 'mspire/mass'
3
+ require 'mspire/isotope'
4
+ require 'mspire/molecular_formula'
5
+ require 'mspire/spectrum'
6
6
 
7
7
  require 'fftw3'
8
8
 
9
- module MS
9
+ module Mspire
10
10
  class Isotope
11
11
  module Distribution
12
12
  NORMALIZE = :total
@@ -15,7 +15,7 @@ module MS
15
15
  end
16
16
  end
17
17
 
18
- module MS
18
+ module Mspire
19
19
  class MolecularFormula < Hash
20
20
 
21
21
  # takes any element composition (see any_to_num_elements).
@@ -30,7 +30,7 @@ module MS
30
30
  # :max normalize to the highest peak intensity
31
31
  # :low normalize to the intensity of the lowest m/z peak
32
32
  # (this is typically the monoisotopic peak)
33
- def isotope_distribution(normalize=MS::Isotope::Distribution::NORMALIZE, percent_cutoff=MS::Isotope::Distribution::PERCENT_CUTOFF)
33
+ def isotope_distribution(normalize=Mspire::Isotope::Distribution::NORMALIZE, percent_cutoff=Mspire::Isotope::Distribution::PERCENT_CUTOFF)
34
34
  mono_dist = raw_isotope_distribution
35
35
  # percent_cutoff:
36
36
  final_output = []
@@ -58,12 +58,12 @@ module MS
58
58
  # Arguments are passed directly to isotope_distribution.
59
59
  def isotope_distribution_spectrum(*args)
60
60
  intensities = isotope_distribution(*args)
61
- mono = self.map {|el,cnt| MS::Mass::MONO[el]*cnt }.reduce(:+)
61
+ mono = self.map {|el,cnt| Mspire::Mass::MONO[el]*cnt }.reduce(:+)
62
62
  masses = Array.new(intensities.size)
63
- neutron = MS::Mass::NEUTRON
63
+ neutron = Mspire::Mass::NEUTRON
64
64
  masses[0] = mono
65
65
  (1...masses.size).each {|i| masses[i] = masses[i-1] + neutron }
66
- MS::Spectrum.new [masses, intensities]
66
+ Mspire::Spectrum.new [masses, intensities]
67
67
  end
68
68
 
69
69
  # returns relative ratios from low nominal mass to high nominal mass.
@@ -72,14 +72,14 @@ module MS
72
72
  low_nominal = 0
73
73
  high_nominal = 0
74
74
  self.each do |el,cnt|
75
- isotopes = MS::Isotope::BY_ELEMENT[el]
75
+ isotopes = Mspire::Isotope::BY_ELEMENT[el]
76
76
  low_nominal += (isotopes.first.mass_number * cnt)
77
77
  high_nominal += (isotopes.last.mass_number * cnt)
78
78
  end
79
79
 
80
80
  ffts = self.map do |el, cnt|
81
- isotope_el_ar = NArray.float(high_nominal)
82
- MS::Isotope::BY_ELEMENT[el].each do |isotope|
81
+ isotope_el_ar = NArray.float(high_nominal+1)
82
+ Mspire::Isotope::BY_ELEMENT[el].each do |isotope|
83
83
  isotope_el_ar[isotope.mass_number] = isotope.relative_abundance
84
84
  end
85
85
  FFTW3.fft(isotope_el_ar)**cnt
@@ -92,12 +92,12 @@ module MS
92
92
 
93
93
  class Isotope
94
94
  module Distribution
95
- def self.calculate(molecular_formula_like, normalize=MS::Isotope::Distribution::NORMALIZE, percent_cutoff=MS::Isotope::Distribution::PERCENT_CUTOFF)
96
- MS::MolecularFormula.new(molecular_formula_like).isotope_distribution(normalize, percent_cutoff)
95
+ def self.calculate(molecular_formula_like, normalize=Mspire::Isotope::Distribution::NORMALIZE, percent_cutoff=Mspire::Isotope::Distribution::PERCENT_CUTOFF)
96
+ Mspire::MolecularFormula.new(molecular_formula_like).isotope_distribution(normalize, percent_cutoff)
97
97
  end
98
98
 
99
- def self.spectrum(molecular_formula_like, normalize=MS::Isotope::Distribution::NORMALIZE, percent_cutoff=MS::Isotope::Distribution::PERCENT_CUTOFF)
100
- MS::MolecularFormula.new(molecular_formula_like).isotope_distribution_spectrum(normalize, percent_cutoff)
99
+ def self.spectrum(molecular_formula_like, normalize=Mspire::Isotope::Distribution::NORMALIZE, percent_cutoff=Mspire::Isotope::Distribution::PERCENT_CUTOFF)
100
+ Mspire::MolecularFormula.new(molecular_formula_like).isotope_distribution_spectrum(normalize, percent_cutoff)
101
101
  end
102
102
  end
103
103
  end
File without changes
@@ -1,5 +1,5 @@
1
1
 
2
- module MS
2
+ module Mspire
3
3
  module Mascot
4
4
  H_PLUS = 1.007276
5
5
  end
@@ -1,12 +1,12 @@
1
- require 'ms/isotope'
2
- require 'ms/molecular_formula'
1
+ require 'mspire/isotope'
2
+ require 'mspire/molecular_formula'
3
3
 
4
- module MS
4
+ module Mspire
5
5
  module Mass
6
6
 
7
7
  # takes a molecular formula in this format: C2BrH12O
8
8
  def self.formula_to_exact_mass(formula)
9
- MS::MolecularFormula.new(formula).map do |el,cnt|
9
+ Mspire::MolecularFormula.new(formula).map do |el,cnt|
10
10
  MONO[el] * cnt
11
11
  end.reduce(:+)
12
12
  end
@@ -16,20 +16,20 @@ module MS
16
16
  'e' => 0.0005486, # www.mikeblaber.org/oldwine/chm1045/notes/Atoms/.../Atoms03.htm
17
17
  'neutron' => 1.0086649156,
18
18
  }
19
- MS::Isotope::BY_ELEMENT.each do |el, isotopes|
19
+ Mspire::Isotope::BY_ELEMENT.each do |el, isotopes|
20
20
  MONO_STR[el.to_s] = isotopes.find {|iso| iso.mono }.atomic_mass
21
21
  end
22
22
  MONO_STR['h2o'] = %w(h h o).map {|el| MONO_STR[el] }.reduce(:+)
23
23
  MONO_STR['oh'] = %w(o h).map {|el| MONO_STR[el] }.reduce(:+)
24
24
  # add on deuterium
25
- MONO_STR['d'] = MS::Isotope::BY_ELEMENT[:h].find {|iso| iso.element == :h && iso.mass_number == 2 }.atomic_mass
25
+ MONO_STR['d'] = Mspire::Isotope::BY_ELEMENT[:h].find {|iso| iso.element == :h && iso.mass_number == 2 }.atomic_mass
26
26
 
27
27
  AVG_STR = {
28
28
  'h+' => 1.007276, # using Mascot_H_plus mass (is this right for AVG??)
29
29
  'e' => 0.0005486,
30
30
  'neutron' => 1.0086649156,
31
31
  }
32
- MS::Isotope::BY_ELEMENT.each do |el, isotopes|
32
+ Mspire::Isotope::BY_ELEMENT.each do |el, isotopes|
33
33
  AVG_STR[el.to_s] = isotopes.first.average_mass
34
34
  end
35
35
  AVG_STR['h2o'] = %w(h h o).map {|el| AVG_STR[el] }.reduce(:+)