diff 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
line wrap: on
line diff
--- a/ms_data_converter.py	Wed Mar 11 11:36:26 2015 -0400
+++ b/ms_data_converter.py	Wed Mar 11 16:47:12 2015 -0500
@@ -118,6 +118,9 @@
         stop_err("Must specify output location")
     input_files = []
     for i, input in enumerate(options.inputs):
+        # the commnadline template cannot determine if optional files exists, so do it here
+        if not os.path.exists(input):  
+            continue
         input_base = None
         if len(options.input_names) > i:
             input_base = options.input_names[i]
@@ -141,11 +144,11 @@
     ## AB_SCIEX_MS_Converter <input format> <input data> <output content type> <output format> <output file> [data compression setting] [data precision setting] [create index flag]
     inputs_as_str = " ".join(['%s' % shellquote(input) for input in input_files])
     output_file = re.sub('(%s)?$' % options.fromextension.lower(), options.toextension, input_files[0].lower())
-    cmd = "AB_SCIEX_MS_Converter %s %s %s %s %s" % (options.fromextension.upper(), inputs_as_str, options.content_type, options.toextension.upper(), output_file )
+    cmd = "AB_SCIEX_MS_Converter %s %s -%s %s %s" % (options.fromextension.upper(), inputs_as_str, options.content_type, options.toextension.upper(), output_file )
     if str_to_bool(options.zlib):
         cmd = "%s %s" % (cmd, "/zlib")
     if options.binaryencoding:
-        cmd = "%s %s" % (cmd, "/singleprecision" if options.binaryencoding == '32' else "/doubleprecision")
+        cmd = "%s %s" % (cmd, "/singleprecision" if options.binaryencoding == '32' else "")
     if str_to_bool(options.zlib):
         cmd = "%s %s" % (cmd, "/index")
     if options.debug: