divvy_proteomics 0.0.1
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.
- data/.document +5 -0
- data/.rspec +1 -0
- data/Gemfile +13 -0
- data/LICENSE.txt +20 -0
- data/README.md +45 -0
- data/Rakefile +49 -0
- data/VERSION +1 -0
- data/bin/divvy_spectra +362 -0
- data/divvy_proteomics.gemspec +74 -0
- data/lib/divvy_proteomics.rb +0 -0
- data/spec/data/merge_definition.csv +1 -0
- data/spec/data/multiply_mapped_spectra.csv +95 -0
- data/spec/data/single_protein.csv +52 -0
- data/spec/data/single_protein_with_aliases.csv +53 -0
- data/spec/data/three_proteins.csv +76 -0
- data/spec/data/three_proteins_meant_for_merge.csv +81 -0
- data/spec/data/three_proteins_with_contaminant.csv +87 -0
- data/spec/divvy_proteomics_spec.rb +106 -0
- data/spec/spec_helper.rb +12 -0
- metadata +166 -0
@@ -0,0 +1,106 @@
|
|
1
|
+
require 'systemu'
|
2
|
+
require 'pp'
|
3
|
+
require 'open3'
|
4
|
+
require 'tempfile'
|
5
|
+
|
6
|
+
# To run this test:
|
7
|
+
# $ rspec /path/to/test_script_being_tested.rb
|
8
|
+
|
9
|
+
# Assumes that the name of the file being tested is ../something.rb, and the name of this script is test_something.rb
|
10
|
+
$:.unshift File.join(File.dirname(__FILE__),'..')
|
11
|
+
script_under_test = File.basename(__FILE__).gsub(/^test_/,'')
|
12
|
+
path_to_script = File.join(File.dirname(__FILE__),'..','bin','divvy_spectra')
|
13
|
+
|
14
|
+
TEST_DATA_DIR = File.join(File.dirname(__FILE__),'data')
|
15
|
+
|
16
|
+
describe script_under_test do
|
17
|
+
let(:header){"ID\tUnique spectra\tNon-unique spectra\tEstimated total spectra\tNormalised spectral count\tDescription\tProteins sharing spectra\n"}
|
18
|
+
it 'should do 1 protein hit' do
|
19
|
+
test_file = "#{path_to_script} #{TEST_DATA_DIR}/single_protein.csv --trace error"
|
20
|
+
status, stdout, stderr = systemu test_file
|
21
|
+
|
22
|
+
stderr.should eq("")
|
23
|
+
answer = header+
|
24
|
+
['Mstor_v4.3.2:1344','188','0','188.0','1.0','Methanoflorens_stordalmirensis_v4.3.2_01361 Methyl-coenzyme M reductase I subunit gamma ',''].join("\t")+"\n"
|
25
|
+
stdout.should eq(answer)
|
26
|
+
end
|
27
|
+
|
28
|
+
it 'should do peptides that hit 2 proteins' do
|
29
|
+
test_file = "#{path_to_script} #{TEST_DATA_DIR}/three_proteins.csv --trace error"
|
30
|
+
status, stdout, stderr = systemu test_file
|
31
|
+
|
32
|
+
stderr.should eq("")
|
33
|
+
answer = header+
|
34
|
+
['Mstor_v4.3.2:1344','37','151','89.7075471698113','0.29509061569016876','Methanoflorens_stordalmirensis_v4.3.2_01361 Methyl-coenzyme M reductase I subunit gamma ','eDeep20120820:eD1_8237_2'+"\n"].join("\t")+
|
35
|
+
['eDeep20120820:eD1_8237_2','69','151','167.29245283018867','0.5503041211519364','methyl-coenzyme M reductase gamma subunit # pI:8.94 MW:27683 ','Mstor_v4.3.2:1344'+"\n"].join("\t")+
|
36
|
+
['eDeep20120820:eD1_1639_1','47','0','47.0','0.15460526315789475','chaperonin GroEL # pI:9.22 MW:10181 ',''+"\n"].join("\t")
|
37
|
+
stdout.should eq(answer)
|
38
|
+
end
|
39
|
+
|
40
|
+
it 'should do peptides that hit more than 2 proteins' do
|
41
|
+
test_file = "#{path_to_script} #{TEST_DATA_DIR}/multiply_mapped_spectra.csv --trace error"
|
42
|
+
status, stdout, stderr = systemu test_file
|
43
|
+
|
44
|
+
stderr.should eq("")
|
45
|
+
answer = header+
|
46
|
+
['Mstor_v4.3.2:1344','37','151','89.7075471698113','0.24781090378400913','Methanoflorens_stordalmirensis_v4.3.2_01361 Methyl-coenzyme M reductase I subunit gamma ','eDeep20120820:eD1_8237_2'+"\n"].join("\t")+
|
47
|
+
['eDeep20120820:eD1_8237_2','69','151','167.29245283018867','0.46213384759720627','methyl-coenzyme M reductase gamma subunit # pI:8.94 MW:27683 ','Mstor_v4.3.2:1344'+"\n"].join("\t")+
|
48
|
+
['eDeep20120820:eD1_1639_1','47','0','47.0','0.1298342541436464','chaperonin GroEL # pI:9.22 MW:10181 ',''+"\n"].join("\t")+
|
49
|
+
['eDeep20120820:eD1_13975_5','9','1','9.157894736842106','0.02529805175923234','chaperonin GroEL # pI:6.58 MW:12040 ','eDeep20120820:eD1_3396_1,eDeep20120820:eD1_1494_8'+"\n"].join("\t")+
|
50
|
+
['eDeep20120820:eD1_3396_1','38','1','38.666666666666664','0.10681399631675874','TGroEL # pI:9.70 MW:6451 ','eDeep20120820:eD1_13975_5,eDeep20120820:eD1_1494_8'+"\n"].join("\t")+
|
51
|
+
['eDeep20120820:eD1_1494_8','10','1','10.175438596491228','0.028108946399147038','chaperonin GroEL # pI:4.93 MW:54101 ','eDeep20120820:eD1_13975_5,eDeep20120820:eD1_3396_1'+"\n"].join("\t")
|
52
|
+
|
53
|
+
stdout.should eq(answer)
|
54
|
+
end
|
55
|
+
|
56
|
+
it 'should ignore contaminants' do
|
57
|
+
test_file = "#{path_to_script} #{TEST_DATA_DIR}/three_proteins_with_contaminant.csv --trace error"
|
58
|
+
status, stdout, stderr = systemu test_file
|
59
|
+
|
60
|
+
stderr.should eq("")
|
61
|
+
answer = header+
|
62
|
+
['Mstor_v4.3.2:1344','37','151','89.7075471698113','0.29509061569016876','Methanoflorens_stordalmirensis_v4.3.2_01361 Methyl-coenzyme M reductase I subunit gamma ','eDeep20120820:eD1_8237_2'+"\n"].join("\t")+
|
63
|
+
['eDeep20120820:eD1_8237_2','69','151','167.29245283018867','0.5503041211519364','methyl-coenzyme M reductase gamma subunit # pI:8.94 MW:27683 ','Mstor_v4.3.2:1344'+"\n"].join("\t")+
|
64
|
+
['eDeep20120820:eD1_1639_1','47','0','47.0','0.15460526315789475','chaperonin GroEL # pI:9.22 MW:10181 ',''+"\n"].join("\t")
|
65
|
+
stdout.should eq(answer)
|
66
|
+
end
|
67
|
+
|
68
|
+
it 'should do ok merging spectra' do
|
69
|
+
test_file = "#{path_to_script} #{TEST_DATA_DIR}/three_proteins_meant_for_merge.csv --merge-proteins #{File.join(TEST_DATA_DIR,'merge_definition.csv')} --trace error"
|
70
|
+
status, stdout, stderr = systemu test_file
|
71
|
+
|
72
|
+
stderr.should eq("")
|
73
|
+
answer = header+
|
74
|
+
['Mstor_v4.3.2:1344','37','151','89.7075471698113','0.29509061569016876','Methanoflorens_stordalmirensis_v4.3.2_01361 Methyl-coenzyme M reductase I subunit gamma ','eDeep20120820:eD1_8237_2'+"\n"].join("\t")+
|
75
|
+
['eDeep20120820:eD1_8237_2','69','151','167.29245283018867','0.5503041211519364','methyl-coenzyme M reductase gamma subunit # pI:8.94 MW:27683 ','Mstor_v4.3.2:1344'+"\n"].join("\t")+
|
76
|
+
['eDeep20120820:eD1_1639_1','47','0','47.0','0.15460526315789475','chaperonin GroEL # pI:9.22 MW:10181 ',''+"\n"].join("\t")
|
77
|
+
stdout.should eq(answer)
|
78
|
+
end
|
79
|
+
|
80
|
+
it 'should do 1 protein with an alias' do
|
81
|
+
test_file = "#{path_to_script} #{TEST_DATA_DIR}/single_protein_with_aliases.csv --trace error"
|
82
|
+
status, stdout, stderr = systemu test_file
|
83
|
+
|
84
|
+
stderr.should eq("")
|
85
|
+
answer = header+
|
86
|
+
['Mstor_v4.3.2:1344','0','188','94.0','0.5','Methanoflorens_stordalmirensis_v4.3.2_01361 Methyl-coenzyme M reductase I subunit gamma ','alias1'+"\n"].join("\t")+
|
87
|
+
['alias1','0','188','94.0','0.5','alias1 Methyl-coenzyme M reductase I subunit gamma ','Mstor_v4.3.2:1344'+"\n"].join("\t")
|
88
|
+
stdout.should eq(answer), test_file
|
89
|
+
end
|
90
|
+
|
91
|
+
it 'should do a whitelist correctly' do
|
92
|
+
Tempfile.open('test_divvy_spectra') do |tempfile|
|
93
|
+
%w(eDeep20120820:eD1_8237_2 eDeep20120820:eD1_1639_1).each {|i| tempfile.puts i}
|
94
|
+
tempfile.close
|
95
|
+
|
96
|
+
test_file = "#{path_to_script} --whitelist #{tempfile.path} #{TEST_DATA_DIR}/three_proteins.csv --trace error"
|
97
|
+
status, stdout, stderr = systemu test_file
|
98
|
+
|
99
|
+
stderr.should eq("")
|
100
|
+
answer = header+
|
101
|
+
['eDeep20120820:eD1_8237_2','69','151','167.29245283018867','0.5503041211519364','methyl-coenzyme M reductase gamma subunit # pI:8.94 MW:27683 ','Mstor_v4.3.2:1344'+"\n"].join("\t")+
|
102
|
+
['eDeep20120820:eD1_1639_1','47','0','47.0','0.15460526315789475','chaperonin GroEL # pI:9.22 MW:10181 ',''+"\n"].join("\t")
|
103
|
+
stdout.should eq(answer)
|
104
|
+
end
|
105
|
+
end
|
106
|
+
end
|
data/spec/spec_helper.rb
ADDED
@@ -0,0 +1,12 @@
|
|
1
|
+
$LOAD_PATH.unshift(File.join(File.dirname(__FILE__), '..', 'lib'))
|
2
|
+
$LOAD_PATH.unshift(File.dirname(__FILE__))
|
3
|
+
require 'rspec'
|
4
|
+
require 'divvy_proteomics'
|
5
|
+
|
6
|
+
# Requires supporting files with custom matchers and macros, etc,
|
7
|
+
# in ./support/ and its subdirectories.
|
8
|
+
Dir["#{File.dirname(__FILE__)}/support/**/*.rb"].each {|f| require f}
|
9
|
+
|
10
|
+
RSpec.configure do |config|
|
11
|
+
|
12
|
+
end
|
metadata
ADDED
@@ -0,0 +1,166 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: divvy_proteomics
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 0.0.1
|
5
|
+
prerelease:
|
6
|
+
platform: ruby
|
7
|
+
authors:
|
8
|
+
- Ben J Woodcroft
|
9
|
+
autorequire:
|
10
|
+
bindir: bin
|
11
|
+
cert_chain: []
|
12
|
+
date: 2013-04-13 00:00:00.000000000 Z
|
13
|
+
dependencies:
|
14
|
+
- !ruby/object:Gem::Dependency
|
15
|
+
name: bio-logger
|
16
|
+
requirement: !ruby/object:Gem::Requirement
|
17
|
+
none: false
|
18
|
+
requirements:
|
19
|
+
- - ! '>='
|
20
|
+
- !ruby/object:Gem::Version
|
21
|
+
version: '0'
|
22
|
+
type: :runtime
|
23
|
+
prerelease: false
|
24
|
+
version_requirements: !ruby/object:Gem::Requirement
|
25
|
+
none: false
|
26
|
+
requirements:
|
27
|
+
- - ! '>='
|
28
|
+
- !ruby/object:Gem::Version
|
29
|
+
version: '0'
|
30
|
+
- !ruby/object:Gem::Dependency
|
31
|
+
name: systemu
|
32
|
+
requirement: !ruby/object:Gem::Requirement
|
33
|
+
none: false
|
34
|
+
requirements:
|
35
|
+
- - ! '>='
|
36
|
+
- !ruby/object:Gem::Version
|
37
|
+
version: '0'
|
38
|
+
type: :development
|
39
|
+
prerelease: false
|
40
|
+
version_requirements: !ruby/object:Gem::Requirement
|
41
|
+
none: false
|
42
|
+
requirements:
|
43
|
+
- - ! '>='
|
44
|
+
- !ruby/object:Gem::Version
|
45
|
+
version: '0'
|
46
|
+
- !ruby/object:Gem::Dependency
|
47
|
+
name: rspec
|
48
|
+
requirement: !ruby/object:Gem::Requirement
|
49
|
+
none: false
|
50
|
+
requirements:
|
51
|
+
- - ! '>='
|
52
|
+
- !ruby/object:Gem::Version
|
53
|
+
version: 2.8.0
|
54
|
+
type: :development
|
55
|
+
prerelease: false
|
56
|
+
version_requirements: !ruby/object:Gem::Requirement
|
57
|
+
none: false
|
58
|
+
requirements:
|
59
|
+
- - ! '>='
|
60
|
+
- !ruby/object:Gem::Version
|
61
|
+
version: 2.8.0
|
62
|
+
- !ruby/object:Gem::Dependency
|
63
|
+
name: rdoc
|
64
|
+
requirement: !ruby/object:Gem::Requirement
|
65
|
+
none: false
|
66
|
+
requirements:
|
67
|
+
- - ! '>='
|
68
|
+
- !ruby/object:Gem::Version
|
69
|
+
version: '3.12'
|
70
|
+
type: :development
|
71
|
+
prerelease: false
|
72
|
+
version_requirements: !ruby/object:Gem::Requirement
|
73
|
+
none: false
|
74
|
+
requirements:
|
75
|
+
- - ! '>='
|
76
|
+
- !ruby/object:Gem::Version
|
77
|
+
version: '3.12'
|
78
|
+
- !ruby/object:Gem::Dependency
|
79
|
+
name: bundler
|
80
|
+
requirement: !ruby/object:Gem::Requirement
|
81
|
+
none: false
|
82
|
+
requirements:
|
83
|
+
- - ! '>='
|
84
|
+
- !ruby/object:Gem::Version
|
85
|
+
version: 1.0.0
|
86
|
+
type: :development
|
87
|
+
prerelease: false
|
88
|
+
version_requirements: !ruby/object:Gem::Requirement
|
89
|
+
none: false
|
90
|
+
requirements:
|
91
|
+
- - ! '>='
|
92
|
+
- !ruby/object:Gem::Version
|
93
|
+
version: 1.0.0
|
94
|
+
- !ruby/object:Gem::Dependency
|
95
|
+
name: jeweler
|
96
|
+
requirement: !ruby/object:Gem::Requirement
|
97
|
+
none: false
|
98
|
+
requirements:
|
99
|
+
- - ! '>='
|
100
|
+
- !ruby/object:Gem::Version
|
101
|
+
version: 1.8.4
|
102
|
+
type: :development
|
103
|
+
prerelease: false
|
104
|
+
version_requirements: !ruby/object:Gem::Requirement
|
105
|
+
none: false
|
106
|
+
requirements:
|
107
|
+
- - ! '>='
|
108
|
+
- !ruby/object:Gem::Version
|
109
|
+
version: 1.8.4
|
110
|
+
description: divvy up spectra from DTASelect files in a somewhat parsimonious way
|
111
|
+
email: donttrustben@gmail.com
|
112
|
+
executables:
|
113
|
+
- divvy_spectra
|
114
|
+
extensions: []
|
115
|
+
extra_rdoc_files:
|
116
|
+
- LICENSE.txt
|
117
|
+
- README.md
|
118
|
+
files:
|
119
|
+
- .document
|
120
|
+
- .rspec
|
121
|
+
- Gemfile
|
122
|
+
- LICENSE.txt
|
123
|
+
- README.md
|
124
|
+
- Rakefile
|
125
|
+
- VERSION
|
126
|
+
- bin/divvy_spectra
|
127
|
+
- divvy_proteomics.gemspec
|
128
|
+
- lib/divvy_proteomics.rb
|
129
|
+
- spec/data/merge_definition.csv
|
130
|
+
- spec/data/multiply_mapped_spectra.csv
|
131
|
+
- spec/data/single_protein.csv
|
132
|
+
- spec/data/single_protein_with_aliases.csv
|
133
|
+
- spec/data/three_proteins.csv
|
134
|
+
- spec/data/three_proteins_meant_for_merge.csv
|
135
|
+
- spec/data/three_proteins_with_contaminant.csv
|
136
|
+
- spec/divvy_proteomics_spec.rb
|
137
|
+
- spec/spec_helper.rb
|
138
|
+
homepage: http://github.com/wwood/divvy_proteomics
|
139
|
+
licenses:
|
140
|
+
- MIT
|
141
|
+
post_install_message:
|
142
|
+
rdoc_options: []
|
143
|
+
require_paths:
|
144
|
+
- lib
|
145
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
146
|
+
none: false
|
147
|
+
requirements:
|
148
|
+
- - ! '>='
|
149
|
+
- !ruby/object:Gem::Version
|
150
|
+
version: '0'
|
151
|
+
segments:
|
152
|
+
- 0
|
153
|
+
hash: -659530255
|
154
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
155
|
+
none: false
|
156
|
+
requirements:
|
157
|
+
- - ! '>='
|
158
|
+
- !ruby/object:Gem::Version
|
159
|
+
version: '0'
|
160
|
+
requirements: []
|
161
|
+
rubyforge_project:
|
162
|
+
rubygems_version: 1.8.24
|
163
|
+
signing_key:
|
164
|
+
specification_version: 3
|
165
|
+
summary: divvy up spectra from DTASelect files in a parsimonious way
|
166
|
+
test_files: []
|