From d6ce280e7793c78e97612a632c17057ef75f10bb Mon Sep 17 00:00:00 2001
From: aknecht2 <aknecht2@unl.edu>
Date: Thu, 8 Sep 2016 21:42:07 -0500
Subject: [PATCH] Added 'list' argument to allow vararg inputs. Updated
 workflow_module & job accordingly to handle new input type.

---
 chipathlon/conf.py            | 5 ++++-
 chipathlon/workflow_module.py | 9 +++++++++
 2 files changed, 13 insertions(+), 1 deletion(-)

diff --git a/chipathlon/conf.py b/chipathlon/conf.py
index 5445f2f..addb191 100644
--- a/chipathlon/conf.py
+++ b/chipathlon/conf.py
@@ -85,9 +85,12 @@ resources = {
 #   file -> Normal file arguments.
 #   stdout -> Any file argument that is redirected from stdout
 #   stderr -> Any file argument that is redirected from stderr
+# list -> For variable argument inputs
+#   list -> Currently a list of files.
 argument_types = {
     "argument": ["string", "numeric"],
-    "file": ["file", "rawfile", "stdout", "stderr"]
+    "file": ["file", "rawfile", "stdout", "stderr"],
+    "list": ["list"]
 }
 
 # Defines information about arguments
diff --git a/chipathlon/workflow_module.py b/chipathlon/workflow_module.py
index 931b55e..4c958fc 100644
--- a/chipathlon/workflow_module.py
+++ b/chipathlon/workflow_module.py
@@ -396,6 +396,15 @@ class WorkflowModule(object):
                             "file": master_files[arg_params[param_name]],
                             "type": param_info["type"]
                         })
+                elif param_info["type"] in chipathlon.conf.argument_types["list"]:
+                    sub_list = []
+                    for val in arg_params[param_name]:
+                        sub_list.append({
+                            "name": val,
+                            "file": master_files[val],
+                            "type": "file"
+                        })
+                    param_list.append({"name": arg_params[param_name], "type": "list", "value": sub_list})
                 else:
                     param_list.append({
                         "name": param_name,
-- 
GitLab