mspire 0.9.0 → 0.9.1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 4387e931e6ccbee8bcb2a382e99121b54cd7a93c
4
- data.tar.gz: 8e36b2bcc731e4a9188a8f92080deefa9ec8fcd4
3
+ metadata.gz: c336dad2fe75675083d7a794707b30f1a8c66146
4
+ data.tar.gz: c20655cf68c224ef11fcfa72fcaf9434b2ae8a23
5
5
  SHA512:
6
- metadata.gz: 082c1074fbabc423dd4a461221e95496953ad998ccc36f0fa71d12c402503a0fc92359c5f915c9637fc863899f2b05a6e3d2bd0f7b6ea8e45eab743cc86a4786
7
- data.tar.gz: 9a036dfd6ff0fc44b90ef208ce1a7d5d68fc33a3b7196cea111b8a6bf48b3fcc50670a688e060259c9835f07e61fc12895cf7166dcc3073846b3cf0a1c53e7a5
6
+ metadata.gz: ddd03724a6b05881f64cd09deb3bf9d8f17e77d515a22419f95cf02f505d780bc347e8b9afd3f0d387d947d00166b0f36340f7ec81dbd1d47022e2333a3425a7
7
+ data.tar.gz: 7a110c0640b43c775c37deb63d3e5eb53c7f0d7f1e9aa5debd65707428bc25590db626f78701156c0354383d5e9d30128fcb741bc647ce8c331638b401ba05b3
@@ -29,8 +29,8 @@ module Mspire
29
29
  # :max normalize to the highest peak intensity
30
30
  # :first normalize to the intensity of the first peak
31
31
  # (this is typically the monoisotopic peak)
32
- def isotope_distribution(normalize=Mspire::Isotope::Distribution::NORMALIZE, percent_cutoff=nil)
33
- mono_dist = raw_isotope_distribution
32
+ def isotope_distribution(normalize=Mspire::Isotope::Distribution::NORMALIZE, percent_cutoff=nil, isotope_table=Mspire::Isotope::BY_ELEMENT)
33
+ mono_dist = raw_isotope_distribution(isotope_table)
34
34
 
35
35
  if percent_cutoff
36
36
  total_signal = mono_dist.reduce(:+)
@@ -83,18 +83,18 @@ module Mspire
83
83
 
84
84
  # returns relative ratios from low nominal mass to high nominal mass.
85
85
  # These are *not* normalized at all.
86
- def raw_isotope_distribution
86
+ def raw_isotope_distribution(isotope_table=Mspire::Isotope::BY_ELEMENT)
87
87
  low_nominal = 0
88
88
  high_nominal = 0
89
89
  self.each do |el,cnt|
90
- isotopes = Mspire::Isotope::BY_ELEMENT[el]
90
+ isotopes = isotope_table[el]
91
91
  low_nominal += (isotopes.first.mass_number * cnt)
92
92
  high_nominal += (isotopes.last.mass_number * cnt)
93
93
  end
94
94
 
95
95
  ffts = self.map do |el, cnt|
96
96
  isotope_el_ar = NArray.float(high_nominal+1)
97
- Mspire::Isotope::BY_ELEMENT[el].each do |isotope|
97
+ isotope_table[el].each do |isotope|
98
98
  isotope_el_ar[isotope.mass_number] = isotope.relative_abundance
99
99
  end
100
100
  FFTW3.fft(isotope_el_ar)**cnt
@@ -1,3 +1,3 @@
1
1
  module Mspire
2
- VERSION = "0.9.0"
2
+ VERSION = "0.9.1"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: mspire
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.9.0
4
+ version: 0.9.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - John T. Prince
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2013-08-14 00:00:00.000000000 Z
12
+ date: 2013-08-15 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: nokogiri