ms-sequest 0.0.5 → 0.0.6

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 (4) hide show
  1. data/History +5 -0
  2. data/lib/ms/sequest.rb +1 -1
  3. data/lib/ms/sequest/srf.rb +11 -11
  4. metadata +2 -2
data/History CHANGED
@@ -1,3 +1,8 @@
1
+ == 0.0.6 / 2009-06-26
2
+
3
+ * fixed bug affecting only version 0.0.5 in srf reader affecting any file where print_duplicate_references was less than the number of protein references found for a peptide, but also > 0.
4
+ * so, the srf reader now robustly supports reading srf files regardless of print_duplicate_references setting.
5
+
1
6
  == 0.0.5 / 2009-06-22
2
7
 
3
8
  * fixed handling of files with print_duplicate_references = 0
@@ -1,6 +1,6 @@
1
1
 
2
2
  module Ms
3
3
  module Sequest
4
- VERSION = '0.0.5'
4
+ VERSION = '0.0.6'
5
5
  end
6
6
  end
@@ -149,6 +149,7 @@ class Ms::Sequest::Srf
149
149
  opts = { :filter_by_precursor_mass_tolerance => true, :link_protein_hits => true}.merge(opts)
150
150
  params = Ms::Sequest::Srf.get_sequest_params(filename)
151
151
  dup_references = 0
152
+ dup_refs_gt_0 = false
152
153
  if params
153
154
  dup_references = params.print_duplicate_references.to_i
154
155
  if dup_references == 0
@@ -164,8 +165,11 @@ print_duplicate_references > 0. HINT: to capture all duplicate references,
164
165
  set the sequest parameter 'print_duplicate_references' to 100 or greater.
165
166
  *****************************************************************************
166
167
  END
168
+ else
169
+ dup_refs_gt_0 = true
167
170
  end
168
171
  else
172
+ warn "no params file found in srf, could be truncated file!"
169
173
  end
170
174
 
171
175
  File.open(filename, "rb") do |fh|
@@ -182,7 +186,7 @@ END
182
186
  end
183
187
  @dta_files, measured_mhs = read_dta_files(fh,@header.num_dta_files, unpack_35)
184
188
 
185
- @out_files = read_out_files(fh,@header.num_dta_files, measured_mhs, unpack_35, dup_references)
189
+ @out_files = read_out_files(fh,@header.num_dta_files, measured_mhs, unpack_35, dup_refs_gt_0)
186
190
  if fh.eof?
187
191
  #warn "FILE: '#{filename}' appears to be an abortive run (no params in srf file)\nstill continuing..."
188
192
  @params = nil
@@ -210,9 +214,6 @@ END
210
214
  pep_hit[11] = pep_hit[0] - mass_measured # real - measured (deltamass)
211
215
  pep_hit[12] = 1.0e6 * pep_hit[11].abs / mass_measured ## ppm
212
216
  pep_hit[18] = self ## link with the srf object
213
- if pep_hit.first_scan == 5719
214
- puts [pep_hit.sequence, pep_hit.xcorr].join(' ')
215
- end
216
217
  end
217
218
  end
218
219
 
@@ -260,10 +261,10 @@ END
260
261
 
261
262
  # filehandle (fh) must be at the start of the outfiles. 'read_dta_files'
262
263
  # will put the fh there.
263
- def read_out_files(fh,number_files, measured_mhs, unpack_35, dup_references)
264
+ def read_out_files(fh,number_files, measured_mhs, unpack_35, dup_refs_gt_0)
264
265
  out_files = Array.new(number_files)
265
266
  header.num_dta_files.times do |i|
266
- out_files[i] = Ms::Sequest::Srf::Out.new.from_io(fh, unpack_35, dup_references)
267
+ out_files[i] = Ms::Sequest::Srf::Out.new.from_io(fh, unpack_35, dup_refs_gt_0)
267
268
  end
268
269
  out_files
269
270
  end
@@ -470,7 +471,7 @@ class Ms::Sequest::Srf::Out
470
471
  "<Ms::Sequest::Srf::Out first_scan=#{first_scan}, last_scan=#{last_scan}, charge=#{charge}, num_hits=#{num_hits}, computer=#{computer}, date_time=#{date_time}#{hits_s}>"
471
472
  end
472
473
 
473
- def from_io(fh, unpack_35, dup_references)
474
+ def from_io(fh, unpack_35, dup_refs_gt_0)
474
475
  ## EMPTY out file is 96 bytes
475
476
  ## each hit is 320 bytes
476
477
  ## num_hits and charge:
@@ -487,13 +488,13 @@ class Ms::Sequest::Srf::Out
487
488
  ar[i] = Ms::Sequest::Srf::Out::Pep.new.from_io(fh, unpack_35)
488
489
  num_extra_references += ar[i].num_other_loci
489
490
  end
490
- num_extra_references = dup_references if num_extra_references > dup_references
491
- Ms::Sequest::Srf::Out::Pep.read_extra_references(fh, num_extra_references, ar)
491
+ if dup_refs_gt_0
492
+ Ms::Sequest::Srf::Out::Pep.read_extra_references(fh, num_extra_references, ar)
493
+ end
492
494
  ## The xcorrs are already ordered by best to worst hit
493
495
  ## ADJUST the deltacn's to be meaningful for the top hit:
494
496
  ## (the same as bioworks and prophet)
495
497
  Ms::Sequest::Srf::Out::Pep.set_deltacn_from_deltacn_orig(ar)
496
- #puts ar.map {|a| a.deltacn }.join(", ")
497
498
  end
498
499
  self[6] = ar
499
500
  self
@@ -677,7 +678,6 @@ class Ms::Sequest::SrfGroup
677
678
  indiv_opts = { :link_protein_hits => false }
678
679
  super(arg, opts.merge(indiv_opts)) do
679
680
  unless orig_opts[:link_protein_hits] == false
680
- puts "MERGING GROUP!"
681
681
  (@peps, @prots) = merge!(@searches.map {|v| v.peps }) do |_prot, _peps|
682
682
  Ms::Sequest::Srf::Out::Prot.new(_prot.reference, _peps)
683
683
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ms-sequest
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.5
4
+ version: 0.0.6
5
5
  platform: ruby
6
6
  authors:
7
7
  - John Prince
@@ -9,7 +9,7 @@ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
11
 
12
- date: 2009-06-22 00:00:00 -06:00
12
+ date: 2009-06-26 00:00:00 -06:00
13
13
  default_executable:
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency