changeset 1:1bf1794dfcf6 draft

planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/master/tools/concatenate_multiple_datasets commit 1542edc9d7c2b1e9649c52532a5630e23ac5ceda
author mvdbeek
date Fri, 25 Sep 2015 11:07:07 -0400
parents cf750d0edbd8
children 745090cbbf75
files catWrapper.py catWrapper.xml
diffstat 2 files changed, 35 insertions(+), 71 deletions(-) [+]
line wrap: on
line diff
--- a/catWrapper.py	Tue Mar 03 05:06:43 2015 -0500
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,38 +0,0 @@
-#!/usr/bin/env python
-#By, Guruprasad Ananda.
-
-from galaxy import eggs
-import sys, os
-
-def stop_err(msg):
-    sys.stderr.write(msg)
-    sys.exit()
-    
-def main():
-    outfile = sys.argv[1]
-    infile = sys.argv[2]
-    
-    try:
-        fout = open(sys.argv[1],'w')
-    except:
-        stop_err("Output file cannot be opened for writing.")
-        
-    try:
-        fin = open(sys.argv[2],'r')
-    except:
-        stop_err("Input file cannot be opened for reading.")
-    
-    if len(sys.argv) < 4:
-        os.system("cp %s %s" %(infile,outfile))
-        sys.exit()
-    
-    cmdline = "cat %s " %(infile)
-    for inp in sys.argv[3:]:
-        cmdline = cmdline + inp + " "
-    cmdline = cmdline + ">" + outfile
-    try:
-        os.system(cmdline)
-    except:
-        stop_err("Error encountered with cat.")
-        
-if __name__ == "__main__": main()
\ No newline at end of file
--- a/catWrapper.xml	Tue Mar 03 05:06:43 2015 -0500
+++ b/catWrapper.xml	Fri Sep 25 11:07:07 2015 -0400
@@ -1,11 +1,12 @@
-<tool id="cat_multiple" name="Concatenate multiple datasets" version="0.1">
+<tool id="cat_multiple" name="Concatenate multiple datasets" version="0.2">
     <description>tail-to-head</description>
-    <command interpreter="python">
-        catWrapper.py 
-        $out_file1 
+    <command><![CDATA[
+        cat
         #for $file in $input
-            $file
+            "$file"
         #end for
+        > "$out_file1"
+        ]]>
     </command>
     <inputs>
         <param name="input" type="data" label="Concatenate Dataset" multiple="True"/>
@@ -21,48 +22,49 @@
     </tests>
     <help>
 
-.. class:: warningmark
+        .. class:: warningmark
 
-**WARNING:** Be careful not to concatenate datasets of different kinds (e.g., sequences with intervals). This tool does not check if the datasets being concatenated are in the same format. 
+        **WARNING:** Be careful not to concatenate datasets of different kinds (e.g., sequences with intervals). This
+        tool does not check if the datasets being concatenated are in the same format.
 
------
+        -----
 
-**What it does**
+        **What it does**
 
-Concatenates datasets
+        Concatenates datasets
 
------
+        -----
 
-**Example**
+        **Example**
 
-Concatenating Dataset::
+        Concatenating Dataset::
 
-    chrX  151087187  151087355  A  0  -
-    chrX  151572400  151572481  B  0  +
+        chrX 151087187 151087355 A 0 -
+        chrX 151572400 151572481 B 0 +
 
-with Dataset1::
+        with Dataset1::
 
-    chr1  151242630  151242955  X  0  +
-    chr1  151271715  151271999  Y  0  +
-    chr1  151278832  151279227  Z  0  -
-    
-and with Dataset2::
+        chr1 151242630 151242955 X 0 +
+        chr1 151271715 151271999 Y 0 +
+        chr1 151278832 151279227 Z 0 -
 
-    chr2  100000030  200000955  P  0  +
-    chr2  100000015  200000999  Q  0  +
+        and with Dataset2::
 
-will result in the following::
+        chr2 100000030 200000955 P 0 +
+        chr2 100000015 200000999 Q 0 +
+
+        will result in the following::
 
-    chrX  151087187  151087355  A  0  -
-    chrX  151572400  151572481  B  0  +
-    chr1  151242630  151242955  X  0  +
-    chr1  151271715  151271999  Y  0  +
-    chr1  151278832  151279227  Z  0  -
-    chr2  100000030  200000955  P  0  +
-    chr2  100000015  200000999  Q  0  +
+        chrX 151087187 151087355 A 0 -
+        chrX 151572400 151572481 B 0 +
+        chr1 151242630 151242955 X 0 +
+        chr1 151271715 151271999 Y 0 +
+        chr1 151278832 151279227 Z 0 -
+        chr2 100000030 200000955 P 0 +
+        chr2 100000015 200000999 Q 0 +
 
------
+        -----
 
-Adapted from the concatenate tool that comes with galaxy.
+        Adapted from the concatenate tool that comes with galaxy.
     </help>
 </tool>