Mercurial > repos > bgruening > text_processing
changeset 24:5fef6d08de83 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:03:26 +0000 |
parents | 28b4fd1b0e9a |
children | cd83b5644eab |
files | awk.xml cat.xml sort_rows.xml unfold_column.py |
diffstat | 4 files changed, 25 insertions(+), 18 deletions(-) [+] |
line wrap: on
line diff
--- a/awk.xml Sun May 17 16:20:08 2020 +0000 +++ b/awk.xml Tue Jun 22 16:03:26 2021 +0000 @@ -1,4 +1,4 @@ -<tool id="tp_awk_tool" name="Text reformatting" version="@BASE_VERSION@.1"> +<tool id="tp_awk_tool" name="Text reformatting" version="@BASE_VERSION@.2"> <description>with awk</description> <macros> <import>macros.xml</import> @@ -10,7 +10,7 @@ <command> <![CDATA[ env -i - awk + \$(which awk) --sandbox -v FS=' ' -v OFS=' '
--- a/cat.xml Sun May 17 16:20:08 2020 +0000 +++ b/cat.xml Tue Jun 22 16:03:26 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,17 +11,20 @@ </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" label="Datasets to concatenate"/> + <param name="inputs" multiple="true" type="data" format="txt,fastq.gz,fasta.gz,genbank.gz,tabular.gz" label="Datasets to concatenate"/> <repeat name="queries" title="Dataset"> - <param name="inputs2" type="data" format="txt" multiple="True" label="Select" /> + <param name="inputs2" type="data" format="txt,fastq.gz,fasta.gz,genbank.gz,tabular.gz" multiple="True" label="Select" /> </repeat> </inputs> <outputs>
--- a/sort_rows.xml Sun May 17 16:20:08 2020 +0000 +++ b/sort_rows.xml Tue Jun 22 16:03:26 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 Sun May 17 16:20:08 2020 +0000 +++ b/unfold_column.py Tue Jun 22 16:03:26 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()