mspire 0.5.0 → 0.6.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/README.rdoc +24 -0
- data/Rakefile +51 -0
- data/VERSION +1 -0
- data/lib/cv/description.rb +18 -0
- data/lib/cv/param.rb +33 -0
- data/lib/cv.rb +3 -0
- data/lib/io/bookmark.rb +13 -0
- data/lib/merge.rb +7 -0
- data/lib/ms/cvlist.rb +76 -0
- data/lib/ms/digester.rb +245 -0
- data/lib/ms/fasta.rb +86 -0
- data/lib/ms/ident/peptide/db.rb +243 -0
- data/lib/ms/ident/peptide.rb +72 -0
- data/lib/ms/ident/peptide_hit/qvalue.rb +56 -0
- data/lib/ms/ident/peptide_hit.rb +26 -0
- data/lib/ms/ident/pepxml/modifications.rb +83 -0
- data/lib/ms/ident/pepxml/msms_pipeline_analysis.rb +70 -0
- data/lib/ms/ident/pepxml/msms_run_summary.rb +82 -0
- data/lib/ms/ident/pepxml/parameters.rb +14 -0
- data/lib/ms/ident/pepxml/sample_enzyme.rb +165 -0
- data/lib/ms/ident/pepxml/search_database.rb +49 -0
- data/lib/ms/ident/pepxml/search_hit/modification_info.rb +79 -0
- data/lib/ms/ident/pepxml/search_hit.rb +144 -0
- data/lib/ms/ident/pepxml/search_result.rb +35 -0
- data/lib/ms/ident/pepxml/search_summary.rb +92 -0
- data/lib/ms/ident/pepxml/spectrum_query.rb +85 -0
- data/lib/ms/ident/pepxml.rb +112 -0
- data/lib/ms/ident/protein.rb +33 -0
- data/lib/ms/ident/protein_group.rb +80 -0
- data/lib/ms/ident/search.rb +114 -0
- data/lib/ms/ident.rb +37 -0
- data/lib/ms/isotope/aa.rb +59 -0
- data/lib/ms/mascot.rb +6 -0
- data/lib/ms/mass/aa.rb +79 -0
- data/lib/ms/mass.rb +55 -0
- data/lib/ms/mzml/index_list.rb +98 -0
- data/lib/ms/mzml/plms1.rb +34 -0
- data/lib/ms/mzml.rb +197 -0
- data/lib/ms/obo.rb +38 -0
- data/lib/ms/plms1.rb +156 -0
- data/lib/ms/quant/qspec/protein_group_comparison.rb +22 -0
- data/lib/ms/quant/qspec.rb +112 -0
- data/lib/ms/spectrum.rb +154 -8
- data/lib/ms.rb +3 -10
- data/lib/msplat.rb +2 -0
- data/lib/obo/ims.rb +5 -0
- data/lib/obo/ms.rb +7 -0
- data/lib/obo/ontology.rb +41 -0
- data/lib/obo/unit.rb +5 -0
- data/lib/openany.rb +23 -0
- data/lib/write_file_or_string.rb +18 -0
- data/obo/ims.obo +562 -0
- data/obo/ms.obo +11677 -0
- data/obo/unit.obo +2563 -0
- data/spec/ms/cvlist_spec.rb +60 -0
- data/spec/ms/digester_spec.rb +351 -0
- data/spec/ms/fasta_spec.rb +100 -0
- data/spec/ms/ident/peptide/db_spec.rb +108 -0
- data/spec/ms/ident/pepxml/sample_enzyme_spec.rb +181 -0
- data/spec/ms/ident/pepxml/search_hit/modification_info_spec.rb +37 -0
- data/spec/ms/ident/pepxml_spec.rb +442 -0
- data/spec/ms/ident/protein_group_spec.rb +68 -0
- data/spec/ms/mass_spec.rb +8 -0
- data/spec/ms/mzml/index_list_spec.rb +122 -0
- data/spec/ms/mzml/plms1_spec.rb +62 -0
- data/spec/ms/mzml_spec.rb +50 -0
- data/spec/ms/plms1_spec.rb +38 -0
- data/spec/ms/quant/qspec_spec.rb +25 -0
- data/spec/msplat_spec.rb +24 -0
- data/spec/obo_spec.rb +25 -0
- data/spec/spec_helper.rb +25 -0
- data/spec/testfiles/ms/ident/peptide/db/uni_11_sp_tr.fasta +69 -0
- data/spec/testfiles/ms/ident/peptide/db/uni_11_sp_tr.msd_clvg2.min_aaseq4.yml +728 -0
- data/spec/testfiles/ms/mzml/j24z.idx_comp.3.mzML +271 -0
- data/spec/testfiles/ms/mzml/openms.noidx_nocomp.12.mzML +330 -0
- data/spec/testfiles/ms/quant/kill_extra_tabs.rb +13 -0
- data/spec/testfiles/ms/quant/max_quant_output.provenance.txt +15 -0
- data/spec/testfiles/ms/quant/max_quant_output.txt +199 -0
- data/spec/testfiles/ms/quant/pdcd5_final.killedextratabs.tsv +199 -0
- data/spec/testfiles/ms/quant/pdcd5_final.killedextratabs.tsv_qspecgp +199 -0
- data/spec/testfiles/ms/quant/pdcd5_final.killedextratabs.tsv_qspecgp.csv +199 -0
- data/spec/testfiles/ms/quant/pdcd5_final.txt +199 -0
- data/spec/testfiles/ms/quant/pdcd5_final.txt_qspecgp +0 -0
- data/spec/testfiles/ms/quant/pdcd5_lfq_qspec.CSV.csv +199 -0
- data/spec/testfiles/ms/quant/pdcd5_lfq_qspec.csv +199 -0
- data/spec/testfiles/ms/quant/pdcd5_lfq_qspec.oneprot.csv +199 -0
- data/spec/testfiles/ms/quant/pdcd5_lfq_qspec.oneprot.tsv +199 -0
- data/spec/testfiles/ms/quant/pdcd5_lfq_qspec.oneprot.tsv_qspecgp +199 -0
- data/spec/testfiles/ms/quant/pdcd5_lfq_qspec.oneprot.tsv_qspecgp.csv +199 -0
- data/spec/testfiles/ms/quant/pdcd5_lfq_qspec.txt +199 -0
- data/spec/testfiles/ms/quant/pdcd5_lfq_tabdel.txt +134 -0
- data/spec/testfiles/ms/quant/pdcd5_lfq_tabdel.txt_qspecgp +134 -0
- data/spec/testfiles/ms/quant/remove_rest_of_proteins.rb +13 -0
- data/spec/testfiles/ms/quant/unlog_transform.rb +13 -0
- data/spec/testfiles/plms1/output.key +0 -0
- metadata +157 -40
- data/README +0 -77
- data/changelog.txt +0 -196
- data/lib/ms/calc.rb +0 -32
- data/lib/ms/data/interleaved.rb +0 -60
- data/lib/ms/data/lazy_io.rb +0 -73
- data/lib/ms/data/lazy_string.rb +0 -15
- data/lib/ms/data/simple.rb +0 -59
- data/lib/ms/data/transposed.rb +0 -41
- data/lib/ms/data.rb +0 -57
- data/lib/ms/format/format_error.rb +0 -12
- data/lib/ms/support/binary_search.rb +0 -126
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
require 'spec_helper'
|
|
2
|
+
|
|
3
|
+
require 'ms/ident/protein_group'
|
|
4
|
+
|
|
5
|
+
PeptideHit = Struct.new(:aaseq, :charge, :proteins) do
|
|
6
|
+
def inspect # easier to read output
|
|
7
|
+
"<PeptideHit aaseq=#{self.aaseq} charge=#{self.charge} proteins(ids)=#{self.proteins.map(&:id).join(',')}>"
|
|
8
|
+
end
|
|
9
|
+
def hash ; self.object_id end
|
|
10
|
+
end
|
|
11
|
+
ProteinHit = Struct.new(:id) do
|
|
12
|
+
def inspect # easier to read output
|
|
13
|
+
"<Prt #{self.id}>"
|
|
14
|
+
end
|
|
15
|
+
def hash ; self.object_id end
|
|
16
|
+
end
|
|
17
|
+
|
|
18
|
+
describe 'creating minimal protein groups from peptide hits' do
|
|
19
|
+
before do
|
|
20
|
+
@pep_hits = [ ['AABBCCDD', 2],
|
|
21
|
+
['BBCC', 2],
|
|
22
|
+
['DDEEFFGG', 2],
|
|
23
|
+
['DDEEFFGG', 3],
|
|
24
|
+
['HIYA', 2],
|
|
25
|
+
].map {|ar| PeptideHit.new(ar[0], ar[1], []) }
|
|
26
|
+
@prot_hits_hash = {
|
|
27
|
+
'big_guy' => @pep_hits,
|
|
28
|
+
'little_guy' => [@pep_hits.last],
|
|
29
|
+
'medium_guy1' => @pep_hits[0,4],
|
|
30
|
+
'medium_guy2' => @pep_hits[0,4],
|
|
31
|
+
'subsumed_by_medium' => @pep_hits[2,2],
|
|
32
|
+
}
|
|
33
|
+
@prot_hits = @prot_hits_hash.keys.map {|id| ProteinHit.new(id) }
|
|
34
|
+
end
|
|
35
|
+
|
|
36
|
+
it 'is a greedy algorithm' do
|
|
37
|
+
@prot_hits.each {|prthit| @prot_hits_hash[prthit.id].each {|pep| pep.proteins << prthit } }
|
|
38
|
+
# big_guy has all the peptides, so it takes them all
|
|
39
|
+
protein_groups = MS::Ident::ProteinGroup.peptide_hits_to_protein_groups(@pep_hits)
|
|
40
|
+
protein_groups.first.size.should == 1# the group
|
|
41
|
+
protein_groups.first.first.id.should == 'big_guy'
|
|
42
|
+
end
|
|
43
|
+
|
|
44
|
+
it 'removes proteins accounted for only as little pieces of larger proteins' do
|
|
45
|
+
@prot_hits[1..-1].each {|prthit| @prot_hits_hash[prthit.id].each {|pep| pep.proteins << prthit } }
|
|
46
|
+
protein_groups = MS::Ident::ProteinGroup.peptide_hits_to_protein_groups(@pep_hits)
|
|
47
|
+
# no subsumed_by_medium
|
|
48
|
+
protein_groups.any? {|prot_group| prot_group.any? {|v| v.id == 'subsumed_by_medium' }}.should == false
|
|
49
|
+
end
|
|
50
|
+
|
|
51
|
+
it 'allows alternate sorting algorithms for greediness' do
|
|
52
|
+
@prot_hits.each {|prthit| @prot_hits_hash[prthit.id].each {|pep| pep.proteins << prthit } }
|
|
53
|
+
prot_groups = MS::Ident::ProteinGroup.peptide_hits_to_protein_groups(@pep_hits) do |prot_and_peptide_hits|
|
|
54
|
+
# deliberate using a counterintuitive sorting method to give little guys
|
|
55
|
+
# a chance
|
|
56
|
+
-prot_and_peptide_hits.last.size
|
|
57
|
+
end
|
|
58
|
+
# because the little proteins are given priority, they 'survive'. Bigger
|
|
59
|
+
# proteins may also survive if they have at least one unique peptide
|
|
60
|
+
# to add to the mix. This demonstrates how proteins can be weighted in
|
|
61
|
+
# different ways based on their peptide hits.
|
|
62
|
+
seen = []
|
|
63
|
+
prot_groups.each {|pg| pg.each {|prot| seen << prot.id } }
|
|
64
|
+
# big guy is completely accounted for in the now prioritized little guy
|
|
65
|
+
# and medium guys, etc.
|
|
66
|
+
seen.sort.should == @prot_hits_hash.keys[1..-1].sort
|
|
67
|
+
end
|
|
68
|
+
end
|
|
@@ -0,0 +1,122 @@
|
|
|
1
|
+
require 'spec_helper'
|
|
2
|
+
|
|
3
|
+
require 'ms/mzml'
|
|
4
|
+
require 'ms/mzml/index_list'
|
|
5
|
+
|
|
6
|
+
describe 'non-indexed uncompressed peaks, mzML file' do
|
|
7
|
+
subject { TESTFILES + "/ms/mzml/openms.noidx_nocomp.12.mzML" }
|
|
8
|
+
|
|
9
|
+
describe 'MS::Mzml getting the IndexList' do
|
|
10
|
+
before do
|
|
11
|
+
@io = File.open(subject)
|
|
12
|
+
end
|
|
13
|
+
after do
|
|
14
|
+
@io.close
|
|
15
|
+
end
|
|
16
|
+
|
|
17
|
+
it 'works for an un-indexed file' do
|
|
18
|
+
mzml = MS::Mzml.new(@io)
|
|
19
|
+
index_list = mzml.index_list
|
|
20
|
+
spectrum_idx = index_list[:spectrum]
|
|
21
|
+
spectrum_idx.name.should == :spectrum
|
|
22
|
+
spectrum_idx.should == [5755, 6616, 9244, 10077, 12706, 13539, 16168, 17001, 19630, 20463, 23092, 23926]
|
|
23
|
+
spectrum_idx.ids.should == [
|
|
24
|
+
"scan=10929", "scan=10930", "scan=10931",
|
|
25
|
+
"scan=10932", "scan=10933", "scan=10934",
|
|
26
|
+
"scan=10935", "scan=10936", "scan=10937",
|
|
27
|
+
"scan=10938", "scan=10939", "scan=10940"
|
|
28
|
+
]
|
|
29
|
+
# right now, the behavior is to expect a chromatogram index, even if
|
|
30
|
+
# there are no chromatograms... is that the right behavior???
|
|
31
|
+
chromatogram_idx = index_list[:chromatogram]
|
|
32
|
+
chromatogram_idx.name.should == :chromatogram
|
|
33
|
+
chromatogram_idx.should == []
|
|
34
|
+
chromatogram_idx.ids.should == []
|
|
35
|
+
end
|
|
36
|
+
end
|
|
37
|
+
end
|
|
38
|
+
|
|
39
|
+
|
|
40
|
+
describe 'indexed, compressed peaks, mzML file' do
|
|
41
|
+
subject { TESTFILES + "/ms/mzml/j24z.idx_comp.3.mzML" }
|
|
42
|
+
|
|
43
|
+
|
|
44
|
+
describe 'MS::Mzml getting the IndexList' do
|
|
45
|
+
before do
|
|
46
|
+
@io = File.open(subject)
|
|
47
|
+
end
|
|
48
|
+
after do
|
|
49
|
+
@io.close
|
|
50
|
+
end
|
|
51
|
+
|
|
52
|
+
correct_index_list = lambda do |index_list|
|
|
53
|
+
spectrum_idx = index_list[:spectrum]
|
|
54
|
+
spectrum_idx.name.should == :spectrum
|
|
55
|
+
spectrum_idx.should == [4398, 219667, 227895]
|
|
56
|
+
spectrum_idx.ids.should == [
|
|
57
|
+
"controllerType=0 controllerNumber=1 scan=1",
|
|
58
|
+
"controllerType=0 controllerNumber=1 scan=2",
|
|
59
|
+
"controllerType=0 controllerNumber=1 scan=3"
|
|
60
|
+
]
|
|
61
|
+
chromatogram_idx = index_list[:chromatogram]
|
|
62
|
+
chromatogram_idx.name.should == :chromatogram
|
|
63
|
+
chromatogram_idx.should == [239184]
|
|
64
|
+
chromatogram_idx.ids.should == ["TIC"]
|
|
65
|
+
end
|
|
66
|
+
|
|
67
|
+
it 'works for an indexed file' do
|
|
68
|
+
mzml = MS::Mzml.new(@io)
|
|
69
|
+
index_list = mzml.index_list
|
|
70
|
+
correct_index_list.call(index_list)
|
|
71
|
+
end
|
|
72
|
+
|
|
73
|
+
it 'can create the index manually, if requested' do
|
|
74
|
+
mzml = MS::Mzml.new(@io)
|
|
75
|
+
index_list = mzml.create_index_list
|
|
76
|
+
correct_index_list.call(index_list)
|
|
77
|
+
end
|
|
78
|
+
|
|
79
|
+
describe 'an MS::Mzxml::IndexList' do
|
|
80
|
+
before do
|
|
81
|
+
@inner_io = File.open(subject)
|
|
82
|
+
mzml = MS::Mzml.new(@inner_io)
|
|
83
|
+
@index_list = mzml.index_list
|
|
84
|
+
end
|
|
85
|
+
after do
|
|
86
|
+
@inner_io.close
|
|
87
|
+
end
|
|
88
|
+
it 'can access indices like an array' do
|
|
89
|
+
@index_list[0].should_not be_nil
|
|
90
|
+
@index_list[1].should_not be_nil
|
|
91
|
+
@index_list.map(&:name).should == [:spectrum, :chromatogram]
|
|
92
|
+
end
|
|
93
|
+
it 'can access indices like a hash' do
|
|
94
|
+
@index_list[:spectrum].should_not be_nil
|
|
95
|
+
@index_list[:chromatogram].should_not be_nil
|
|
96
|
+
end
|
|
97
|
+
end
|
|
98
|
+
|
|
99
|
+
describe 'an MS::Mzxml::Index' do
|
|
100
|
+
before do
|
|
101
|
+
@inner_io = File.open(subject)
|
|
102
|
+
mzml = MS::Mzml.new(@inner_io)
|
|
103
|
+
@spec_index = mzml.index_list[:spectrum]
|
|
104
|
+
end
|
|
105
|
+
after do
|
|
106
|
+
@inner_io.close
|
|
107
|
+
end
|
|
108
|
+
it 'can create a scan to index hash' do
|
|
109
|
+
@spec_index.create_scan_to_index.should == {1=>0, 2=>1, 3=>2}
|
|
110
|
+
end
|
|
111
|
+
it 'returns nil if there are no scans defined in the id (scan=XX)' do
|
|
112
|
+
@spec_index.ids.map! { "no scan here" }
|
|
113
|
+
@spec_index.create_scan_to_index.should be_nil
|
|
114
|
+
end
|
|
115
|
+
it 'returns false if there are non-unique scan numbers' do
|
|
116
|
+
@spec_index.ids.map! { "scan=1" }
|
|
117
|
+
@spec_index.create_scan_to_index.should == false
|
|
118
|
+
end
|
|
119
|
+
end
|
|
120
|
+
end
|
|
121
|
+
end
|
|
122
|
+
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
require 'spec_helper'
|
|
2
|
+
|
|
3
|
+
require 'ms/mzml'
|
|
4
|
+
require 'ms/mzml/plms1'
|
|
5
|
+
|
|
6
|
+
describe 'converting mzml to plms1' do
|
|
7
|
+
describe 'converting no spectra mzml' do
|
|
8
|
+
before do
|
|
9
|
+
@mzml_file = File.open( TESTFILES + "/ms/mzml/openms.noidx_nocomp.12.mzML" )
|
|
10
|
+
@mzml = MS::Mzml.new(@mzml_file)
|
|
11
|
+
end
|
|
12
|
+
|
|
13
|
+
after do
|
|
14
|
+
@mzml_file.close
|
|
15
|
+
end
|
|
16
|
+
|
|
17
|
+
it 'can be converted into a plms1 object' do
|
|
18
|
+
scan_nums = (10929..10940).to_a
|
|
19
|
+
times =[6604.58, 6605.5, 6605.91, 6606.48, 6606.98, 6607.53, 6607.93, 6608.49, 6608.92, 6609.49, 6609.94, 6610.53]
|
|
20
|
+
plms1 = @mzml.to_plms1
|
|
21
|
+
plms1.spectra.respond_to?(:each).should be_true
|
|
22
|
+
plms1.times.should == times
|
|
23
|
+
plms1.scan_numbers.should == scan_nums
|
|
24
|
+
plms1.spectra.each do |spec|
|
|
25
|
+
p spec.size
|
|
26
|
+
p spec.class
|
|
27
|
+
p spec.mzs
|
|
28
|
+
p spec.intensities
|
|
29
|
+
end
|
|
30
|
+
plms1.write("tmp.tmp.bin")
|
|
31
|
+
end
|
|
32
|
+
|
|
33
|
+
end
|
|
34
|
+
|
|
35
|
+
describe 'converting normal mzml' do
|
|
36
|
+
before do
|
|
37
|
+
@mzml_file = File.open( TESTFILES + "/ms/mzml/j24z.idx_comp.3.mzML" )
|
|
38
|
+
@mzml = MS::Mzml.new(@mzml_file)
|
|
39
|
+
end
|
|
40
|
+
|
|
41
|
+
after do
|
|
42
|
+
@mzml_file.close
|
|
43
|
+
end
|
|
44
|
+
|
|
45
|
+
it 'can be converted into a plms1 object' do
|
|
46
|
+
#scan_nums = ###
|
|
47
|
+
#times =[6604.58, 6605.5, 6605.91, 6606.48, 6606.98, 6607.53, 6607.93, 6608.49, 6608.92, 6609.49, 6609.94, 6610.53]
|
|
48
|
+
plms1 = @mzml.to_plms1
|
|
49
|
+
plms1.spectra.respond_to?(:each).should be_true
|
|
50
|
+
p plms1.times
|
|
51
|
+
p plms1.scan_numbers
|
|
52
|
+
plms1.spectra.each do |spec|
|
|
53
|
+
p spec.size
|
|
54
|
+
p spec.class
|
|
55
|
+
p spec.mzs.size
|
|
56
|
+
p spec.intensities.size
|
|
57
|
+
end
|
|
58
|
+
#plms1.write("tmp.tmp.bin")
|
|
59
|
+
end
|
|
60
|
+
|
|
61
|
+
end
|
|
62
|
+
end
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
require 'spec_helper'
|
|
2
|
+
|
|
3
|
+
require 'ms/mzml'
|
|
4
|
+
|
|
5
|
+
describe 'indexed, compressed peaks, mzML file' do
|
|
6
|
+
|
|
7
|
+
describe MS::Mzml do
|
|
8
|
+
|
|
9
|
+
describe 'reading a spectrum' do
|
|
10
|
+
|
|
11
|
+
before do
|
|
12
|
+
@file = TESTFILES + "/ms/mzml/j24z.idx_comp.3.mzML"
|
|
13
|
+
@io = File.open(@file)
|
|
14
|
+
@mzml = MS::Mzml.new(@io)
|
|
15
|
+
end
|
|
16
|
+
after do
|
|
17
|
+
@io.close
|
|
18
|
+
end
|
|
19
|
+
|
|
20
|
+
it '#spectrum (or #[]) returns a spectrum when queried by index (Integer)' do
|
|
21
|
+
spectrum = @mzml.spectrum(1) # getting the second spectrum
|
|
22
|
+
spectrum1 = @mzml[1]
|
|
23
|
+
spectrum.should == spectrum1
|
|
24
|
+
spectrum.should be_a(MS::Spectrum)
|
|
25
|
+
spectrum.should respond_to(:mzs)
|
|
26
|
+
spectrum.should respond_to(:intensities)
|
|
27
|
+
spectrum.mzs.size.should == 315
|
|
28
|
+
spectrum.intensities.size.should == 315
|
|
29
|
+
spectrum.mzs[2].should be_within(1e-10).of(164.32693481445312)
|
|
30
|
+
end
|
|
31
|
+
|
|
32
|
+
it '#spectrum (or #[]) returns a spectrum when queried by id (String)' do
|
|
33
|
+
spectrum = @mzml.spectrum("controllerType=0 controllerNumber=1 scan=2")
|
|
34
|
+
spectrum1 = @mzml["controllerType=0 controllerNumber=1 scan=2"]
|
|
35
|
+
spectrum.should == spectrum1
|
|
36
|
+
spectrum.should be_a(MS::Spectrum)
|
|
37
|
+
end
|
|
38
|
+
|
|
39
|
+
it 'goes through spectrum with #each or #each_spectrum' do
|
|
40
|
+
mz_sizes = [20168, 315, 634]
|
|
41
|
+
@mzml.each do |spec|
|
|
42
|
+
spec.mzs.size.should == mz_sizes.shift
|
|
43
|
+
end
|
|
44
|
+
end
|
|
45
|
+
|
|
46
|
+
end
|
|
47
|
+
end
|
|
48
|
+
end
|
|
49
|
+
|
|
50
|
+
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
require 'spec_helper'
|
|
2
|
+
|
|
3
|
+
require 'ms/plms1'
|
|
4
|
+
require 'ms/spectrum'
|
|
5
|
+
|
|
6
|
+
describe 'plms1 - Prince Lab MS 1 specification' do
|
|
7
|
+
before do
|
|
8
|
+
@keyfile = TESTFILES + "/plms1/output.key"
|
|
9
|
+
times = [0.55, 0.9]
|
|
10
|
+
scan_numbers = [1,2]
|
|
11
|
+
spectra = [
|
|
12
|
+
MS::Spectrum.new([[300.0, 301.5, 303.1], [10, 20, 35.5]]),
|
|
13
|
+
MS::Spectrum.new([[300.5, 302, 303.6], [11, 21, 36.5]])
|
|
14
|
+
]
|
|
15
|
+
@plms1_obj = MS::Plms1.new(scan_numbers, times, spectra)
|
|
16
|
+
@outfile = @keyfile.sub(/\.key$/, ".tmp")
|
|
17
|
+
end
|
|
18
|
+
|
|
19
|
+
it 'has a detailed specification' do
|
|
20
|
+
specification = MS::Plms1::SPECIFICATION
|
|
21
|
+
specification.should be_an_instance_of String
|
|
22
|
+
(specification.size > 50).should == true
|
|
23
|
+
end
|
|
24
|
+
|
|
25
|
+
it 'writes a plms1 file' do
|
|
26
|
+
@plms1_obj.write(@outfile)
|
|
27
|
+
File.exist?(@outfile).should == true
|
|
28
|
+
IO.read(@outfile, :mode => 'rb').should == IO.read(@keyfile, :mode => 'rb')
|
|
29
|
+
File.unlink(@outfile) if File.exist?(@outfile)
|
|
30
|
+
end
|
|
31
|
+
|
|
32
|
+
it 'reads a plms1 file' do
|
|
33
|
+
obj = MS::Plms1.new.read(@keyfile)
|
|
34
|
+
[:scan_numbers, :times, :spectra].each do |val|
|
|
35
|
+
obj.send(val).should == @plms1_obj.send(val)
|
|
36
|
+
end
|
|
37
|
+
end
|
|
38
|
+
end
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
require 'spec_helper'
|
|
2
|
+
|
|
3
|
+
require 'ms/quant/qspec'
|
|
4
|
+
require 'csv'
|
|
5
|
+
|
|
6
|
+
describe 'running qspec' do
|
|
7
|
+
before do
|
|
8
|
+
@file = TESTFILES + '/ms/quant/max_quant_output.txt'
|
|
9
|
+
rows = IO.readlines(@file).map {|line| line.chomp.split("\t") }
|
|
10
|
+
p rows.map(&:size)
|
|
11
|
+
abort 'here'
|
|
12
|
+
#columns = IO.readlines(@file).map {|line| line.split("\t") }.transpose
|
|
13
|
+
headers = columns.map(&:first)
|
|
14
|
+
p headers
|
|
15
|
+
end
|
|
16
|
+
|
|
17
|
+
describe 'on spectral count data' do
|
|
18
|
+
it 'works' do
|
|
19
|
+
1.should == 1
|
|
20
|
+
end
|
|
21
|
+
end
|
|
22
|
+
|
|
23
|
+
describe 'on MaxQuant LFQ data' do
|
|
24
|
+
end
|
|
25
|
+
end
|
data/spec/msplat_spec.rb
ADDED
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
require 'spec_helper'
|
|
2
|
+
|
|
3
|
+
require 'msplat'
|
|
4
|
+
|
|
5
|
+
class String
|
|
6
|
+
def const
|
|
7
|
+
self.split('::').inject(Kernel) {|scope, const_name| scope.const_get(const_name)}
|
|
8
|
+
end
|
|
9
|
+
end
|
|
10
|
+
|
|
11
|
+
describe "msplat" do
|
|
12
|
+
it "requires major classes/modules" do
|
|
13
|
+
%w(
|
|
14
|
+
MS::Mass
|
|
15
|
+
MS::Mass::AA
|
|
16
|
+
).each do |str|
|
|
17
|
+
expect { str.const }.to be_true
|
|
18
|
+
end
|
|
19
|
+
# for sanity's sake
|
|
20
|
+
%w(MS::DoesntExit).each do |str|
|
|
21
|
+
expect { str.const }.to raise_error(NameError)
|
|
22
|
+
end
|
|
23
|
+
end
|
|
24
|
+
end
|
data/spec/obo_spec.rb
ADDED
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
require 'spec_helper'
|
|
2
|
+
|
|
3
|
+
require 'obo/ms'
|
|
4
|
+
require 'obo/ims'
|
|
5
|
+
require 'obo/unit'
|
|
6
|
+
|
|
7
|
+
describe 'accessing a specific Obo::Ontology' do
|
|
8
|
+
it 'can access MS obo' do
|
|
9
|
+
Obo::MS.id_to_name['MS:1000004'].should == 'sample mass'
|
|
10
|
+
Obo::MS.name_to_id['sample mass'].should == 'MS:1000004'
|
|
11
|
+
Obo::MS.id_to_element['MS:1000004'].should be_a(Obo::Stanza)
|
|
12
|
+
end
|
|
13
|
+
|
|
14
|
+
it 'can access IMS obo' do
|
|
15
|
+
Obo::IMS.id_to_name['IMS:1000004'].should == 'image'
|
|
16
|
+
Obo::IMS.name_to_id['image'].should == 'IMS:1000004'
|
|
17
|
+
Obo::IMS.id_to_element['IMS:1000004'].should be_a(Obo::Stanza)
|
|
18
|
+
end
|
|
19
|
+
|
|
20
|
+
it 'can access Unit obo' do
|
|
21
|
+
Obo::Unit.id_to_name['UO:0000005'].should == 'temperature unit'
|
|
22
|
+
Obo::Unit.name_to_id['temperature unit'].should == 'UO:0000005'
|
|
23
|
+
Obo::Unit.id_to_element['UO:0000005'].should be_a(Obo::Stanza)
|
|
24
|
+
end
|
|
25
|
+
end
|
data/spec/spec_helper.rb
ADDED
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
$LOAD_PATH.unshift(File.join(File.dirname(__FILE__), '..', 'lib'))
|
|
2
|
+
$LOAD_PATH.unshift(File.dirname(__FILE__))
|
|
3
|
+
|
|
4
|
+
require 'rubygems'
|
|
5
|
+
require 'rspec'
|
|
6
|
+
|
|
7
|
+
TESTFILES = File.dirname(__FILE__) + '/testfiles'
|
|
8
|
+
|
|
9
|
+
# Requires supporting files with custom matchers and macros, etc,
|
|
10
|
+
# in ./support/ and its subdirectories.
|
|
11
|
+
Dir["#{File.dirname(__FILE__)}/support/**/*.rb"].each {|f| require f}
|
|
12
|
+
|
|
13
|
+
RSpec.configure do |config|
|
|
14
|
+
config.color_enabled = true
|
|
15
|
+
config.tty = true
|
|
16
|
+
#config.formatter = :documentation # :progress, :html, :textmate
|
|
17
|
+
config.formatter = :progress # :progress, :html, :textmate
|
|
18
|
+
end
|
|
19
|
+
|
|
20
|
+
|
|
21
|
+
def benchmark(*args, &block)
|
|
22
|
+
if ENV['BENCHMARK']
|
|
23
|
+
Benchmark.bmbm(*args, &block)
|
|
24
|
+
end
|
|
25
|
+
end
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
>sp|P31946|1433B_HUMAN 14-3-3 protein beta/alpha OS=Homo sapiens GN=YWHAB PE=1 SV=3
|
|
2
|
+
MTMDKSELVQKAKLAEQAERYDDMAAAMKAVTEQGHELSNEERNLLSVAYKNVVGARRSS
|
|
3
|
+
WRVISSIEQKTERNEKKQQMGKEYREKIEAELQDICNDVLELLDKYLIPNATQPESKVFY
|
|
4
|
+
LKMKGDYFRYLSEVASGDNKQTTVSNSQQAYQEAFEISKKEMQPTHPIRLGLALNFSVFY
|
|
5
|
+
YEILNSPEKACSLAKTAFDEAIAELDTLNEESYKDSTLIMQLLRDNLTLWTSENQGDEGD
|
|
6
|
+
AGEGEN
|
|
7
|
+
>sp|P31946-2|1433B_HUMAN Isoform Short of 14-3-3 protein beta/alpha OS=Homo sapiens GN=YWHAB
|
|
8
|
+
MDKSELVQKAKLAEQAERYDDMAAAMKAVTEQGHELSNEERNLLSVAYKNVVGARRSSWR
|
|
9
|
+
VISSIEQKTERNEKKQQMGKEYREKIEAELQDICNDVLELLDKYLIPNATQPESKVFYLK
|
|
10
|
+
MKGDYFRYLSEVASGDNKQTTVSNSQQAYQEAFEISKKEMQPTHPIRLGLALNFSVFYYE
|
|
11
|
+
ILNSPEKACSLAKTAFDEAIAELDTLNEESYKDSTLIMQLLRDNLTLWTSENQGDEGDAG
|
|
12
|
+
EGEN
|
|
13
|
+
>sp|P62258|1433E_HUMAN 14-3-3 protein epsilon OS=Homo sapiens GN=YWHAE PE=1 SV=1
|
|
14
|
+
MDDREDLVYQAKLAEQAERYDEMVESMKKVAGMDVELTVEERNLLSVAYKNVIGARRASW
|
|
15
|
+
RIISSIEQKEENKGGEDKLKMIREYRQMVETELKLICCDILDVLDKHLIPAANTGESKVF
|
|
16
|
+
YYKMKGDYHRYLAEFATGNDRKEAAENSLVAYKAASDIAMTELPPTHPIRLGLALNFSVF
|
|
17
|
+
YYEILNSPDRACRLAKAAFDDAIAELDTLSEESYKDSTLIMQLLRDNLTLWTSDMQGDGE
|
|
18
|
+
EQNKEALQDVEDENQ
|
|
19
|
+
>sp|Q04917|1433F_HUMAN 14-3-3 protein eta OS=Homo sapiens GN=YWHAH PE=1 SV=4
|
|
20
|
+
MGDREQLLQRARLAEQAERYDDMASAMKAVTELNEPLSNEDRNLLSVAYKNVVGARRSSW
|
|
21
|
+
RVISSIEQKTMADGNEKKLEKVKAYREKIEKELETVCNDVLSLLDKFLIKNCNDFQYESK
|
|
22
|
+
VFYLKMKGDYYRYLAEVASGEKKNSVVEASEAAYKEAFEISKEQMQPTHPIRLGLALNFS
|
|
23
|
+
VFYYEIQNAPEQACLLAKQAFDDAIAELDTLNEDSYKDSTLIMQLLRDNLTLWTSDQQDE
|
|
24
|
+
EAGEGN
|
|
25
|
+
>sp|P61981|1433G_HUMAN 14-3-3 protein gamma OS=Homo sapiens GN=YWHAG PE=1 SV=2
|
|
26
|
+
MVDREQLVQKARLAEQAERYDDMAAAMKNVTELNEPLSNEERNLLSVAYKNVVGARRSSW
|
|
27
|
+
RVISSIEQKTSADGNEKKIEMVRAYREKIEKELEAVCQDVLSLLDNYLIKNCSETQYESK
|
|
28
|
+
VFYLKMKGDYYRYLAEVATGEKRATVVESSEKAYSEAHEISKEHMQPTHPIRLGLALNYS
|
|
29
|
+
VFYYEIQNAPEQACHLAKTAFDDAIAELDTLNEDSYKDSTLIMQLLRDNLTLWTSDQQDD
|
|
30
|
+
DGGEGNN
|
|
31
|
+
>sp|P31947|1433S_HUMAN 14-3-3 protein sigma OS=Homo sapiens GN=SFN PE=1 SV=1
|
|
32
|
+
MERASLIQKAKLAEQAERYEDMAAFMKGAVEKGEELSCEERNLLSVAYKNVVGGQRAAWR
|
|
33
|
+
VLSSIEQKSNEEGSEEKGPEVREYREKVETELQGVCDTVLGLLDSHLIKEAGDAESRVFY
|
|
34
|
+
LKMKGDYYRYLAEVATGDDKKRIIDSARSAYQEAMDISKKEMPPTNPIRLGLALNFSVFH
|
|
35
|
+
YEIANSPEEAISLAKTTFDEAMADLHTLSEDSYKDSTLIMQLLRDNLTLWTADNAGEEGG
|
|
36
|
+
EAPQEPQS
|
|
37
|
+
>tr|D2KLI3|D2KLI3_HUMAN Cytochrome b OS=Homo sapiens GN=CYTB PE=3 SV=1
|
|
38
|
+
MTPTRKTNPLMKLINHSFIDLPTPSNISAWWNFGSLLGACLILQITTGLFLAMHYSPDAS
|
|
39
|
+
TAFSSIAHITRDVNYGWIIRYLHANGASMFFICLFLHIGRGLYYGSFLYSETWNIGIILL
|
|
40
|
+
LATMATAFMGYVLPWGQMSFWGATVITNLLSAIPYIGTDLVQWIWGGYSVDSPTLTRFFT
|
|
41
|
+
FHFILPFIIAALAALHLLFLHETGSNNPLGITSHSDKITFHPYYTIKDALGLLLFLLSLM
|
|
42
|
+
TLTLFSPDLLGDPDNYTLANPLNTPPHIKPEWYFLFAYTILRSVPNKLGGVLALLLSILI
|
|
43
|
+
LAMIPILHMSKQQSMMFRPLSQSLYWLLAADLLILTWIGGQPVSYPFTIIGQVASVLYFT
|
|
44
|
+
TILILMPTISLIENKMLKWA
|
|
45
|
+
>tr|D2KTA8|D2KTA8_HUMAN Putative uncharacterized protein FCAMR OS=Homo sapiens GN=FCAMR PE=4 SV=1
|
|
46
|
+
MDGEATVKPGEQVPLWTHGWPPDDPSPSFAAGSSFALPQKRPHPRWLWEGSLPSRTHLRA
|
|
47
|
+
MGTLRPSSPLCWREESSFAAPNSLKGSRLVSGEPGGAVTIQCHYAPSSVNRHQRKYWCRL
|
|
48
|
+
GPPRWICQTIVSTNQYTHHRYRDRVALTDFPQRGLFVVRLSQLSPDDIGCYLCGIGSENN
|
|
49
|
+
MLFLSMNLTISAGPASTLPTATPAAGELTMRSYGTASPVANRWTPGTTQTLGQGTAWDTV
|
|
50
|
+
ASTPGTSKTTASAEGRRTPGATRPAAPGTGSWAEGSVKAPAPIPESPPSKSRSMSNTTEG
|
|
51
|
+
VWEGTRSSVTNRARASKDRREMTTTKADRPREDIEGVRIALDAAKKVLGTIGPPALVSET
|
|
52
|
+
LAWEILPQATPVSKQQSQGSIGETTPAAGMWTLGTPAADVWILGTPAADVWTSMEAASGE
|
|
53
|
+
GSAAGDLDAATGDRGPQATLSQTPAVGPWGPPGKESSVKRTFPEDESSSRTLAPVSTMLA
|
|
54
|
+
LFMLMALVLLQRKLWRRRTSQEAERVTLIQMTHFLEVNPQADQLPHVERKMLQDDSLPAG
|
|
55
|
+
ASLTAPERNPGP
|
|
56
|
+
>tr|D2KTA9|D2KTA9_HUMAN Putative uncharacterized protein XKR5 OS=Homo sapiens GN=XKR5 PE=4 SV=1
|
|
57
|
+
MHARLLGLSALLQAAEQSARLYTVAYYFTTGRLLWGWLALAVLLPGFLVQALSYLWFRAD
|
|
58
|
+
GHPGHCSLMMLHLLQLGVWKRHWDAALTSLQKELEAPHRGWLQLQEADLSALRLLEALLQ
|
|
59
|
+
TGPHLLLQTYVFLASDFTDIVPGVSTLFSWSSLSWALVSYTRFMGFMKPGHLAMPWAALF
|
|
60
|
+
CQQLWRMGMLGTRVLSLVLFYKAYHFWVFVVAGAHWLVMTFWLVAQQSDIIDSTCHWRLF
|
|
61
|
+
NLLVGAVYILCYLSFWDSPSRNRMVTFYMVMLLENIILLLLATDFLQGASVDQPADHSWG
|
|
62
|
+
PVWISDWQCLTGNLLQPAASKIHRHLAGLPKEVLWHCRR
|
|
63
|
+
>tr|D3DSH8|D3DSH8_HUMAN HCG2036819, isoform CRA_a OS=Homo sapiens GN=hCG_2036819 PE=4 SV=1
|
|
64
|
+
MLGWIQPSRQPQLRAAPPTRTPSAKRCILCNFLPGCWLVGDVAGSRQPSAPQTLRQRQHT
|
|
65
|
+
RPPPQERGSGRRSPLREARRANPHFKSFPVLEARGLPCGARRTGPRRPVREMTLPSDPER
|
|
66
|
+
ATLPNPRLGAPAVPRRGPRSHGGRR
|
|
67
|
+
>tr|D3DX18|D3DX18_HUMAN Putative uncharacterized protein LOC128977 OS=Homo sapiens GN=LOC128977 PE=4 SV=1
|
|
68
|
+
MADGSGWQPPRPCEAYRAEWKLCRSARHFLHHYYVHGERPACEQWQRDLASCRDWEERRN
|
|
69
|
+
AEAQQSLCESERARVRAARKHILVWAPRQSPPPDWHLPLPQEKDE
|