annotate sort.xml @ 25:ab83aa685821 draft default tip

planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/text_processing/text_processing commit 28d2fcf2649b999762fbd94bd648485b916f2f0d
author bgruening
date Sat, 17 Jan 2026 00:57:38 +0000
parents c41d78ae5fee
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
19
12615d397df7 planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/text_processing/text_processing commit 70980e329cd9fa78e74bf14a76fd4ded9bd2b91f
bgruening
parents: 11
diff changeset
1 <tool id="tp_sort_header_tool" name="Sort" version="@TOOL_VERSION@+galaxy@VERSION_SUFFIX@" profile="@PROFILE@">
0
5314e5d6f040 Imported from capsule None
bgruening
parents:
diff changeset
2 <description>data in ascending or descending order</description>
5314e5d6f040 Imported from capsule None
bgruening
parents:
diff changeset
3 <macros>
5314e5d6f040 Imported from capsule None
bgruening
parents:
diff changeset
4 <import>macros.xml</import>
5314e5d6f040 Imported from capsule None
bgruening
parents:
diff changeset
5 </macros>
19
12615d397df7 planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/text_processing/text_processing commit 70980e329cd9fa78e74bf14a76fd4ded9bd2b91f
bgruening
parents: 11
diff changeset
6 <expand macro="creator"/>
0
5314e5d6f040 Imported from capsule None
bgruening
parents:
diff changeset
7 <expand macro="requirements">
25
ab83aa685821 planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/text_processing/text_processing commit 28d2fcf2649b999762fbd94bd648485b916f2f0d
bgruening
parents: 24
diff changeset
8 <requirement type="package" version="4.9">sed</requirement>
0
5314e5d6f040 Imported from capsule None
bgruening
parents:
diff changeset
9 </expand>
5314e5d6f040 Imported from capsule None
bgruening
parents:
diff changeset
10 <version_command>sort --version | head -n 1</version_command>
5314e5d6f040 Imported from capsule None
bgruening
parents:
diff changeset
11 <command>
5314e5d6f040 Imported from capsule None
bgruening
parents:
diff changeset
12 <![CDATA[
5314e5d6f040 Imported from capsule None
bgruening
parents:
diff changeset
13 (
24
c41d78ae5fee planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/text_processing/text_processing commit 4dd118c84ed4d6157303e71438c24446ec4b4f31
bgruening
parents: 22
diff changeset
14 export LC_ALL=C;
0
5314e5d6f040 Imported from capsule None
bgruening
parents:
diff changeset
15 #if int($header) > 0:
5314e5d6f040 Imported from capsule None
bgruening
parents:
diff changeset
16 sed -u '${header}'q &&
5314e5d6f040 Imported from capsule None
bgruening
parents:
diff changeset
17 #end if
5314e5d6f040 Imported from capsule None
bgruening
parents:
diff changeset
18
25
ab83aa685821 planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/text_processing/text_processing commit 28d2fcf2649b999762fbd94bd648485b916f2f0d
bgruening
parents: 24
diff changeset
19 sort $unique --stable -t ' '
0
5314e5d6f040 Imported from capsule None
bgruening
parents:
diff changeset
20
5314e5d6f040 Imported from capsule None
bgruening
parents:
diff changeset
21 #for $key in $sortkeys:
25
ab83aa685821 planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/text_processing/text_processing commit 28d2fcf2649b999762fbd94bd648485b916f2f0d
bgruening
parents: 24
diff changeset
22 #if $key.start_charpos and $key.end_charpos:
ab83aa685821 planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/text_processing/text_processing commit 28d2fcf2649b999762fbd94bd648485b916f2f0d
bgruening
parents: 24
diff changeset
23 -k ${key.column}.${key.start_charpos}${key.ignore_leading_blanks},${key.column}.${key.end_charpos}${key.ignore_leading_blanks}${key.order}${key.style}${key.ignore_case}
ab83aa685821 planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/text_processing/text_processing commit 28d2fcf2649b999762fbd94bd648485b916f2f0d
bgruening
parents: 24
diff changeset
24 #elif $key.start_charpos:
ab83aa685821 planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/text_processing/text_processing commit 28d2fcf2649b999762fbd94bd648485b916f2f0d
bgruening
parents: 24
diff changeset
25 -k ${key.column}.${key.start_charpos}${key.ignore_leading_blanks},${key.column}${key.order}${key.style}${key.ignore_case}
ab83aa685821 planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/text_processing/text_processing commit 28d2fcf2649b999762fbd94bd648485b916f2f0d
bgruening
parents: 24
diff changeset
26 #elif $key.end_charpos:
ab83aa685821 planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/text_processing/text_processing commit 28d2fcf2649b999762fbd94bd648485b916f2f0d
bgruening
parents: 24
diff changeset
27 -k ${key.column}${key.ignore_leading_blanks},${key.column}.${key.end_charpos}${key.ignore_leading_blanks}${key.order}${key.style}${key.ignore_case}
ab83aa685821 planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/text_processing/text_processing commit 28d2fcf2649b999762fbd94bd648485b916f2f0d
bgruening
parents: 24
diff changeset
28 #else:
ab83aa685821 planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/text_processing/text_processing commit 28d2fcf2649b999762fbd94bd648485b916f2f0d
bgruening
parents: 24
diff changeset
29 -k ${key.column}${key.ignore_leading_blanks},${key.column}${key.order}${key.style}${key.ignore_case}
ab83aa685821 planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/text_processing/text_processing commit 28d2fcf2649b999762fbd94bd648485b916f2f0d
bgruening
parents: 24
diff changeset
30 #end if
0
5314e5d6f040 Imported from capsule None
bgruening
parents:
diff changeset
31 #end for
5314e5d6f040 Imported from capsule None
bgruening
parents:
diff changeset
32
5314e5d6f040 Imported from capsule None
bgruening
parents:
diff changeset
33 ) < '${infile}' > '${outfile}'
5314e5d6f040 Imported from capsule None
bgruening
parents:
diff changeset
34 ]]>
5314e5d6f040 Imported from capsule None
bgruening
parents:
diff changeset
35 </command>
5314e5d6f040 Imported from capsule None
bgruening
parents:
diff changeset
36 <inputs>
5314e5d6f040 Imported from capsule None
bgruening
parents:
diff changeset
37 <param format="tabular" name="infile" type="data" label="Sort Query" />
3
37e1eb05b1b4 planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/text_processing/text_processing commit 10052765d6b712cf7d38356af4251fcc38a339b6-dirty
bgruening
parents: 1
diff changeset
38 <param name="header" type="integer" value="0"
25
ab83aa685821 planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/text_processing/text_processing commit 28d2fcf2649b999762fbd94bd648485b916f2f0d
bgruening
parents: 24
diff changeset
39 label="Number of header lines" help="Header lines will be copied to the output unchanged without operating on them.">
0
5314e5d6f040 Imported from capsule None
bgruening
parents:
diff changeset
40 <validator type="in_range" message="Negative values are not allowed." min="0"/>
5314e5d6f040 Imported from capsule None
bgruening
parents:
diff changeset
41 </param>
25
ab83aa685821 planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/text_processing/text_processing commit 28d2fcf2649b999762fbd94bd648485b916f2f0d
bgruening
parents: 24
diff changeset
42
0
5314e5d6f040 Imported from capsule None
bgruening
parents:
diff changeset
43 <repeat name="sortkeys" title="Column selections" min="1">
25
ab83aa685821 planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/text_processing/text_processing commit 28d2fcf2649b999762fbd94bd648485b916f2f0d
bgruening
parents: 24
diff changeset
44 <param name="column" label="Sort on column" type="data_column" data_ref="infile" accept_default="true" />
ab83aa685821 planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/text_processing/text_processing commit 28d2fcf2649b999762fbd94bd648485b916f2f0d
bgruening
parents: 24
diff changeset
45 <param name="start_charpos" label="considering its characters from" type="integer" min="1" optional="true" help="Leave empty (or set to 1) to use the column value starting from its first character." />
ab83aa685821 planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/text_processing/text_processing commit 28d2fcf2649b999762fbd94bd648485b916f2f0d
bgruening
parents: 24
diff changeset
46 <param name="end_charpos" label="to and including" type="integer" min="1" optional="true" help="Leave empty to use the column value up to and including its last character." />
0
5314e5d6f040 Imported from capsule None
bgruening
parents:
diff changeset
47 <param name="order" type="select" display="radio" label="in">
5314e5d6f040 Imported from capsule None
bgruening
parents:
diff changeset
48 <option value="">Ascending order</option>
5314e5d6f040 Imported from capsule None
bgruening
parents:
diff changeset
49 <option value="r">Descending order</option>
5314e5d6f040 Imported from capsule None
bgruening
parents:
diff changeset
50 </param>
25
ab83aa685821 planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/text_processing/text_processing commit 28d2fcf2649b999762fbd94bd648485b916f2f0d
bgruening
parents: 24
diff changeset
51 <param name="style" type="select" display="radio" label="using sort flavor">
0
5314e5d6f040 Imported from capsule None
bgruening
parents:
diff changeset
52 <option value="n">Fast numeric sort (-n)</option>
5314e5d6f040 Imported from capsule None
bgruening
parents:
diff changeset
53 <option value="g">General numeric sort ( scientific notation -g)</option>
5314e5d6f040 Imported from capsule None
bgruening
parents:
diff changeset
54 <option value="V">Natural/Version sort (-V) </option>
5314e5d6f040 Imported from capsule None
bgruening
parents:
diff changeset
55 <option value="">Alphabetical sort</option>
5314e5d6f040 Imported from capsule None
bgruening
parents:
diff changeset
56 <option value="h">Human-readable numbers (-h)</option>
5314e5d6f040 Imported from capsule None
bgruening
parents:
diff changeset
57 <option value="R">Random order (-R)</option>
5314e5d6f040 Imported from capsule None
bgruening
parents:
diff changeset
58 </param>
25
ab83aa685821 planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/text_processing/text_processing commit 28d2fcf2649b999762fbd94bd648485b916f2f0d
bgruening
parents: 24
diff changeset
59 <param name="ignore_case" type="boolean" checked="false" truevalue="f" falsevalue=""
ab83aa685821 planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/text_processing/text_processing commit 28d2fcf2649b999762fbd94bd648485b916f2f0d
bgruening
parents: 24
diff changeset
60 label="ignoring case" help="Turn lowercase symbols to upper case before comparing values in this column. (-f)" />
ab83aa685821 planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/text_processing/text_processing commit 28d2fcf2649b999762fbd94bd648485b916f2f0d
bgruening
parents: 24
diff changeset
61 <param name="ignore_leading_blanks" type="boolean" checked="false" truevalue="b" falsevalue=""
ab83aa685821 planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/text_processing/text_processing commit 28d2fcf2649b999762fbd94bd648485b916f2f0d
bgruening
parents: 24
diff changeset
62 label="ignoring leading blanks" help="This option can be useful with Alphabetical and Natural sort (which treat spaces as actual characters) or to prevent unwanted offsets if you specified a range of character positions to consider." />
0
5314e5d6f040 Imported from capsule None
bgruening
parents:
diff changeset
63 </repeat>
5314e5d6f040 Imported from capsule None
bgruening
parents:
diff changeset
64
5314e5d6f040 Imported from capsule None
bgruening
parents:
diff changeset
65 <param name="unique" type="boolean" checked="false" truevalue="--unique" falsevalue=""
5314e5d6f040 Imported from capsule None
bgruening
parents:
diff changeset
66 label="Output unique values" help="Print only unique values, based on sorted key columns. See help section for details. (--unique)" />
5314e5d6f040 Imported from capsule None
bgruening
parents:
diff changeset
67 </inputs>
5314e5d6f040 Imported from capsule None
bgruening
parents:
diff changeset
68 <outputs>
5314e5d6f040 Imported from capsule None
bgruening
parents:
diff changeset
69 <data name="outfile" format_source="infile" metadata_source="infile"/>
5314e5d6f040 Imported from capsule None
bgruening
parents:
diff changeset
70 </outputs>
5314e5d6f040 Imported from capsule None
bgruening
parents:
diff changeset
71 <tests>
25
ab83aa685821 planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/text_processing/text_processing commit 28d2fcf2649b999762fbd94bd648485b916f2f0d
bgruening
parents: 24
diff changeset
72 <test expect_num_outputs="1">
0
5314e5d6f040 Imported from capsule None
bgruening
parents:
diff changeset
73 <param name="infile" value="sort1.bed"/>
5314e5d6f040 Imported from capsule None
bgruening
parents:
diff changeset
74 <param name="header" value="3"/>
5314e5d6f040 Imported from capsule None
bgruening
parents:
diff changeset
75 <repeat name="sortkeys">
5314e5d6f040 Imported from capsule None
bgruening
parents:
diff changeset
76 <param name="column" value="1"/>
5314e5d6f040 Imported from capsule None
bgruening
parents:
diff changeset
77 <param name="style" value=""/>
5314e5d6f040 Imported from capsule None
bgruening
parents:
diff changeset
78 <param name="order" value=""/>
5314e5d6f040 Imported from capsule None
bgruening
parents:
diff changeset
79 </repeat>
5314e5d6f040 Imported from capsule None
bgruening
parents:
diff changeset
80 <repeat name="sortkeys">
5314e5d6f040 Imported from capsule None
bgruening
parents:
diff changeset
81 <param name="column" value="3"/>
5314e5d6f040 Imported from capsule None
bgruening
parents:
diff changeset
82 <param name="style" value="n"/>
5314e5d6f040 Imported from capsule None
bgruening
parents:
diff changeset
83 <param name="order" value="r"/>
5314e5d6f040 Imported from capsule None
bgruening
parents:
diff changeset
84 </repeat>
5314e5d6f040 Imported from capsule None
bgruening
parents:
diff changeset
85 <output name="outfile" file="sort_result1.bed"/>
5314e5d6f040 Imported from capsule None
bgruening
parents:
diff changeset
86 </test>
25
ab83aa685821 planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/text_processing/text_processing commit 28d2fcf2649b999762fbd94bd648485b916f2f0d
bgruening
parents: 24
diff changeset
87 <test expect_num_outputs="1">
0
5314e5d6f040 Imported from capsule None
bgruening
parents:
diff changeset
88 <param name="infile" value="sort1.bed"/>
5314e5d6f040 Imported from capsule None
bgruening
parents:
diff changeset
89 <param name="header" value="3"/>
5314e5d6f040 Imported from capsule None
bgruening
parents:
diff changeset
90 <repeat name="sortkeys">
5314e5d6f040 Imported from capsule None
bgruening
parents:
diff changeset
91 <param name="column" value="1"/>
5314e5d6f040 Imported from capsule None
bgruening
parents:
diff changeset
92 <param name="style" value=""/>
1
43b1f073b693 planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/text_processing/text_processing commit 369e40078146d00608d52205bb8cee66ae735b76-dirty
bgruening
parents: 0
diff changeset
93 <param name="order" value=""/>
0
5314e5d6f040 Imported from capsule None
bgruening
parents:
diff changeset
94 </repeat>
5314e5d6f040 Imported from capsule None
bgruening
parents:
diff changeset
95 <repeat name="sortkeys">
5314e5d6f040 Imported from capsule None
bgruening
parents:
diff changeset
96 <param name="column" value="3"/>
5314e5d6f040 Imported from capsule None
bgruening
parents:
diff changeset
97 <param name="style" value="n"/>
5314e5d6f040 Imported from capsule None
bgruening
parents:
diff changeset
98 <param name="order" value=""/>
5314e5d6f040 Imported from capsule None
bgruening
parents:
diff changeset
99 </repeat>
5314e5d6f040 Imported from capsule None
bgruening
parents:
diff changeset
100 <output name="outfile" file="sort_result2.bed"/>
5314e5d6f040 Imported from capsule None
bgruening
parents:
diff changeset
101 </test>
25
ab83aa685821 planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/text_processing/text_processing commit 28d2fcf2649b999762fbd94bd648485b916f2f0d
bgruening
parents: 24
diff changeset
102 <test expect_num_outputs="1">
0
5314e5d6f040 Imported from capsule None
bgruening
parents:
diff changeset
103 <param name="infile" value="sort2.bed"/>
5314e5d6f040 Imported from capsule None
bgruening
parents:
diff changeset
104 <repeat name="sortkeys">
5314e5d6f040 Imported from capsule None
bgruening
parents:
diff changeset
105 <param name="column" value="5"/>
5314e5d6f040 Imported from capsule None
bgruening
parents:
diff changeset
106 <param name="style" value="g"/>
5314e5d6f040 Imported from capsule None
bgruening
parents:
diff changeset
107 <param name="order" value=""/>
5314e5d6f040 Imported from capsule None
bgruening
parents:
diff changeset
108 </repeat>
5314e5d6f040 Imported from capsule None
bgruening
parents:
diff changeset
109 <output name="outfile" file="sort_result3.bed"/>
5314e5d6f040 Imported from capsule None
bgruening
parents:
diff changeset
110 </test>
25
ab83aa685821 planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/text_processing/text_processing commit 28d2fcf2649b999762fbd94bd648485b916f2f0d
bgruening
parents: 24
diff changeset
111 <test expect_num_outputs="1">
ab83aa685821 planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/text_processing/text_processing commit 28d2fcf2649b999762fbd94bd648485b916f2f0d
bgruening
parents: 24
diff changeset
112 <param name="infile" value="sort3.tabular"/>
ab83aa685821 planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/text_processing/text_processing commit 28d2fcf2649b999762fbd94bd648485b916f2f0d
bgruening
parents: 24
diff changeset
113 <param name="header" value="0"/>
ab83aa685821 planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/text_processing/text_processing commit 28d2fcf2649b999762fbd94bd648485b916f2f0d
bgruening
parents: 24
diff changeset
114 <param name="unique" value="false"/>
ab83aa685821 planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/text_processing/text_processing commit 28d2fcf2649b999762fbd94bd648485b916f2f0d
bgruening
parents: 24
diff changeset
115 <repeat name="sortkeys">
ab83aa685821 planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/text_processing/text_processing commit 28d2fcf2649b999762fbd94bd648485b916f2f0d
bgruening
parents: 24
diff changeset
116 <param name="column" value="2"/>
ab83aa685821 planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/text_processing/text_processing commit 28d2fcf2649b999762fbd94bd648485b916f2f0d
bgruening
parents: 24
diff changeset
117 <param name="start_charpos" value="7"/>
ab83aa685821 planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/text_processing/text_processing commit 28d2fcf2649b999762fbd94bd648485b916f2f0d
bgruening
parents: 24
diff changeset
118 <param name="order" value=""/>
ab83aa685821 planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/text_processing/text_processing commit 28d2fcf2649b999762fbd94bd648485b916f2f0d
bgruening
parents: 24
diff changeset
119 <param name="style" value="n"/>
ab83aa685821 planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/text_processing/text_processing commit 28d2fcf2649b999762fbd94bd648485b916f2f0d
bgruening
parents: 24
diff changeset
120 </repeat>
ab83aa685821 planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/text_processing/text_processing commit 28d2fcf2649b999762fbd94bd648485b916f2f0d
bgruening
parents: 24
diff changeset
121 <repeat name="sortkeys">
ab83aa685821 planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/text_processing/text_processing commit 28d2fcf2649b999762fbd94bd648485b916f2f0d
bgruening
parents: 24
diff changeset
122 <param name="column" value="2"/>
ab83aa685821 planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/text_processing/text_processing commit 28d2fcf2649b999762fbd94bd648485b916f2f0d
bgruening
parents: 24
diff changeset
123 <param name="start_charpos" value="4"/>
ab83aa685821 planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/text_processing/text_processing commit 28d2fcf2649b999762fbd94bd648485b916f2f0d
bgruening
parents: 24
diff changeset
124 <param name="end_charpos" value="5"/>
ab83aa685821 planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/text_processing/text_processing commit 28d2fcf2649b999762fbd94bd648485b916f2f0d
bgruening
parents: 24
diff changeset
125 <param name="order" value=""/>
ab83aa685821 planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/text_processing/text_processing commit 28d2fcf2649b999762fbd94bd648485b916f2f0d
bgruening
parents: 24
diff changeset
126 <param name="style" value="n"/>
ab83aa685821 planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/text_processing/text_processing commit 28d2fcf2649b999762fbd94bd648485b916f2f0d
bgruening
parents: 24
diff changeset
127 </repeat>
ab83aa685821 planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/text_processing/text_processing commit 28d2fcf2649b999762fbd94bd648485b916f2f0d
bgruening
parents: 24
diff changeset
128 <repeat name="sortkeys">
ab83aa685821 planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/text_processing/text_processing commit 28d2fcf2649b999762fbd94bd648485b916f2f0d
bgruening
parents: 24
diff changeset
129 <param name="column" value="2"/>
ab83aa685821 planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/text_processing/text_processing commit 28d2fcf2649b999762fbd94bd648485b916f2f0d
bgruening
parents: 24
diff changeset
130 <param name="start_charpos" value="1"/>
ab83aa685821 planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/text_processing/text_processing commit 28d2fcf2649b999762fbd94bd648485b916f2f0d
bgruening
parents: 24
diff changeset
131 <param name="end_charpos" value="2"/>
ab83aa685821 planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/text_processing/text_processing commit 28d2fcf2649b999762fbd94bd648485b916f2f0d
bgruening
parents: 24
diff changeset
132 <param name="order" value="r"/>
ab83aa685821 planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/text_processing/text_processing commit 28d2fcf2649b999762fbd94bd648485b916f2f0d
bgruening
parents: 24
diff changeset
133 <param name="style" value="n"/>
ab83aa685821 planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/text_processing/text_processing commit 28d2fcf2649b999762fbd94bd648485b916f2f0d
bgruening
parents: 24
diff changeset
134 </repeat>
ab83aa685821 planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/text_processing/text_processing commit 28d2fcf2649b999762fbd94bd648485b916f2f0d
bgruening
parents: 24
diff changeset
135 <output name="outfile" file="sorted3.tabular" ftype="tabular" />
ab83aa685821 planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/text_processing/text_processing commit 28d2fcf2649b999762fbd94bd648485b916f2f0d
bgruening
parents: 24
diff changeset
136 </test>
ab83aa685821 planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/text_processing/text_processing commit 28d2fcf2649b999762fbd94bd648485b916f2f0d
bgruening
parents: 24
diff changeset
137 <!-- Test ignore_case param -->
ab83aa685821 planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/text_processing/text_processing commit 28d2fcf2649b999762fbd94bd648485b916f2f0d
bgruening
parents: 24
diff changeset
138 <test expect_num_outputs="1">
ab83aa685821 planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/text_processing/text_processing commit 28d2fcf2649b999762fbd94bd648485b916f2f0d
bgruening
parents: 24
diff changeset
139 <param name="infile" value="sort4.tabular"/>
ab83aa685821 planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/text_processing/text_processing commit 28d2fcf2649b999762fbd94bd648485b916f2f0d
bgruening
parents: 24
diff changeset
140 <param name="header" value="1"/>
ab83aa685821 planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/text_processing/text_processing commit 28d2fcf2649b999762fbd94bd648485b916f2f0d
bgruening
parents: 24
diff changeset
141 <param name="unique" value="false"/>
ab83aa685821 planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/text_processing/text_processing commit 28d2fcf2649b999762fbd94bd648485b916f2f0d
bgruening
parents: 24
diff changeset
142 <repeat name="sortkeys">
ab83aa685821 planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/text_processing/text_processing commit 28d2fcf2649b999762fbd94bd648485b916f2f0d
bgruening
parents: 24
diff changeset
143 <param name="column" value="1"/>
ab83aa685821 planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/text_processing/text_processing commit 28d2fcf2649b999762fbd94bd648485b916f2f0d
bgruening
parents: 24
diff changeset
144 <param name="order" value=""/>
ab83aa685821 planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/text_processing/text_processing commit 28d2fcf2649b999762fbd94bd648485b916f2f0d
bgruening
parents: 24
diff changeset
145 <param name="style" value=""/>
ab83aa685821 planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/text_processing/text_processing commit 28d2fcf2649b999762fbd94bd648485b916f2f0d
bgruening
parents: 24
diff changeset
146 <param name="ignore_case" value="true"/>
ab83aa685821 planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/text_processing/text_processing commit 28d2fcf2649b999762fbd94bd648485b916f2f0d
bgruening
parents: 24
diff changeset
147 </repeat>
ab83aa685821 planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/text_processing/text_processing commit 28d2fcf2649b999762fbd94bd648485b916f2f0d
bgruening
parents: 24
diff changeset
148 <repeat name="sortkeys">
ab83aa685821 planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/text_processing/text_processing commit 28d2fcf2649b999762fbd94bd648485b916f2f0d
bgruening
parents: 24
diff changeset
149 <param name="column" value="3"/>
ab83aa685821 planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/text_processing/text_processing commit 28d2fcf2649b999762fbd94bd648485b916f2f0d
bgruening
parents: 24
diff changeset
150 <param name="order" value="r"/>
ab83aa685821 planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/text_processing/text_processing commit 28d2fcf2649b999762fbd94bd648485b916f2f0d
bgruening
parents: 24
diff changeset
151 <param name="style" value="n"/>
ab83aa685821 planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/text_processing/text_processing commit 28d2fcf2649b999762fbd94bd648485b916f2f0d
bgruening
parents: 24
diff changeset
152 </repeat>
ab83aa685821 planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/text_processing/text_processing commit 28d2fcf2649b999762fbd94bd648485b916f2f0d
bgruening
parents: 24
diff changeset
153 <output name="outfile" file="sorted4_partial.tabular" ftype="tabular" />
ab83aa685821 planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/text_processing/text_processing commit 28d2fcf2649b999762fbd94bd648485b916f2f0d
bgruening
parents: 24
diff changeset
154 </test>
ab83aa685821 planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/text_processing/text_processing commit 28d2fcf2649b999762fbd94bd648485b916f2f0d
bgruening
parents: 24
diff changeset
155 <!-- Test ignore_leading_blanks param -->
ab83aa685821 planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/text_processing/text_processing commit 28d2fcf2649b999762fbd94bd648485b916f2f0d
bgruening
parents: 24
diff changeset
156 <test expect_num_outputs="1">
ab83aa685821 planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/text_processing/text_processing commit 28d2fcf2649b999762fbd94bd648485b916f2f0d
bgruening
parents: 24
diff changeset
157 <param name="infile" value="sort4.tabular"/>
ab83aa685821 planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/text_processing/text_processing commit 28d2fcf2649b999762fbd94bd648485b916f2f0d
bgruening
parents: 24
diff changeset
158 <param name="header" value="1"/>
ab83aa685821 planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/text_processing/text_processing commit 28d2fcf2649b999762fbd94bd648485b916f2f0d
bgruening
parents: 24
diff changeset
159 <param name="unique" value="false"/>
ab83aa685821 planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/text_processing/text_processing commit 28d2fcf2649b999762fbd94bd648485b916f2f0d
bgruening
parents: 24
diff changeset
160 <repeat name="sortkeys">
ab83aa685821 planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/text_processing/text_processing commit 28d2fcf2649b999762fbd94bd648485b916f2f0d
bgruening
parents: 24
diff changeset
161 <param name="column" value="1"/>
ab83aa685821 planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/text_processing/text_processing commit 28d2fcf2649b999762fbd94bd648485b916f2f0d
bgruening
parents: 24
diff changeset
162 <param name="start_charpos" value="1"/>
ab83aa685821 planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/text_processing/text_processing commit 28d2fcf2649b999762fbd94bd648485b916f2f0d
bgruening
parents: 24
diff changeset
163 <param name="end_charpos" value="4"/>
ab83aa685821 planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/text_processing/text_processing commit 28d2fcf2649b999762fbd94bd648485b916f2f0d
bgruening
parents: 24
diff changeset
164 <param name="order" value=""/>
ab83aa685821 planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/text_processing/text_processing commit 28d2fcf2649b999762fbd94bd648485b916f2f0d
bgruening
parents: 24
diff changeset
165 <param name="style" value=""/>
ab83aa685821 planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/text_processing/text_processing commit 28d2fcf2649b999762fbd94bd648485b916f2f0d
bgruening
parents: 24
diff changeset
166 <param name="ignore_case" value="true"/>
ab83aa685821 planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/text_processing/text_processing commit 28d2fcf2649b999762fbd94bd648485b916f2f0d
bgruening
parents: 24
diff changeset
167 <param name="ignore_leading_blanks" value="true"/>
ab83aa685821 planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/text_processing/text_processing commit 28d2fcf2649b999762fbd94bd648485b916f2f0d
bgruening
parents: 24
diff changeset
168 </repeat>
ab83aa685821 planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/text_processing/text_processing commit 28d2fcf2649b999762fbd94bd648485b916f2f0d
bgruening
parents: 24
diff changeset
169 <repeat name="sortkeys">
ab83aa685821 planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/text_processing/text_processing commit 28d2fcf2649b999762fbd94bd648485b916f2f0d
bgruening
parents: 24
diff changeset
170 <param name="column" value="1"/>
ab83aa685821 planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/text_processing/text_processing commit 28d2fcf2649b999762fbd94bd648485b916f2f0d
bgruening
parents: 24
diff changeset
171 <param name="start_charpos" value="5"/>
ab83aa685821 planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/text_processing/text_processing commit 28d2fcf2649b999762fbd94bd648485b916f2f0d
bgruening
parents: 24
diff changeset
172 <param name="order" value=""/>
ab83aa685821 planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/text_processing/text_processing commit 28d2fcf2649b999762fbd94bd648485b916f2f0d
bgruening
parents: 24
diff changeset
173 <param name="style" value=""/>
ab83aa685821 planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/text_processing/text_processing commit 28d2fcf2649b999762fbd94bd648485b916f2f0d
bgruening
parents: 24
diff changeset
174 <param name="ignore_case" value="true"/>
ab83aa685821 planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/text_processing/text_processing commit 28d2fcf2649b999762fbd94bd648485b916f2f0d
bgruening
parents: 24
diff changeset
175 <param name="ignore_leading_blanks" value="true"/>
ab83aa685821 planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/text_processing/text_processing commit 28d2fcf2649b999762fbd94bd648485b916f2f0d
bgruening
parents: 24
diff changeset
176 </repeat>
ab83aa685821 planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/text_processing/text_processing commit 28d2fcf2649b999762fbd94bd648485b916f2f0d
bgruening
parents: 24
diff changeset
177 <repeat name="sortkeys">
ab83aa685821 planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/text_processing/text_processing commit 28d2fcf2649b999762fbd94bd648485b916f2f0d
bgruening
parents: 24
diff changeset
178 <param name="column" value="3"/>
ab83aa685821 planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/text_processing/text_processing commit 28d2fcf2649b999762fbd94bd648485b916f2f0d
bgruening
parents: 24
diff changeset
179 <param name="order" value="r"/>
ab83aa685821 planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/text_processing/text_processing commit 28d2fcf2649b999762fbd94bd648485b916f2f0d
bgruening
parents: 24
diff changeset
180 <param name="style" value="n"/>
ab83aa685821 planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/text_processing/text_processing commit 28d2fcf2649b999762fbd94bd648485b916f2f0d
bgruening
parents: 24
diff changeset
181 <param name="ignore_leading_blanks" value="true"/>
ab83aa685821 planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/text_processing/text_processing commit 28d2fcf2649b999762fbd94bd648485b916f2f0d
bgruening
parents: 24
diff changeset
182 </repeat>
ab83aa685821 planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/text_processing/text_processing commit 28d2fcf2649b999762fbd94bd648485b916f2f0d
bgruening
parents: 24
diff changeset
183 <output name="outfile" file="sorted4.tabular" ftype="tabular" />
ab83aa685821 planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/text_processing/text_processing commit 28d2fcf2649b999762fbd94bd648485b916f2f0d
bgruening
parents: 24
diff changeset
184 </test>
0
5314e5d6f040 Imported from capsule None
bgruening
parents:
diff changeset
185 </tests>
5314e5d6f040 Imported from capsule None
bgruening
parents:
diff changeset
186 <help>
5314e5d6f040 Imported from capsule None
bgruening
parents:
diff changeset
187 <![CDATA[
5314e5d6f040 Imported from capsule None
bgruening
parents:
diff changeset
188 **What it does**
5314e5d6f040 Imported from capsule None
bgruening
parents:
diff changeset
189
5314e5d6f040 Imported from capsule None
bgruening
parents:
diff changeset
190 This tool sorts an input file.
5314e5d6f040 Imported from capsule None
bgruening
parents:
diff changeset
191
5314e5d6f040 Imported from capsule None
bgruening
parents:
diff changeset
192 -----
5314e5d6f040 Imported from capsule None
bgruening
parents:
diff changeset
193
5314e5d6f040 Imported from capsule None
bgruening
parents:
diff changeset
194 **Sorting Styles**
5314e5d6f040 Imported from capsule None
bgruening
parents:
diff changeset
195
5314e5d6f040 Imported from capsule None
bgruening
parents:
diff changeset
196 * **Fast Numeric**: sort by numeric values. Handles integer values (e.g. 43, 134) and decimal-point values (e.g. 3.14). *Does not* handle scientific notation (e.g. -2.32e2).
5314e5d6f040 Imported from capsule None
bgruening
parents:
diff changeset
197 * **General Numeric**: sort by numeric values. Handles all numeric notations (including scientific notation). Slower than *fast numeric*, so use only when necessary.
5314e5d6f040 Imported from capsule None
bgruening
parents:
diff changeset
198 * **Natural Sort**: Sort in 'natural' order (natural to humans, not to computers). See example below.
5314e5d6f040 Imported from capsule None
bgruening
parents:
diff changeset
199 * **Alphabetical sort**: Sort in strict alphabetical order. See example below.
5314e5d6f040 Imported from capsule None
bgruening
parents:
diff changeset
200 * **Human-readable numbers**: Sort human readble numbers (e.g. 1G > 2M > 3K > 400)
5314e5d6f040 Imported from capsule None
bgruening
parents:
diff changeset
201 * **Random order**: return lines in random order.
5314e5d6f040 Imported from capsule None
bgruening
parents:
diff changeset
202
5314e5d6f040 Imported from capsule None
bgruening
parents:
diff changeset
203 ------
5314e5d6f040 Imported from capsule None
bgruening
parents:
diff changeset
204
5314e5d6f040 Imported from capsule None
bgruening
parents:
diff changeset
205 **Example - Header line**
5314e5d6f040 Imported from capsule None
bgruening
parents:
diff changeset
206
5314e5d6f040 Imported from capsule None
bgruening
parents:
diff changeset
207 **Input file** (note first line is a header line, should not be sorted)::
5314e5d6f040 Imported from capsule None
bgruening
parents:
diff changeset
208
5314e5d6f040 Imported from capsule None
bgruening
parents:
diff changeset
209 Fruit Color Price
5314e5d6f040 Imported from capsule None
bgruening
parents:
diff changeset
210 Banana Yellow 4.1
5314e5d6f040 Imported from capsule None
bgruening
parents:
diff changeset
211 Avocado Green 8.0
5314e5d6f040 Imported from capsule None
bgruening
parents:
diff changeset
212 Apple Red 3.0
5314e5d6f040 Imported from capsule None
bgruening
parents:
diff changeset
213 Melon Green 6.1
5314e5d6f040 Imported from capsule None
bgruening
parents:
diff changeset
214
5314e5d6f040 Imported from capsule None
bgruening
parents:
diff changeset
215 **Sorting** by **numeric order** on column **3**, with **header**, will return::
5314e5d6f040 Imported from capsule None
bgruening
parents:
diff changeset
216
5314e5d6f040 Imported from capsule None
bgruening
parents:
diff changeset
217 Fruit Color Price
5314e5d6f040 Imported from capsule None
bgruening
parents:
diff changeset
218 Apple Red 3.0
5314e5d6f040 Imported from capsule None
bgruening
parents:
diff changeset
219 Banana Yellow 4.1
5314e5d6f040 Imported from capsule None
bgruening
parents:
diff changeset
220 Melon Green 6.1
5314e5d6f040 Imported from capsule None
bgruening
parents:
diff changeset
221 Avocado Green 8.0
5314e5d6f040 Imported from capsule None
bgruening
parents:
diff changeset
222
5314e5d6f040 Imported from capsule None
bgruening
parents:
diff changeset
223
5314e5d6f040 Imported from capsule None
bgruening
parents:
diff changeset
224 -----
5314e5d6f040 Imported from capsule None
bgruening
parents:
diff changeset
225
5314e5d6f040 Imported from capsule None
bgruening
parents:
diff changeset
226 **Example - Natural vs. Alphabetical sorting**
5314e5d6f040 Imported from capsule None
bgruening
parents:
diff changeset
227
5314e5d6f040 Imported from capsule None
bgruening
parents:
diff changeset
228 Given the following list::
5314e5d6f040 Imported from capsule None
bgruening
parents:
diff changeset
229
5314e5d6f040 Imported from capsule None
bgruening
parents:
diff changeset
230 chr4
5314e5d6f040 Imported from capsule None
bgruening
parents:
diff changeset
231 chr13
5314e5d6f040 Imported from capsule None
bgruening
parents:
diff changeset
232 chr1
5314e5d6f040 Imported from capsule None
bgruening
parents:
diff changeset
233 chr10
5314e5d6f040 Imported from capsule None
bgruening
parents:
diff changeset
234 chr20
5314e5d6f040 Imported from capsule None
bgruening
parents:
diff changeset
235 chr2
5314e5d6f040 Imported from capsule None
bgruening
parents:
diff changeset
236
5314e5d6f040 Imported from capsule None
bgruening
parents:
diff changeset
237 **Alphabetical sort** would produce the following sorted list::
5314e5d6f040 Imported from capsule None
bgruening
parents:
diff changeset
238
5314e5d6f040 Imported from capsule None
bgruening
parents:
diff changeset
239 chr1
5314e5d6f040 Imported from capsule None
bgruening
parents:
diff changeset
240 chr10
5314e5d6f040 Imported from capsule None
bgruening
parents:
diff changeset
241 chr13
5314e5d6f040 Imported from capsule None
bgruening
parents:
diff changeset
242 chr2
5314e5d6f040 Imported from capsule None
bgruening
parents:
diff changeset
243 chr20
5314e5d6f040 Imported from capsule None
bgruening
parents:
diff changeset
244 chr4
5314e5d6f040 Imported from capsule None
bgruening
parents:
diff changeset
245
5314e5d6f040 Imported from capsule None
bgruening
parents:
diff changeset
246 **Natural Sort** would produce the following sorted list::
5314e5d6f040 Imported from capsule None
bgruening
parents:
diff changeset
247
5314e5d6f040 Imported from capsule None
bgruening
parents:
diff changeset
248 chr1
5314e5d6f040 Imported from capsule None
bgruening
parents:
diff changeset
249 chr2
5314e5d6f040 Imported from capsule None
bgruening
parents:
diff changeset
250 chr4
5314e5d6f040 Imported from capsule None
bgruening
parents:
diff changeset
251 chr10
5314e5d6f040 Imported from capsule None
bgruening
parents:
diff changeset
252 chr13
5314e5d6f040 Imported from capsule None
bgruening
parents:
diff changeset
253 chr20
5314e5d6f040 Imported from capsule None
bgruening
parents:
diff changeset
254
5314e5d6f040 Imported from capsule None
bgruening
parents:
diff changeset
255
5314e5d6f040 Imported from capsule None
bgruening
parents:
diff changeset
256 .. class:: infomark
5314e5d6f040 Imported from capsule None
bgruening
parents:
diff changeset
257
5314e5d6f040 Imported from capsule None
bgruening
parents:
diff changeset
258 If you're planning to use the file with another tool that expected sorted files (such as *join*), you should use the **Alphabetical sort**, not the **Natural Sort**. Natural sort order is easier for humans, but is unnatural for computer programs.
5314e5d6f040 Imported from capsule None
bgruening
parents:
diff changeset
259
25
ab83aa685821 planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/text_processing/text_processing commit 28d2fcf2649b999762fbd94bd648485b916f2f0d
bgruening
parents: 24
diff changeset
260 -----
ab83aa685821 planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/text_processing/text_processing commit 28d2fcf2649b999762fbd94bd648485b916f2f0d
bgruening
parents: 24
diff changeset
261
ab83aa685821 planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/text_processing/text_processing commit 28d2fcf2649b999762fbd94bd648485b916f2f0d
bgruening
parents: 24
diff changeset
262 **Example - Sorting based on parts of column values**
ab83aa685821 planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/text_processing/text_processing commit 28d2fcf2649b999762fbd94bd648485b916f2f0d
bgruening
parents: 24
diff changeset
263
ab83aa685821 planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/text_processing/text_processing commit 28d2fcf2649b999762fbd94bd648485b916f2f0d
bgruening
parents: 24
diff changeset
264 The above column of chromosomes, with their constant prefix, could have been sorted in natural order also with the **Fast numeric sort** and **considering its characters from** character 4 only.
ab83aa685821 planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/text_processing/text_processing commit 28d2fcf2649b999762fbd94bd648485b916f2f0d
bgruening
parents: 24
diff changeset
265
ab83aa685821 planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/text_processing/text_processing commit 28d2fcf2649b999762fbd94bd648485b916f2f0d
bgruening
parents: 24
diff changeset
266 In general, sorting based on just a range of characters in a column can be useful for sorting values with internal structure, in a single tool run.
ab83aa685821 planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/text_processing/text_processing commit 28d2fcf2649b999762fbd94bd648485b916f2f0d
bgruening
parents: 24
diff changeset
267
ab83aa685821 planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/text_processing/text_processing commit 28d2fcf2649b999762fbd94bd648485b916f2f0d
bgruening
parents: 24
diff changeset
268 Consider, for example, the following column of dates, which is unfortunately not ISO-8601 formatted::
ab83aa685821 planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/text_processing/text_processing commit 28d2fcf2649b999762fbd94bd648485b916f2f0d
bgruening
parents: 24
diff changeset
269
ab83aa685821 planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/text_processing/text_processing commit 28d2fcf2649b999762fbd94bd648485b916f2f0d
bgruening
parents: 24
diff changeset
270 10/24/2025
ab83aa685821 planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/text_processing/text_processing commit 28d2fcf2649b999762fbd94bd648485b916f2f0d
bgruening
parents: 24
diff changeset
271 09/18/1974
ab83aa685821 planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/text_processing/text_processing commit 28d2fcf2649b999762fbd94bd648485b916f2f0d
bgruening
parents: 24
diff changeset
272 12/16/1998
ab83aa685821 planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/text_processing/text_processing commit 28d2fcf2649b999762fbd94bd648485b916f2f0d
bgruening
parents: 24
diff changeset
273 03/04/2007
ab83aa685821 planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/text_processing/text_processing commit 28d2fcf2649b999762fbd94bd648485b916f2f0d
bgruening
parents: 24
diff changeset
274
ab83aa685821 planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/text_processing/text_processing commit 28d2fcf2649b999762fbd94bd648485b916f2f0d
bgruening
parents: 24
diff changeset
275 You could modify these values with other tools first, but you can achieve correct chronological sort order with a single run of the sort tool like this:
ab83aa685821 planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/text_processing/text_processing commit 28d2fcf2649b999762fbd94bd648485b916f2f0d
bgruening
parents: 24
diff changeset
276
ab83aa685821 planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/text_processing/text_processing commit 28d2fcf2649b999762fbd94bd648485b916f2f0d
bgruening
parents: 24
diff changeset
277 - Do a **Fast numeric sort** on the column **considering its characters from** character 7 (the start of the year).
ab83aa685821 planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/text_processing/text_processing commit 28d2fcf2649b999762fbd94bd648485b916f2f0d
bgruening
parents: 24
diff changeset
278 - Resolve ties (using another column selection section) with another **Fast numeric sort** on the same column **considering its characters from** character 1 **to and including** character 2 (the month representation).
ab83aa685821 planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/text_processing/text_processing commit 28d2fcf2649b999762fbd94bd648485b916f2f0d
bgruening
parents: 24
diff changeset
279 - Resolve remaining ties with a third **Fast numeric sort** on again the same column **considering its characters from** character 4 **to and including** character 5 (the day representation).
ab83aa685821 planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/text_processing/text_processing commit 28d2fcf2649b999762fbd94bd648485b916f2f0d
bgruening
parents: 24
diff changeset
280
ab83aa685821 planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/text_processing/text_processing commit 28d2fcf2649b999762fbd94bd648485b916f2f0d
bgruening
parents: 24
diff changeset
281 This will result in the ascending chronological order::
ab83aa685821 planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/text_processing/text_processing commit 28d2fcf2649b999762fbd94bd648485b916f2f0d
bgruening
parents: 24
diff changeset
282
ab83aa685821 planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/text_processing/text_processing commit 28d2fcf2649b999762fbd94bd648485b916f2f0d
bgruening
parents: 24
diff changeset
283 09/18/1974
ab83aa685821 planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/text_processing/text_processing commit 28d2fcf2649b999762fbd94bd648485b916f2f0d
bgruening
parents: 24
diff changeset
284 11/17/1998
ab83aa685821 planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/text_processing/text_processing commit 28d2fcf2649b999762fbd94bd648485b916f2f0d
bgruening
parents: 24
diff changeset
285 11/18/1998
ab83aa685821 planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/text_processing/text_processing commit 28d2fcf2649b999762fbd94bd648485b916f2f0d
bgruening
parents: 24
diff changeset
286 12/16/1998
ab83aa685821 planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/text_processing/text_processing commit 28d2fcf2649b999762fbd94bd648485b916f2f0d
bgruening
parents: 24
diff changeset
287 03/04/2007
ab83aa685821 planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/text_processing/text_processing commit 28d2fcf2649b999762fbd94bd648485b916f2f0d
bgruening
parents: 24
diff changeset
288 10/24/2025
ab83aa685821 planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/text_processing/text_processing commit 28d2fcf2649b999762fbd94bd648485b916f2f0d
bgruening
parents: 24
diff changeset
289
ab83aa685821 planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/text_processing/text_processing commit 28d2fcf2649b999762fbd94bd648485b916f2f0d
bgruening
parents: 24
diff changeset
290 Before relying on in-column character ranges, make extra sure that all values are formatted consistently (in the above example, that all dates use two digits for days and months and the same overall date format).
0
5314e5d6f040 Imported from capsule None
bgruening
parents:
diff changeset
291 ]]>
5314e5d6f040 Imported from capsule None
bgruening
parents:
diff changeset
292 </help>
6
60edf2f8c28f planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/text_processing/text_processing commit b'e6ee273f75fff61d1e419283fa8088528cf59470\n'
bgruening
parents: 5
diff changeset
293 <expand macro="citations" />
0
5314e5d6f040 Imported from capsule None
bgruening
parents:
diff changeset
294 </tool>