Mercurial > repos > bgruening > text_processing
comparison sort_rows.xml @ 4:56e80527c482 draft
Uploaded
| author | bgruening |
|---|---|
| date | Wed, 07 Jan 2015 11:10:52 -0500 |
| parents | 7068d1548234 |
| children | 8928e6d1e7ba |
comparison
equal
deleted
inserted
replaced
| 3:7068d1548234 | 4:56e80527c482 |
|---|---|
| 1 <tool id="tp_sort_rows" name="Sort a row" version="0.0.1"> | 1 <tool id="tp_sort_rows" name="Sort a row" version="@BASE_VERSION@.0"> |
| 2 <description>according to their columns</description> | 2 <description>according to their columns</description> |
| 3 <command>python -c 'for line in ["\t".join(sorted(line.strip().split("\t"))) for line in open("$input").readlines() ]: print line' > $outfile</command> | 3 <macros> |
| 4 <inputs> | 4 <import>macros.xml</import> |
| 5 <param format="tabular" name="input" type="data" label="Tabular file that should be sorted"/> | 5 </macros> |
| 6 </inputs> | 6 <command> |
| 7 <outputs> | 7 <![CDATA[ |
| 8 <data format="tabular" name="outfile" metadata_source="input"/> | 8 python -c 'for line in ( "\t".join(sorted(line.strip().split("\t"))) for line in open("$infile") ): print line' > $outfile |
| 9 </outputs> | 9 ]]> |
| 10 <options sanitize="False"/> | 10 </command> |
| 11 <tests> | 11 <inputs> |
| 12 | 12 <param format="tabular" name="infile" type="data" label="Tabular file that should be sorted"/> |
| 13 </tests> | 13 </inputs> |
| 14 <help> | 14 <outputs> |
| 15 | 15 <data format="tabular" name="outfile" metadata_source="infile"/> |
| 16 </outputs> | |
| 17 <options sanitize="False"/> | |
| 18 <tests> | |
| 19 <test> | |
| 20 <param name="infile" value="sort_rows1.tabular" ftype="tabular" /> | |
| 21 <output name="outfile" file="sort_rows_results1.bed"/> | |
| 22 </test> | |
| 23 </tests> | |
| 24 <help> | |
| 25 <![CDATA[ | |
| 16 .. class:: infomark | 26 .. class:: infomark |
| 17 | 27 |
| 18 **TIP:** If your data is not TAB delimited, use *Text Manipulation->Convert* | 28 **TIP:** If your data is not TAB delimited, use *Text Manipulation->Convert* |
| 19 | 29 |
| 20 **What it does** | 30 **What it does** |
| 21 | 31 |
| 22 That tool sorts each row in a TAB separated file, according to their columns. In other words: It is a sorted reordering of all columns. | 32 That tool sorts each row in a TAB separated file, according to their columns. In other words: It is a sorted reordering of all columns. |
| 23 | 33 |
| 24 | 34 @REFERENCES@ |
| 25 </help> | 35 ]]> |
| 36 </help> | |
| 26 </tool> | 37 </tool> |
