Sha256: 1da65dbd8ed0e3612832aed3137548eb45a49d0e99b8e509ab06812ce02e282a
Contents?: true
Size: 1.35 KB
Versions: 3
Compression:
Stored size: 1.35 KB
Contents
#!/usr/bin/ruby -w require 'optparse' require 'spec/mzxml' require 'fileutils' progname = File.basename(__FILE__) opt = {} opts = OptionParser.new do |op| op.banner = "usage: #{progname} [OPTIONS] <file>.RAW ..." op.separator "" op.on("-p", "--profile", "uses profile output instead of centroid (default)") {|v| opt[:profile] = v} end opts.parse! if ARGV.size == 0 puts opts exit end converter = MS::MzXML.find_mzxml_converter if converter $stderr.puts "using #{converter} to convert files" else puts "cannot find [#{MS::MzXML::Potential_mzxml_converters.join(', ')}] in the paths:" puts ENV['PATH'].split(/[:;]/).join(", ") abort end files = ARGV.to_a files.each do |file| puts "******************************************" puts "Converting: #{file}" if converter =~ /readw/ centroid_or_profile = 'c' if opt[:profile] centroid_or_profile = 'p' end outfile = file.sub(/\.RAW$/i, '.mzXML') cmd = "#{converter} #{file} #{centroid_or_profile} #{outfile}" puts "Performing: '#{cmd}'" puts `#{cmd}` else ## t2x only outputs in cwd! Dir.chdir(File.dirname(file)) do |dir| puts "Performing: '#{cmd}' in #{dir}" puts `#{cmd}` system "#{converter} #{File.basename(file)}" end end puts "******************************************" end
Version data entries
3 entries across 3 versions & 1 rubygems
Version | Path |
---|---|
mspire-0.3.0 | bin/raw_to_mzXML.rb |
mspire-0.3.1 | bin/raw_to_mzXML.rb |
mspire-0.3.9 | bin/raw_to_mzXML.rb |