diff test-data/tf2_test_runme.py @ 0:21d312776891 draft

planemo upload for repository https://github.com/mvdbeek/docker_scriptrunner/ commit 30f8264cdd67d40dec8acde6407f32152e6a29c1-dirty
author mvdbeek
date Sat, 09 Jul 2016 16:57:13 -0400
parents
children
line wrap: on
line diff
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test-data/tf2_test_runme.py	Sat Jul 09 16:57:13 2016 -0400
@@ -0,0 +1,25 @@
+# bog standard argparse for 3 possible comma separated lists
+# followed by some silly reverse each row code provided as an example
+# you're supposed to replace it with your great code..
+import argparse
+import copy
+
+argp = argparse.ArgumentParser()
+argp.add_argument('--INNAMES', default=None)
+argp.add_argument('--INPATHS', default=None)
+argp.add_argument('--OUTPATH', default=None)
+argp.add_argument('--additional_parameters', default=[], action="append")
+argp.add_argument('otherargs', nargs=argparse.REMAINDER)
+args = argp.parse_args()
+fout = open(args.OUTPATH, 'w')
+sins = open(args.INPATHS.split(',')[0]).readlines()
+for i, sin in enumerate(sins):
+    row = sin.strip().split('\t')
+    rrow = copy.copy(row)
+    lrow = len(row)
+    if (lrow > 1):
+        for j in range(lrow):
+            rrow[j] = row[lrow - j - 1]
+        fout.write('\t'.join(rrow))
+        fout.write('\n')
+fout.close()