mspire 0.7.11 → 0.7.12

Sign up to get free protection for your applications and to get access to all the features.
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.7.11
1
+ 0.7.12
@@ -327,6 +327,15 @@ module Mspire::Imzml
327
327
  end
328
328
 
329
329
  data_info_pairs = write_binary(config[:ibd_filename], all_spectra_iter, config)
330
+ xy_positions_array = x_y_positions(config)
331
+
332
+ unless data_info_pairs.size == xy_positions_array.size
333
+ STDERR.puts "Input Error! The number of calculated scans must equal the number of actual scans!"
334
+ STDERR.puts "The number of calculated positions: #{xy_positions_array.size}"
335
+ STDERR.puts "The number of actual scans: #{data_info_pairs.size}"
336
+ raise
337
+ end
338
+
330
339
  config[:ibd_sha1] = Digest::SHA1.hexdigest(IO.read(config[:ibd_filename]))
331
340
 
332
341
  source_files = mzml_filenames.zip(sourcefile_ids).map do |mzml_filename, source_file_id|
@@ -374,7 +383,7 @@ module Mspire::Imzml
374
383
  # low intensity data point removal: "MS:1000594"
375
384
  imzml.run = Mspire::Mzml::Run.new("run1", default_instrument_config) do |run|
376
385
  spec_list = Mspire::Mzml::SpectrumList.new(data_processing_obj)
377
- data_info_pairs.zip(x_y_positions(config), sourcefile_id_parallel_to_spectra).each_with_index do |(pair, xy, sourcefile_id),i|
386
+ data_info_pairs.zip(xy_positions_array, sourcefile_id_parallel_to_spectra).each_with_index do |(pair, xy, sourcefile_id),i|
378
387
  # TODO: we should probably copy the id from the orig mzml (e.g.
379
388
  # scan=1)
380
389
  spectrum = Mspire::Mzml::Spectrum.new("spectrum#{i}", params: [rparms_by_id[:spectrum1]])
@@ -1,4 +1,5 @@
1
1
  require 'mspire/bin'
2
+ require 'mspire/peak'
2
3
 
3
4
  module Mspire
4
5
  # a collection of peak objects. At a minimum, each peak should respond to
@@ -34,6 +34,7 @@ parser = Trollop::Parser.new do
34
34
  opt :mz_prefix, "use this prefix for mz values", :default => DEFAULTS[:mz_prefix]
35
35
  opt :round_mz, "round the final m/z values to this place", :default => DEFAULTS[:round_mz]
36
36
  opt :round_intensity, "round the final int values to this place", :default => DEFAULTS[:round_intensity]
37
+ opt :simple_calibrate, "adjust the m/z values by that amount", :default => 0.0
37
38
  opt :verbose, "talk about it"
38
39
  end
39
40
 
@@ -129,7 +130,7 @@ File.open(opts[:outfile],'w') do |out|
129
130
  signal_by_sample_index[peak.sample_id] += peak.y
130
131
  end
131
132
 
132
- row = [opts[:mz_prefix] + meta_peak.x.round(opts[:round_mz]).to_s, *sample_ids.each_with_index.map {|id,index| signal_by_sample_index[index].round(opts[:round_intensity]) }]
133
+ row = [opts[:mz_prefix] + (meta_peak.x + opts[:simple_calibrate]).round(opts[:round_mz]).to_s, *sample_ids.each_with_index.map {|id,index| signal_by_sample_index[index].round(opts[:round_intensity]) }]
133
134
  out.puts row.join("\t")
134
135
  end
135
136
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: mspire
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.7.11
4
+ version: 0.7.12
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -10,7 +10,7 @@ authors:
10
10
  autorequire:
11
11
  bindir: bin
12
12
  cert_chain: []
13
- date: 2012-04-19 00:00:00.000000000 Z
13
+ date: 2012-05-10 00:00:00.000000000 Z
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: nokogiri