comparison ms_data_converter.py @ 1:a36e9f847308 default tip

Fixes for running on Windows via pulsar
author Jim Johnson <jj@umn.edu>
date Wed, 11 Mar 2015 16:47:12 -0500
parents dfafbfd7983d
children
comparison
equal deleted inserted replaced
0:dfafbfd7983d 1:a36e9f847308
116 stop_err("Number(s) of supplied input names and input files do not match") 116 stop_err("Number(s) of supplied input names and input files do not match")
117 if not options.output: 117 if not options.output:
118 stop_err("Must specify output location") 118 stop_err("Must specify output location")
119 input_files = [] 119 input_files = []
120 for i, input in enumerate(options.inputs): 120 for i, input in enumerate(options.inputs):
121 # the commnadline template cannot determine if optional files exists, so do it here
122 if not os.path.exists(input):
123 continue
121 input_base = None 124 input_base = None
122 if len(options.input_names) > i: 125 if len(options.input_names) > i:
123 input_base = options.input_names[i] 126 input_base = options.input_names[i]
124 input_base = input_base.replace("'", "").replace("\"", "") 127 input_base = input_base.replace("'", "").replace("\"", "")
125 print("1- input_base: %s" % input_base) 128 print("1- input_base: %s" % input_base)
139 if input not in options.implicits: 142 if input not in options.implicits:
140 input_files.append(input_file) 143 input_files.append(input_file)
141 ## AB_SCIEX_MS_Converter <input format> <input data> <output content type> <output format> <output file> [data compression setting] [data precision setting] [create index flag] 144 ## AB_SCIEX_MS_Converter <input format> <input data> <output content type> <output format> <output file> [data compression setting] [data precision setting] [create index flag]
142 inputs_as_str = " ".join(['%s' % shellquote(input) for input in input_files]) 145 inputs_as_str = " ".join(['%s' % shellquote(input) for input in input_files])
143 output_file = re.sub('(%s)?$' % options.fromextension.lower(), options.toextension, input_files[0].lower()) 146 output_file = re.sub('(%s)?$' % options.fromextension.lower(), options.toextension, input_files[0].lower())
144 cmd = "AB_SCIEX_MS_Converter %s %s %s %s %s" % (options.fromextension.upper(), inputs_as_str, options.content_type, options.toextension.upper(), output_file ) 147 cmd = "AB_SCIEX_MS_Converter %s %s -%s %s %s" % (options.fromextension.upper(), inputs_as_str, options.content_type, options.toextension.upper(), output_file )
145 if str_to_bool(options.zlib): 148 if str_to_bool(options.zlib):
146 cmd = "%s %s" % (cmd, "/zlib") 149 cmd = "%s %s" % (cmd, "/zlib")
147 if options.binaryencoding: 150 if options.binaryencoding:
148 cmd = "%s %s" % (cmd, "/singleprecision" if options.binaryencoding == '32' else "/doubleprecision") 151 cmd = "%s %s" % (cmd, "/singleprecision" if options.binaryencoding == '32' else "")
149 if str_to_bool(options.zlib): 152 if str_to_bool(options.zlib):
150 cmd = "%s %s" % (cmd, "/index") 153 cmd = "%s %s" % (cmd, "/index")
151 if options.debug: 154 if options.debug:
152 print(cmd) 155 print(cmd)
153 execute(cmd) 156 execute(cmd)