ms-core 0.0.12 → 0.0.13
Sign up to get free protection for your applications and to get access to all the features.
- data/Rakefile +1 -0
- data/VERSION +1 -1
- data/lib/ms/mass/aa.rb +6 -4
- data/lib/ms/mass.rb +9 -2
- data/spec/ms/mass/aa_spec.rb +8 -0
- metadata +5 -5
data/Rakefile
CHANGED
@@ -19,6 +19,7 @@ Jeweler::Tasks.new do |gem|
|
|
19
19
|
gem.description = %Q{basic, shared functionality for mspire libraries}
|
20
20
|
gem.email = "jtprince@gmail.com"
|
21
21
|
gem.authors = ["John T. Prince", "Simon Chiang"]
|
22
|
+
gem.rubyforge_project = 'mspire'
|
22
23
|
# Dependencies in Gemfile
|
23
24
|
end
|
24
25
|
Jeweler::RubygemsDotOrgTasks.new
|
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.0.
|
1
|
+
0.0.13
|
data/lib/ms/mass/aa.rb
CHANGED
@@ -96,10 +96,12 @@ module Ms
|
|
96
96
|
# amino_acids keys as symbols, average masses
|
97
97
|
AVG_SYM = Hash[AVG_STRING.map {|aa,mass| [aa.to_sym, mass] } ]
|
98
98
|
|
99
|
-
#
|
100
|
-
MONO
|
101
|
-
|
102
|
-
|
99
|
+
# Monoisotopic amino acid masses keyed as symbols and also strings (all
|
100
|
+
# upper case). Also includes Ms::Mass::MONO for things like protons ('h+')
|
101
|
+
MONO = MONO_SYM.merge(MONO_STRING).merge(Ms::Mass::MONO)
|
102
|
+
# Average amino acid masses keyed as symbols and also strings (all
|
103
|
+
# uppder case). Also includes Ms::Mass::AVG for things like protons ('h+')
|
104
|
+
AVG = AVG_SYM.merge(AVG_STRING).merge(Ms::Mass::AVG)
|
103
105
|
|
104
106
|
###########################################################################
|
105
107
|
# This section is broken in 1.9 (ruby-units fault), so we generate the
|
data/lib/ms/mass.rb
CHANGED
@@ -6,18 +6,25 @@ module Ms
|
|
6
6
|
PROTON = H_PLUS
|
7
7
|
|
8
8
|
# lower case elements (h = Hydrogen)
|
9
|
-
|
9
|
+
MONO_STRING = {
|
10
10
|
'h+' => 1.00727646677,
|
11
11
|
'h' => 1.007825035,
|
12
12
|
'h2o' => 18.0105647,
|
13
13
|
'oh' => 17.002739665,
|
14
14
|
}
|
15
|
+
MONO_SYM = Hash[ MONO_STRING.map {|k,v| [k.to_sym, v] } ]
|
16
|
+
MONO = MONO_STRING.merge(MONO_SYM)
|
17
|
+
|
15
18
|
# lower case elements (h = Hydrogen)
|
16
|
-
|
19
|
+
AVG_STRING = {
|
20
|
+
'h+' => 1.007276, # using Mascot_H_plus mass (is this right for AVG??)
|
17
21
|
'h' => 1.00794,
|
18
22
|
'h2o' => 18.01528,
|
19
23
|
'oh' => 17.00734,
|
20
24
|
}
|
25
|
+
AVG_SYM = Hash[ AVG_STRING.map {|k,v| [k.to_sym, v] } ]
|
26
|
+
AVG = AVG_STRING.merge(AVG_SYM)
|
27
|
+
|
21
28
|
end
|
22
29
|
end
|
23
30
|
|
data/spec/ms/mass/aa_spec.rb
CHANGED
@@ -7,8 +7,16 @@ describe 'using a mass table' do
|
|
7
7
|
Ms::Mass::AA::MONO['A'].is 71.0371137878
|
8
8
|
Ms::Mass::AA::MONO[:A].is 71.0371137878
|
9
9
|
end
|
10
|
+
it 'MONO also includes Ms::Mass::MONO' do
|
11
|
+
Ms::Mass::AA::MONO['oh'].is 17.002739665
|
12
|
+
Ms::Mass::AA::MONO[:oh].is 17.002739665
|
13
|
+
end
|
10
14
|
it 'has average masses by string or symbol' do
|
11
15
|
Ms::Mass::AA::AVG['A'].is 71.0779
|
12
16
|
Ms::Mass::AA::AVG[:A].is 71.0779
|
13
17
|
end
|
18
|
+
it 'AVG also includes Ms::Mass::AVG' do
|
19
|
+
Ms::Mass::AA::AVG['oh'].is 17.00734
|
20
|
+
Ms::Mass::AA::AVG[:oh].is 17.00734
|
21
|
+
end
|
14
22
|
end
|
metadata
CHANGED
@@ -5,8 +5,8 @@ version: !ruby/object:Gem::Version
|
|
5
5
|
segments:
|
6
6
|
- 0
|
7
7
|
- 0
|
8
|
-
-
|
9
|
-
version: 0.0.
|
8
|
+
- 13
|
9
|
+
version: 0.0.13
|
10
10
|
platform: ruby
|
11
11
|
authors:
|
12
12
|
- John T. Prince
|
@@ -15,7 +15,7 @@ autorequire:
|
|
15
15
|
bindir: bin
|
16
16
|
cert_chain: []
|
17
17
|
|
18
|
-
date: 2011-02-
|
18
|
+
date: 2011-02-28 00:00:00 -07:00
|
19
19
|
default_executable:
|
20
20
|
dependencies:
|
21
21
|
- !ruby/object:Gem::Dependency
|
@@ -146,7 +146,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
146
146
|
requirements:
|
147
147
|
- - ">="
|
148
148
|
- !ruby/object:Gem::Version
|
149
|
-
hash: -
|
149
|
+
hash: -1109965199117656197
|
150
150
|
segments:
|
151
151
|
- 0
|
152
152
|
version: "0"
|
@@ -160,7 +160,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
160
160
|
version: "0"
|
161
161
|
requirements: []
|
162
162
|
|
163
|
-
rubyforge_project:
|
163
|
+
rubyforge_project: mspire
|
164
164
|
rubygems_version: 1.3.7
|
165
165
|
signing_key:
|
166
166
|
specification_version: 3
|