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 +4 -4
- data/lib/mspire/isotope/distribution.rb +5 -5
- data/lib/mspire/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: c336dad2fe75675083d7a794707b30f1a8c66146
|
4
|
+
data.tar.gz: c20655cf68c224ef11fcfa72fcaf9434b2ae8a23
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
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 =
|
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
|
-
|
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
|
data/lib/mspire/version.rb
CHANGED
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.
|
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-
|
12
|
+
date: 2013-08-15 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: nokogiri
|