ms-lipidomics 0.1.1 → 0.1.2

Sign up to get free protection for your applications and to get access to all the features.
Files changed (4) hide show
  1. data/Rakefile +1 -1
  2. data/VERSION +1 -1
  3. data/bin/lipidomic-search.rb +8 -6
  4. metadata +10 -10
data/Rakefile CHANGED
@@ -13,7 +13,7 @@ Jeweler::Tasks.new do |gem|
13
13
  gem.description = %Q{does ms lipidomics}
14
14
  gem.email = "jtprince@gmail.com"
15
15
  gem.authors = ["John T. Prince"]
16
- gem.add_dependency "mspire", ">= 0.6.18"
16
+ gem.add_dependency "mspire", ">= 0.6.19"
17
17
  gem.add_development_dependency "rspec", "~> 2.3.0"
18
18
  gem.add_development_dependency "jeweler", "~> 1.6.4"
19
19
  gem.add_development_dependency "rcov", ">= 0"
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.1.1
1
+ 0.1.2
@@ -27,11 +27,7 @@ class Sample
27
27
  # returns a single spectrum object
28
28
  def merge_ms1_spectra(file, opts)
29
29
  spectra = []
30
- warn "using number of peaks as proxy for ms level right now"
31
- MS::Mzml.foreach(file) do |spectrum|
32
- spectra << spectrum if spectrum.mzs.size > 1000 # <<<<<<------ kludge for ms_level == 1
33
- end
34
- spectra.each {|spectrum| spectrum.sort! }
30
+ spectra = MS::Mzml.foreach(file).select {|spec| spec.ms_level == 1 }.map(&:sort!)
35
31
 
36
32
  MS::Spectrum.merge(spectra, opts)
37
33
  end
@@ -52,6 +48,7 @@ parser = Trollop::Parser.new do
52
48
  opt :search_unit, "unit for searching nearest hit (ppm or amu)", :default => DEFAULTS[:search_unit].to_s
53
49
  opt :top_n_peaks, "the number of highest intensity peaks to query the DB with", :default => 1000
54
50
  opt :display_n, "the number of best hits to display", :default => 20
51
+ opt :lithium, "also search for lithium adducts"
55
52
  opt :verbose, "talk about it"
56
53
  end
57
54
 
@@ -70,11 +67,16 @@ $VERBOSE = opts[:verbose]
70
67
 
71
68
  proton = MS::Lipid::Modification.new(:proton)
72
69
  h2o_loss = MS::Lipid::Modification.new(:water, :loss => true)
70
+ lithium = MS::Lipid::Modification.new(:lithium)
73
71
 
74
72
  lipids = MS::LipidMaps.parse_file(lipidmaps)
75
73
 
76
74
  ions = lipids.map do |lipid|
77
- [[proton], [proton, h2o_loss]].map do |mods|
75
+ mod_groups = [[proton], [proton, h2o_loss]]
76
+ if opt[:lithium]
77
+ mod_groups.push( [lithium], [lithium, h2o_loss] )
78
+ end
79
+ mod_groups.map do |mods|
78
80
  MS::Lipid::Ion.new(lipid, mods)
79
81
  end
80
82
  end.flatten(1)
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ms-lipidomics
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.1
4
+ version: 0.1.2
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -13,18 +13,18 @@ date: 2012-02-24 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: mspire
16
- requirement: &18073100 !ruby/object:Gem::Requirement
16
+ requirement: &16132440 !ruby/object:Gem::Requirement
17
17
  none: false
18
18
  requirements:
19
19
  - - ! '>='
20
20
  - !ruby/object:Gem::Version
21
- version: 0.6.18
21
+ version: 0.6.19
22
22
  type: :runtime
23
23
  prerelease: false
24
- version_requirements: *18073100
24
+ version_requirements: *16132440
25
25
  - !ruby/object:Gem::Dependency
26
26
  name: rspec
27
- requirement: &18072580 !ruby/object:Gem::Requirement
27
+ requirement: &16131900 !ruby/object:Gem::Requirement
28
28
  none: false
29
29
  requirements:
30
30
  - - ~>
@@ -32,10 +32,10 @@ dependencies:
32
32
  version: 2.3.0
33
33
  type: :development
34
34
  prerelease: false
35
- version_requirements: *18072580
35
+ version_requirements: *16131900
36
36
  - !ruby/object:Gem::Dependency
37
37
  name: jeweler
38
- requirement: &18072100 !ruby/object:Gem::Requirement
38
+ requirement: &16147680 !ruby/object:Gem::Requirement
39
39
  none: false
40
40
  requirements:
41
41
  - - ~>
@@ -43,10 +43,10 @@ dependencies:
43
43
  version: 1.6.4
44
44
  type: :development
45
45
  prerelease: false
46
- version_requirements: *18072100
46
+ version_requirements: *16147680
47
47
  - !ruby/object:Gem::Dependency
48
48
  name: rcov
49
- requirement: &18071620 !ruby/object:Gem::Requirement
49
+ requirement: &16147160 !ruby/object:Gem::Requirement
50
50
  none: false
51
51
  requirements:
52
52
  - - ! '>='
@@ -54,7 +54,7 @@ dependencies:
54
54
  version: '0'
55
55
  type: :development
56
56
  prerelease: false
57
- version_requirements: *18071620
57
+ version_requirements: *16147160
58
58
  description: does ms lipidomics
59
59
  email: jtprince@gmail.com
60
60
  executables: