mspire 0.3.1 → 0.3.9

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.
Files changed (62) hide show
  1. data/Rakefile +2 -2
  2. data/bin/bioworks_to_pepxml.rb +15 -3
  3. data/bin/ms_to_lmat.rb +2 -1
  4. data/bin/sqt_group.rb +26 -0
  5. data/changelog.txt +36 -0
  6. data/lib/ms/msrun.rb +3 -1
  7. data/lib/ms/parser/mzdata/dom.rb +14 -14
  8. data/lib/ms/scan.rb +3 -3
  9. data/lib/mspire.rb +1 -1
  10. data/lib/sample_enzyme.rb +39 -0
  11. data/lib/spec_id.rb +18 -0
  12. data/lib/spec_id/aa_freqs.rb +6 -9
  13. data/lib/spec_id/digestor.rb +16 -17
  14. data/lib/spec_id/mass.rb +63 -1
  15. data/lib/spec_id/parser/proph.rb +101 -2
  16. data/lib/spec_id/precision/filter.rb +3 -2
  17. data/lib/spec_id/precision/filter/cmdline.rb +3 -1
  18. data/lib/spec_id/precision/filter/output.rb +1 -0
  19. data/lib/spec_id/precision/prob.rb +88 -21
  20. data/lib/spec_id/precision/prob/cmdline.rb +28 -16
  21. data/lib/spec_id/precision/prob/output.rb +8 -2
  22. data/lib/spec_id/proph/pep_summary.rb +25 -12
  23. data/lib/spec_id/sequest.rb +28 -0
  24. data/lib/spec_id/sequest/pepxml.rb +142 -197
  25. data/lib/spec_id/sqt.rb +349 -0
  26. data/lib/spec_id/srf.rb +33 -23
  27. data/lib/validator.rb +40 -57
  28. data/lib/validator/aa.rb +3 -90
  29. data/lib/validator/aa_est.rb +112 -0
  30. data/lib/validator/cmdline.rb +163 -31
  31. data/lib/validator/decoy.rb +15 -7
  32. data/lib/validator/digestion_based.rb +5 -4
  33. data/lib/validator/q_value.rb +32 -0
  34. data/script/peps_per_bin.rb +67 -0
  35. data/script/sqt_to_meta.rb +24 -0
  36. data/specs/bin/bioworks_to_pepxml_spec.rb +3 -3
  37. data/specs/bin/fasta_shaker_spec.rb +2 -2
  38. data/specs/bin/filter_and_validate__multiple_vals_helper.yaml +7 -10
  39. data/specs/bin/filter_and_validate_spec.rb +25 -6
  40. data/specs/bin/ms_to_lmat_spec.rb +2 -2
  41. data/specs/bin/prob_validate_spec.rb +5 -3
  42. data/specs/sample_enzyme_spec.rb +86 -1
  43. data/specs/spec_helper.rb +11 -9
  44. data/specs/spec_id/bioworks_spec.rb +2 -1
  45. data/specs/spec_id/precision/filter_spec.rb +5 -5
  46. data/specs/spec_id/precision/prob_spec.rb +0 -67
  47. data/specs/spec_id/proph/pep_summary_spec.rb +42 -87
  48. data/specs/spec_id/protein_summary_spec.rb +4 -4
  49. data/specs/spec_id/sequest/pepxml_spec.rb +1 -79
  50. data/specs/spec_id/sequest_spec.rb +38 -0
  51. data/specs/spec_id/sqt_spec.rb +111 -3
  52. data/specs/spec_id_spec.rb +2 -0
  53. data/specs/transmem/phobius_spec.rb +3 -1
  54. data/specs/transmem/toppred_spec.rb +1 -1
  55. data/specs/validator/aa_est_spec.rb +66 -0
  56. data/specs/validator/aa_spec.rb +1 -68
  57. data/specs/validator/background_spec.rb +2 -0
  58. data/specs/validator/bias_spec.rb +3 -27
  59. data/specs/validator/decoy_spec.rb +2 -2
  60. data/specs/validator/transmem_spec.rb +2 -1
  61. data/test_files/small.sqt +87 -0
  62. metadata +312 -293
data/specs/spec_helper.rb CHANGED
@@ -3,12 +3,14 @@ gem 'rspec'
3
3
 
4
4
  # a global flag that lets me know what format we're dealing with for output
5
5
  $specdoc = false
6
- ObjectSpace.each_object do |obj|
7
- case obj
8
- when Spec::Runner::Formatter::SpecdocFormatter
9
- $specdoc = true
10
- end
11
- end
6
+ ## something changed between version 1.0.6?? and 1.1.1 in rspec so that
7
+ #Spec::Runner is no longer an object being created...
8
+ #ObjectSpace.each_object do |obj|
9
+ # case obj
10
+ # when Spec::Runner::Formatter::SpecdocFormatter
11
+ # $specdoc = true
12
+ # end
13
+ #end
12
14
 
13
15
  # Set up some global testing variables:
14
16
  #silent {
@@ -109,9 +111,9 @@ require SPEC_DIR + '/load_bin_path'
109
111
  class String
110
112
  #alias_method :exist?, exist_as_a_file?
111
113
  #alias_method exist_as_a_file?, exist?
112
- def exist?
113
- File.exist? self
114
- end
114
+ #def exist?
115
+ # File.exist? self
116
+ #end
115
117
  def exist_as_a_file?
116
118
  File.exist? self
117
119
  end
@@ -37,7 +37,8 @@ describe Bioworks, 'set from an xml file' do
37
37
  tmpfile = Tfiles + "/tf_bioworks_to_excel.tmp"
38
38
  bio = Bioworks.new(tf_bioworks_to_excel)
39
39
  bio.to_excel(tmpfile)
40
- File.should exist(tmpfile)
40
+ tmpfile.exist_as_a_file?.should be_true
41
+ #File.should exist_as_a_file(tmpfile)
41
42
  exp = _arr_of_arrs(tf_bioworks_to_excel_actual)
42
43
  act = _arr_of_arrs(tmpfile)
43
44
  exp.each_index do |i|
@@ -103,7 +103,7 @@ describe 'filtering on small bioworks file with inverse prots' do
103
103
  @regexp = /^INV_/o
104
104
  @file = Tfiles + '/bioworks_with_INV_small.xml'
105
105
  @spec_id = SpecID.new(@file)
106
- vals = [Validator::Decoy.new(@regexp)]
106
+ vals = [Validator::Decoy.new(:constraint => @regexp)]
107
107
  @opts = {:sequest => {:xcorr1 => 1.0, :xcorr2 => 1.0, :xcorr3 => 1.0, :deltacn => 0.1, :ppm => 1000.0, :include_deltacnstar=> false}, :validators => vals}
108
108
  end
109
109
 
@@ -121,7 +121,7 @@ describe 'filtering on small bioworks file with inverse prots' do
121
121
  # this does a minimal test to see if this functions properly
122
122
  # (not for accuracy, which is done in validator_spec)
123
123
  ## WITH FASTA FILE:
124
- val1 = Validator::AA.new('C').set_frequency(Fasta.new(Tfiles + '/small.fasta'))
124
+ val1 = Validator::AAEst.new('C').set_frequency(Fasta.new(Tfiles + '/small.fasta').prots)
125
125
  @opts[:validators] << val1 # obviously this guy is not his
126
126
  ans1 = SpecID::Precision::Filter.new.filter_and_validate(@spec_id, @opts)
127
127
  peps = ans1[:pephits]
@@ -131,7 +131,7 @@ describe 'filtering on small bioworks file with inverse prots' do
131
131
 
132
132
  ## WITH A CYSTEINE BACKGROUND:
133
133
  background_cys = 0.0172
134
- val3 = Validator::AA.new('C', :background => background_cys).set_frequency(Fasta.new(Tfiles + '/small.fasta'))
134
+ val3 = Validator::AAEst.new('C', :background => background_cys).set_frequency(Fasta.new(Tfiles + '/small.fasta').prots)
135
135
  @opts[:validators][1] = val3
136
136
  ans3 = SpecID::Precision::Filter.new.filter_and_validate(@spec_id, @opts)
137
137
  peps = ans3[:pephits]
@@ -156,8 +156,8 @@ describe 'filtering on a real srf file' do
156
156
 
157
157
  regexp = /FAKINGIT_OUT/
158
158
  opts[:decoy] = regexp
159
- decoy_val = Validator::Decoy.new(regexp) # this is not real, just to test
160
- cys_val = Validator::AA.new('C').set_frequency(Fasta.new(fasta_file))
159
+ decoy_val = Validator::Decoy.new(:constraint => regexp) # this is not real, just to test
160
+ cys_val = Validator::AAEst.new('C').set_frequency(Fasta.new(fasta_file).prots)
161
161
  tmm_val = Validator::Transmem::Protein.new(tmm_file, :min_num_tms => 1, :soluble_fraction => true, :correct_wins => true, :no_include_tm_peps => false, :background => 0.0).set_false_to_total_ratio( Digestor.digest( Fasta.new(fasta_file), Sequest::Params.new(sequest_file) ) )
162
162
  opts[:validators] = [decoy_val, cys_val, tmm_val]
163
163
  ans = SpecID::Precision::Filter.new.filter_and_validate(spec_id, opts)
@@ -41,71 +41,4 @@ describe 'finding precision Proph::Prot::Pep objects' do
41
41
  end
42
42
 
43
43
 
44
- =begin
45
- it 'gets precision with all validators (including probability and decoy)' do
46
- ## create some decoy peptides!
47
- @spec_id.peps.sort_by {|pep| pep.probability }[100..-1].each_with_index do |pep,i|
48
- if i % 3 == 0
49
- pep.prots.each {|prot| prot.protein_name = 'DECOY_' + prot.protein_name }
50
- end
51
- end
52
- # check which ones are ACTUALLY normal and decoy
53
- (decoy, normal) = @spec_id.peps.partition do |pep|
54
- pep.prots.all? {|prot| prot.protein_name =~ /^DECOY_/}
55
- end
56
- num_decoy = decoy.size
57
- num_normal = normal.size
58
- end
59
-
60
- prob_spec_helper = File.expand_path( File.dirname(__FILE__) + '/prob_spec_helper' )
61
-
62
- # this does a minimal test to see if this functions properly
63
- # (not for accuracy, which is done in validator_spec)
64
- ## WITH FASTA FILE:
65
- base_dir = Tfiles_l + '/opd1_2runs_2mods/sequest'
66
- fasta_file = base_dir + '/ecoli_K12_ncbi_20060321.fasta'
67
- params_file = base_dir + '/ecoli.params'
68
- bias_file = base_dir + '/ecoli_K12_ncbi_20060321.bias.fasta'
69
- toppred_file = base_dir + '/ecoli_K12_ncbi_20060321.toppred.xml'
70
-
71
- fasta_file.should exist
72
-
73
- prob = Validator::Probability.new
74
- badaa_freq = Validator::AA.new('C', :frequency => 0.0115866200193321)
75
- badaa_dig = Validator::AA.new('C')
76
- bias = Validator::Bias.new(Fasta.new(bias_file))
77
- transmem = Validator::Transmem::Protein.new(toppred_file)
78
- decoy = Validator::Decoy.new(/^DECOY_/)
79
-
80
- turn_on_digestion = true
81
- if turn_on_digestion
82
- # digestion based validators need this set!
83
- digested_peps = Digestor.digest(Fasta.new(fasta_file), Sequest::Params.new(params_file))
84
- [badaa_dig, bias, transmem].each do |val|
85
- val.set_false_to_total_ratio(digested_peps)
86
- end
87
- end
88
- transmem.transmem_status_hash = transmem.create_transmem_status_hash(@spec_id.peps)
89
- val_list = [decoy, badaa_freq, badaa_dig, prob, bias, transmem]
90
-
91
- opts = { :validators => val_list }
92
-
93
-
94
- hash = SpecID::Precision::Prob.new.precision_vs_num_hits(@spec_id, opts)
95
- #puts "OUTPUT: "
96
- #puts hash.to_yaml
97
-
98
-
99
- # frozen
100
- e_hash = ProbMSHelper::Answer2
101
- # hash[:pephits_precision].size.should == e_hash[:pephits_precision].size
102
- # other data types are tested above, just testing validators
103
- hash[:pephits_precision].zip( e_hash[:pephits_precision] ) do |val_hash, val_hash_e|
104
- val_hash[:values].size.should == num_normal
105
- #val_hash[:validator].should == val_hash_e[:validator]
106
- val_hash[:values].zip(val_hash_e[:values]) {|v,e| v.should be_close(e, 0.000000001)}
107
- end
108
- end
109
- end
110
44
 
111
- =end
@@ -13,7 +13,7 @@ ToCheck = {
13
13
  }
14
14
 
15
15
 
16
- describe Proph::PepSummary, "reading a .xml file" do
16
+ describe Proph::PepSummary, "reading a small .xml file" do
17
17
  before(:each) do
18
18
  file = Tfiles + '/opd1_2runs_2mods/interact-opd1_mods__small.xml'
19
19
  @obj = Proph::PepSummary.new(file)
@@ -23,15 +23,25 @@ describe Proph::PepSummary, "reading a .xml file" do
23
23
  lambda { Proph::PepSummary.new(Tfiles + '/opd1/000.tpp_2.9.2.first10.xml')}.should raise_error(ArgumentError)
24
24
  end
25
25
 
26
- it 'has spectrum queries' do
27
- @obj.spectrum_queries.size.should == 18
26
+ it 'has msms_run_summary objects with spectrum_queries' do
27
+ @obj.msms_run_summaries.size.should == 1
28
+ sqs = @obj.msms_run_summaries.first.spectrum_queries
29
+ sqs.size.should == 18
28
30
 
29
31
  [:first, :last].each do |mth|
30
32
  ToCheck[:spectrum_query][mth].each do |k,v|
31
- @obj.spectrum_queries.send(mth).send(k).should == v
33
+ if v.is_a? Float
34
+ sqs.send(mth).send(k).should be_close(v, 0.0000000001)
35
+ else
36
+ sqs.send(mth).send(k).should == v
37
+ end
32
38
  end
33
39
  ToCheck[:search_hit][mth].each do |k,v|
34
- @obj.spectrum_queries.send(mth).search_results.first.search_hits.first.send(k).should == v
40
+ if v.is_a? Float
41
+ sqs.send(mth).search_results.first.search_hits.first.send(k).should be_close(v, 0.0000000001)
42
+ else
43
+ sqs.send(mth).search_results.first.search_hits.first.send(k).should == v
44
+ end
35
45
  end
36
46
  end
37
47
  end
@@ -44,7 +54,11 @@ describe Proph::PepSummary, "reading a .xml file" do
44
54
 
45
55
  [:first, :last].each do |mth|
46
56
  ToCheck[:search_hit][mth].each do |k,v|
47
- @obj.peps.send(mth).send(k).should == v
57
+ if v.is_a? Float
58
+ @obj.peps.send(mth).send(k).should be_close(v, 0.0000000001)
59
+ else
60
+ @obj.peps.send(mth).send(k).should == v
61
+ end
48
62
  end
49
63
  end
50
64
 
@@ -52,92 +66,33 @@ describe Proph::PepSummary, "reading a .xml file" do
52
66
 
53
67
  end
54
68
 
