changeset 17:f46f0e4f75c4 draft

"planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/text_processing/text_processing commit 5f5d5802a961a77ceb092cbdef90d93e29717029-dirty"
author bgruening
date Tue, 22 Jun 2021 16:06:48 +0000
parents ddf54b12c295
children d698c222f354
files cat.xml sort_rows.xml unfold_column.py
diffstat 3 files changed, 21 insertions(+), 14 deletions(-) [+]
line wrap: on
line diff
--- a/cat.xml	Tue Oct 06 09:47:04 2020 +0000
+++ b/cat.xml	Tue Jun 22 16:06:48 2021 +0000
@@ -1,4 +1,4 @@
-<tool id="tp_cat" name="Concatenate datasets" version="0.1.0">
+<tool id="tp_cat" name="Concatenate datasets" version="0.1.1">
     <description>tail-to-head (cat)</description>
     <macros>
         <import>macros.xml</import>
@@ -11,12 +11,15 @@
     </version_command>
     <command>
     <![CDATA[
-        cat
-            #echo ' '.join(['"%s"' % $file for $file in $inputs])#
+            #for $file in $inputs:
+                cat '$file' >> '$out_file1' &&
+            #end for
             #for $q in $queries:
-                #echo ' '.join(['"%s"' % $file for $file in $q.inputs2])#
+                #for $file in $q.inputs2:
+                    cat '$file' >> '$out_file1' &&
+                #end for
             #end for
-        > $out_file1
+            exit 0
     ]]></command>
     <inputs>
         <param name="inputs" multiple="true" type="data" format="txt,fastq.gz,fasta.gz,genbank.gz,tabular.gz" label="Datasets to concatenate"/>
--- a/sort_rows.xml	Tue Oct 06 09:47:04 2020 +0000
+++ b/sort_rows.xml	Tue Jun 22 16:06:48 2021 +0000
@@ -1,11 +1,11 @@
-<tool id="tp_sort_rows" name="Sort a row" version="@BASE_VERSION@.0">
+<tool id="tp_sort_rows" name="Sort a row" version="@BASE_VERSION@.0+galaxy0">
     <description>according to their columns</description>
     <macros>
         <import>macros.xml</import>
     </macros>
     <command>
 <![CDATA[
-    python -c 'for line in ( "\t".join(sorted(line.strip().split("\t"))) for line in open("$infile") ): print line' > $outfile
+    python -c 'for line in ( "\t".join(sorted(line.strip().split("\t"))) for line in open("$infile") ): print(line)' > $outfile
 ]]>
     </command>
     <inputs>
--- a/unfold_column.py	Tue Oct 06 09:47:04 2020 +0000
+++ b/unfold_column.py	Tue Jun 22 16:06:48 2021 +0000
@@ -2,18 +2,22 @@
 
 import sys
 
-out = open(sys.argv[4], 'w+')
+out = open(sys.argv[4], "w+")
 
 sep = sys.argv[3]
 # un-sanitize Galaxy inputs
-if sep == 'X':
-    sep = ';'
+if sep == "X":
+    sep = ";"
 
 with open(sys.argv[1]) as handle:
     for line in handle:
-        cols = line.split('\t')
+        cols = line.split("\t")
         unfolding_column = int(sys.argv[2]) - 1
-        column_content = cols[ unfolding_column ]
-        for elem in column_content.split( sep ):
-            out.write( '\t'.join( cols[:unfolding_column] + [elem] + cols[unfolding_column+1:]) )
+        column_content = cols[unfolding_column]
+        for elem in column_content.split(sep):
+            out.write(
+                "\t".join(
+                    cols[:unfolding_column] + [elem] + cols[unfolding_column + 1:]
+                )
+            )
 out.close()