Source code

Download source archive ↓

upstream-extended/community/tools/text_processing/text_processing/sort_rows.xml

1<tool id="tp_sort_rows" name="Sort a row" version="@TOOL_VERSION@+galaxy@VERSION_SUFFIX@" profile="@PROFILE@">
2    <description>according to their columns</description>
3    <macros>
4        <import>macros.xml</import>
5    </macros>
6    <expand macro="creator"/>
7    <requirements>
8        <requirement type="package" version="3.12">python</requirement>
9    </requirements>
10    <command>
11<![CDATA[
12    python -c 'for line in ( "\t".join(sorted(line.strip().split("\t"))) for line in open("$infile") ): print(line)' > '$outfile'
13]]>
14    </command>
15    <inputs>
16        <param format="tabular" name="infile" type="data" label="Tabular file that should be sorted"/>
17    </inputs>
18    <outputs>
19        <data name="outfile" format_source="infile" metadata_source="infile"/>
20    </outputs>
21    <tests>
22        <test>
23            <param name="infile" value="sort_rows1.tabular" ftype="tabular" />
24            <output name="outfile" file="sort_rows_results1.bed"/>
25        </test>
26    </tests>
27    <help>
28<![CDATA[
29.. class:: infomark
30
31**TIP:** If your data is not TAB delimited, use *Text Manipulation->Convert*
32
33**What it does**
34
35That tool sorts each row in a TAB separated file, according to their columns. In other words: It is a sorted reordering of all columns.
36
37]]>
38    </help>
39    <expand macro="citations" />
40</tool>