Mercurial > repos > galaxyp > openms
diff openms_wrapper.py @ 4:1183846e70a1 draft
Uploaded
author | galaxyp |
---|---|
date | Wed, 19 Jun 2013 13:15:44 -0400 |
parents | cf0d72c7b482 |
children |
line wrap: on
line diff
--- a/openms_wrapper.py Fri May 10 17:31:59 2013 -0400 +++ b/openms_wrapper.py Wed Jun 19 13:15:44 2013 -0400 @@ -71,10 +71,10 @@ required: _fail("Failed to find specific OpenMS option [%s] in node [%s]" % (key, node)) else: - if not node: + if node is None: _fail("Failed to find specific OpenMS option [%s] in node [%s]" % (key, node)) sub_node = node.find("./NODE[@name='%s']" % key) - if not sub_node: + if sub_node is None: _fail("Failed to find node for key %s" % key) _set_option(sub_node, key_parts[1:], value, required) @@ -145,8 +145,16 @@ return None +def _mapped_outputs(output_directory, inputs): + inputs = inputs.split(",") + os.makedirs(output_directory) + outputs = [os.path.join(output_directory, os.path.basename(input)) for input in inputs] + return ",".join(outputs) + + VALUE_FUNCTIONS = {compile(r"\@WHICH\((.*)\)\@"): _which, compile(r"\@PEPNOVO_MODELS_PATH\@"): _get_pepnovo_models_path, + compile(r"\@MULTI_OUTPUT\(([^,]*),(.*)\)\@"): _mapped_outputs, }