55
- ####################################################
56
- # OTHER TESTS NOT IMPLEMENTED (do we need these??)
57
- ####################################################
58
-
59
- =begin
60
-
61
- require 'test/unit'
62
- require 'spec_id'
63
- require 'ms/scan'
64
-
65
- class ProphTest < Test::Unit::TestCase
66
-
67
- def initialize(arg)
68
- super(arg)
69
- @tfiles = File.dirname(__FILE__) + '/tfiles/'
70
- @pepproph_xml = @tfiles + 'pepproph_small.xml'
71
- end
72
-
73
- def Xtest_filter_by_min_pep_prob
74
- obj = Proph::Pep::Parser.new
75
- new_file = "tfiles/tmp.xml"
76
- assert_match(/peptideprophet_result probability="0.[0-5]/, IO.read(@pepproph_xml))
77
- obj.filter_by_min_pep_prob(@pepproph_xml, new_file, 0.50)
78
- assert_no_match(/peptideprophet_result probability="0.[0-5]/, IO.read(new_file))
79
- assert_match(/<peptideprophet_result[^>]*probability="0.[6-9][^>]*>/, IO.read(new_file))
80
- File.unlink new_file
81
- end
82
-
83
- def Xtest_uniq_by_seqcharge
84
- cls = Proph::Pep
85
- p1 = cls.new({ :charge => '2', :sequence => 'PEPTIDE' })
86
- p2 = cls.new({ :charge => '3', :sequence => 'PEPTIDE' })
87
- p3 = cls.new({ :charge => '2', :sequence => 'PEPTIDE' })
88
- p4 = cls.new({ :charge => '2', :sequence => 'APEPTIDE' })
89
- p5 = cls.new({ :charge => '2', :sequence => 'APEPTIDE' })
90
- un_peps = cls.uniq_by_seqcharge([p1,p2,p3,p4,p5])
91
- ## WHY ISn't that working? below!
92
- ##assert_equal([p1,p2,p4].to_set, un_peps.to_set)
93
- assert(equal_sets([p1,p2,p4], un_peps))
94
- end
95
-
96
- def Xequal_sets(arr1, arr2)
97
- c1 = arr1.dup
98
- c2 = arr2.dup
99
- arr1.each do |c|
100
- arr2.each do |d|
101
- if c == d
102
- c1.delete c
103
- c2.delete d
104
- end
105
- end
69
+ describe Proph::PepSummary, 'reading a large .xml file' do
70
+ spec_large do
71
+ before(:all) do
72
+ file = Tfiles_l + '/opd1_2runs_2mods/prophet/interact-opd1_mods.xml'
73
+ @obj = Proph::PepSummary.new(file)
106
74
  end
107
- if (c1.size == c2.size) && (c1.size == 0)
108
- true
109
- else
110
- false
75
+
76
+ it 'has peps of class Proph::PepSummary::Pep' do
77
+ @obj.peps.first.class.to_s.should == 'Proph::PepSummary::Pep'
78
+ @obj.peps.size.should == 1643
111
79
  end
112
- end
113
80
 
114
- def Xtest_arithmetic_avg_scan_by_parent_time
115
- i1 = 100015.0
116
- i2 = 30000.0
117
- i3 = 100.0
118
- t1 = 0.13
119
- t2 = 0.23
120
- t3 = 0.33
121
- p1 = MS::Scan.new(1,1, t1)
122
- p2 = MS::Scan.new(2,1, t2)
123
- p3 = MS::Scan.new(3,1, t3)
124
- s1 = MS::Scan.new(1,2,0.10, 300.2, i1, p1)
125
- s2 = MS::Scan.new(2,2,0.20, 301.1, i2, p2)
126
- s3 = MS::Scan.new(3,2,0.30, 302.0, i3, p3)
127
- scan = Proph::Pep.new({:scans => [s1,s2,s3]}).arithmetic_avg_scan_by_parent_time
128
- tot_inten = i1 + i2 + i3
129
- tm = ( t1 * (i1/tot_inten) + t2 * (i2/tot_inten) + t3 * (i3/tot_inten) )
130
- {:ms_level => 2, :prec_inten => 130115.0/3, :num => nil, :prec_mz => 301.1.to_f, :time => tm }.each do |k,v|
131
- if k == :prec_mz # not sure why this is bugging out, but..
132
- assert_equal(v.to_s, scan.send(k).to_s)
133
- else
134
- assert_equal(v, scan.send(k))
135
- end
81
+ it 'contains peps that respond_to :aaseq' do
82
+ @obj.peps.first.should respond_to(:aaseq)
136
83
  end
137
84
 
85
+ it 'has prots (also callable from peps)' do
86
+ (@obj.prots.size > 0).should be_true
87
+ @obj.peps.all? {|v| v.prots.size > 0 }.should be_true
88
+ peps_with_prots = @obj.peps.select {|v| v.prots.size > 1 }
89
+ # frozen:
90
+ peps_with_prots.first.prots.size.should == 3
91
+ peps_with_prots.first.prots.first.name.should == "gi|16128676|ref|NP_415229.1|"
92
+ peps_with_prots.first.prots.first.protein_descr.should == "RhsC protein in RhsC element [Escherichia coli K12]"
93
+ peps_with_prots.first.prots.first.reference.should == "gi|16128676|ref|NP_415229.1| RhsC protein in RhsC element [Escherichia coli K12]"
94
+ peps_with_prots.first.prots.last.protein_descr.should == "RhsA protein in RhsA element [Escherichia coli K12]"
95
+ end
138
96
  end
139
-
140
-
141
97
  end
142
98
 
143
- =end
@@ -18,7 +18,7 @@ xdescribe ProteinSummary do
18
18
  spec_large do
19
19
  it 'does basic summary on prophet file' do
20
20
  runit "-c 5.0 #{@tf_proph}"
21
- @tf_summary.should exist
21
+ @tf_summary.exist_as_a_file?.should be_true
22
22
  string = IO.read(@tf_summary)
23
23
  string.should =~ /gi\|16132176\|ref\|NP_418775\.1\|/
24
24
  string.should =~ /16132176/
@@ -28,7 +28,7 @@ xdescribe ProteinSummary do
28
28
 
29
29
  it 'does basic summary on bioworks.xml file' do
30
30
  runit "#{@tf_bioworks_small}"
31
- @tf_bioworks_small_summary_html.should exist
31
+ @tf_bioworks_small_summary_html.exist_as_a_file?.should be_true
32
32
  File.unlink @tf_bioworks_small_summary_html unless @no_delete
33
33
  # @TODO: need to freeze the output here
34
34
  end
@@ -40,7 +40,7 @@ xdescribe ProteinSummary do
40
40
  runit "#{@tf_bioworks_small} --precision"
41
41
  IO.read(@tf_bioworks_small_summary_html).should =~ /# hits.*106/m
42
42
  # should add more tests here...
43
- @tf_bioworks_small_summary_html.should exist
43
+ @tf_bioworks_small_summary_html.exist_as_a_file?.should be_true
44
44
  File.unlink @tf_bioworks_small_summary_html unless @no_delete
45
45
  end
46
46
 
@@ -59,7 +59,7 @@ xdescribe ProteinSummary do
59
59
  spec_large do
60
60
  it 'gives correct peptide counts' do
61
61
  runit "-c 5.0 #{@tf_proph} --peptide_count #{@tf_peptide_count}"
62
- @tf_peptide_count.should exist
62
+ @tf_peptide_count.exist_as_a_file?.should be_true
63
63
  file = IO.read(@tf_peptide_count)
64
64
  file.should include("gi|16132176|ref|NP_418775.1|\t2")
65
65
  file.should include("gi|16131996|ref|NP_418595.1|\t1")
@@ -8,84 +8,6 @@ require 'spec_id/sequest/pepxml'
8
8
 
9
9
  NODELETE = false
10
10
 
11
- describe Sequest::PepXML::SearchHit, 'making enzyme calculations on sequences' do
12
-
13
- before(:each) do
14
- @tf_params_fullKRP = Tfiles + "/bioworks32.params"
15
- # The enzyme is: 1 KR P
16
- @tf_params_justKR = Tfiles + "/bioworks33.params"
17
- end
18
-
19
- it 'calculates the number of tolerant termini' do
20
- exp = [{
21
- # full KR/P
22
- 'K.EPTIDR.E' => 2,
23
- 'K.PEPTIDR.E' => 1,
24
- 'F.EEPTIDR.E' => 1,
25
- 'F.PEPTIDW.R' => 0,
26
- },
27
- {
28
- # just KR
29
- 'K.EPTIDR.E' => 2,
30
- 'K.PEPTIDR.E' => 2,
31
- 'F.EEPTIDR.E' => 1,
32
- 'F.PEPTIDW.R' => 0,
33
- }
34
- ]
35
- scall = Sequest::PepXML::SearchHit
36
- sym = :calc_num_tol_term
37
- params_ar = [Sequest::Params.new(@tf_params_fullKRP), Sequest::Params.new(@tf_params_justKR)]
38
- params_ar.zip(exp) do |params,hash|
39
- hash.each do |seq, val|
40
- scall.send(sym, params, seq).should == val
41
- end
42
- end
43
- end
44
-
45
- it 'calculates number of missed cleavages' do
46
- exp = [{
47
- "K.EPTIDR.E" => 0,
48
- "K.PEPTIDR.E" => 0,
49
- "F.EEPTIDR.E" => 0,
50
- "F.PEPTIDW.R" => 0,
51
- "F.PERPTIDW.R" => 0,
52
- "F.PEPKPTIDW.R" => 0,
53
- "F.PEPKTIDW.R" => 1,
54
- "K.RTTIDR.E" => 1,
55
- "K.RTTIKK.E" => 2,
56
- "F.PKEPRTIDW.R" => 2,
57
- "F.PKEPRTIDKP.R" => 2,
58
- "F.PKEPRAALKPEERPTIDKW.R" => 3,
59
- },
60
- {
61
- "K.EPTIDR.E" => 0,
62
- "K.PEPTIDR.E" => 0,
63
- "F.EEPTIDR.E" => 0,
64
- "F.PEPTIDW.R" => 0,
65
- "F.PERPTIDW.R" => 1,
66
- "F.PEPKPTIDW.R" => 1,
67
- "F.PEPKTIDW.R" => 1,
68
- "K.RTTIDR.E" => 1,
69
- "K.RTTIKK.E" => 2,
70
- "F.PKEPRTIDW.R" => 2,
71
- "F.PKEPRTIDKP.R" => 3,
72
- "F.PKEPRAALKPEERPTIDKW.R" => 5,
73
- }
74
- ]
75
-
76
- params_ar = [Sequest::Params.new(@tf_params_fullKRP), Sequest::Params.new(@tf_params_justKR)]
77
- scall = Sequest::PepXML::SearchHit
78
- sym = :calc_num_missed_cleavages
79
- #params_ar[1] = params_ar[0]
80
- params_ar.zip(exp) do |params, hash|
81
- hash.each do |seq, val|
82
- scall.send(sym, params, seq).should == val
83
- end
84
- end
85
- end
86
-
87
- end
88
-
89
11
  describe Sequest::PepXML, " created from small bioworks.xml" do
90
12
 
91
13
  spec_large do
@@ -423,7 +345,7 @@ describe 'bioworks file with modifications transformed into pepxml' do
423
345
 
424
346
  it 'gets modifications right in real run' do
425
347
  @out_files.each do |fn|
426
- fn.should exist
348
+ fn.exist_as_a_file?.should be_true
427
349
  beginning = IO.read(fn)
428
350
  lines = beginning.split("\n")
429
351
  [