changeset 22:89a88542f301 draft

planemo upload
author jowong
date Thu, 22 Nov 2018 09:46:09 -0500
parents 12b9a42289c2
children d01c6c157897
files kwip.xml kwip_postprocess.py kwip_postprocess.xml
diffstat 3 files changed, 45 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/kwip.xml	Thu Nov 22 09:25:15 2018 -0500
+++ b/kwip.xml	Thu Nov 22 09:46:09 2018 -0500
@@ -1,4 +1,4 @@
-<tool id="kwip" name="kwip" version="1.2.8">
+<tool id="kwip" name="kwip" version="1.2.9">
     <description>Calculates k-mer weighted inner product, a de novo estimator of genetic similarity</description>
     <requirements>
         <requirement type="package" version="0.2.0">kwip</requirement>
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/kwip_postprocess.py	Thu Nov 22 09:46:09 2018 -0500
@@ -0,0 +1,27 @@
+#!/usr/bin/env python
+
+import sys
+import argparse as ap
+import re
+parser = ap.ArgumentParser(prog='kwip_postprocess', conflict_handler='resolve',
+                           description="Postprocess galaxy kWIP output")
+
+input = parser.add_argument_group('Input', '')
+input.add_argument('-i', '--input', nargs=1, required=True, help="kWIP galaxy OUTPUT")
+
+
+if len(sys.argv) == 0:
+    parser.print_usage()
+    sys.exit(1)
+
+args = parser.parse_args()
+
+
+with open(args.input[0]) as kwip_output:
+	with open('kwip_postprocess_output.txt', 'w') as output:
+		for line in kwip_output:
+                        new_line = re.sub('(_1.fastq(.gz)*|_2.fastq(.gz)*|.fastq(.gz)*)', '', line)
+			output.write(new_line)
+
+
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/kwip_postprocess.xml	Thu Nov 22 09:46:09 2018 -0500
@@ -0,0 +1,17 @@
+<tool id="kwip_postprocess" name="kWIP Postprocess" version="1.0.0">
+    <description>Postprocess kWIP galaxy output</description>
+    <command interpreter="python"><![CDATA[
+        kwip_postprocess.py -i $kwip_output  
+    ]]></command>
+    <inputs>
+        <param name="kwip_output" type="data" format="txt" label="kWIP output"  />
+    </inputs>
+    <outputs>
+        <data name="output" format="txt" from_work_dir="kwip_postprocess_output.txt"/>
+    </outputs>
+    <help>
+This tool processes the kwip galaxy output such that it is in line with the command line
+    </help>
+    <citations>
+    </citations>
+</tool>