comparison openms_wrapper.py @ 4:1183846e70a1 draft

Uploaded
author galaxyp
date Wed, 19 Jun 2013 13:15:44 -0400
parents cf0d72c7b482
children
comparison
equal deleted inserted replaced
3:8fa16707e162 4:1183846e70a1
69 if not _set_item_value(node, key, value) and \ 69 if not _set_item_value(node, key, value) and \
70 not _set_list_item_value(node, key, value) and \ 70 not _set_list_item_value(node, key, value) and \
71 required: 71 required:
72 _fail("Failed to find specific OpenMS option [%s] in node [%s]" % (key, node)) 72 _fail("Failed to find specific OpenMS option [%s] in node [%s]" % (key, node))
73 else: 73 else:
74 if not node: 74 if node is None:
75 _fail("Failed to find specific OpenMS option [%s] in node [%s]" % (key, node)) 75 _fail("Failed to find specific OpenMS option [%s] in node [%s]" % (key, node))
76 sub_node = node.find("./NODE[@name='%s']" % key) 76 sub_node = node.find("./NODE[@name='%s']" % key)
77 if not sub_node: 77 if sub_node is None:
78 _fail("Failed to find node for key %s" % key) 78 _fail("Failed to find node for key %s" % key)
79 _set_option(sub_node, key_parts[1:], value, required) 79 _set_option(sub_node, key_parts[1:], value, required)
80 80
81 81
82 def _set_item_value(node, key, value): 82 def _set_item_value(node, key, value):
143 return exe_file 143 return exe_file
144 144
145 return None 145 return None
146 146
147 147
148 def _mapped_outputs(output_directory, inputs):
149 inputs = inputs.split(",")
150 os.makedirs(output_directory)
151 outputs = [os.path.join(output_directory, os.path.basename(input)) for input in inputs]
152 return ",".join(outputs)
153
154
148 VALUE_FUNCTIONS = {compile(r"\@WHICH\((.*)\)\@"): _which, 155 VALUE_FUNCTIONS = {compile(r"\@WHICH\((.*)\)\@"): _which,
149 compile(r"\@PEPNOVO_MODELS_PATH\@"): _get_pepnovo_models_path, 156 compile(r"\@PEPNOVO_MODELS_PATH\@"): _get_pepnovo_models_path,
157 compile(r"\@MULTI_OUTPUT\(([^,]*),(.*)\)\@"): _mapped_outputs,
150 } 158 }
151 159
152 160
153 def _parse_args(): 161 def _parse_args():
154 parser = OptionParser() 162 parser = OptionParser()