Mercurial > repos > bgruening > text_processing
comparison cut.xml @ 26:f22a309187a3 draft
planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/text_processing/text_processing commit c2b1677d1c94433f777c2dc28ac8eec0a99cc6a7
| author | bgruening |
|---|---|
| date | Fri, 16 Aug 2024 10:41:17 +0000 |
| parents | 28b4fd1b0e9a |
| children | 08cdbfffce67 |
comparison
equal
deleted
inserted
replaced
| 25:cd83b5644eab | 26:f22a309187a3 |
|---|---|
| 1 <tool id="tp_cut_tool" name="Advanced Cut" version="@BASE_VERSION@.0"> | 1 <tool id="tp_cut_tool" name="Advanced Cut" version="@TOOL_VERSION@+galaxy2" profile="@PROFILE@"> |
| 2 <description>columns from a table (cut)</description> | 2 <description>columns from a table (cut)</description> |
| 3 <macros> | 3 <macros> |
| 4 <import>macros.xml</import> | 4 <import>macros.xml</import> |
| 5 </macros> | 5 </macros> |
| 6 <expand macro="requirements" /> | 6 <expand macro="requirements" /> |
| 7 <version_command>cut --version | head -n 1</version_command> | 7 <version_command>cut --version | head -n 1</version_command> |
| 8 <command> | 8 <command> |
| 9 <![CDATA[ | 9 <![CDATA[ |
| 10 cut | 10 cut |
| 11 #if str($delimiter) != '': | 11 $complement |
| 12 -d"${delimiter}" | 12 $cut_type_options.cut_element |
| 13 #if $cut_type_options.cut_element != '-f' | |
| 14 '$cut_type_options.list' | |
| 15 #else | |
| 16 '$cut_type_options.colnames_option.list' | |
| 17 #if str($cut_type_options.delimiter) != '': | |
| 18 -d"$cut_type_options.delimiter" | |
| 19 #end if | |
| 13 #end if | 20 #end if |
| 14 ${complement} | 21 '$input' |
| 15 ${cut_type_options.cut_element} | 22 > '$output' |
| 16 '${cut_type_options.list}' | |
| 17 '${input}' | |
| 18 > '${output}' | |
| 19 ]]> | 23 ]]> |
| 20 </command> | 24 </command> |
| 21 <inputs> | 25 <inputs> |
| 22 <param name="input" format="txt" type="data" label="File to cut" /> | 26 <param name="input" format="txt" type="data" label="File to cut" /> |
| 23 <param name="complement" type="select" label="Operation"> | 27 <param name="complement" type="select" label="Operation"> |
| 24 <option value="">Keep</option> | 28 <option value="">Keep</option> |
| 25 <option value="--complement">Discard</option> | 29 <option value="--complement">Discard</option> |
| 26 </param> | 30 </param> |
| 27 <param name="delimiter" type="select" label="Delimited by"> | |
| 28 <option value="">Tab</option> | |
| 29 <option value=" ">Whitespace</option> | |
| 30 <option value=".">Dot</option> | |
| 31 <option value=",">Comma</option> | |
| 32 <option value="-">Dash</option> | |
| 33 <option value="_">Underscore</option> | |
| 34 <option value="|">Pipe</option> | |
| 35 </param> | |
| 36 <conditional name="cut_type_options"> | 31 <conditional name="cut_type_options"> |
| 37 <param name="cut_element" type="select" label="Cut by"> | 32 <param name="cut_element" type="select" label="Cut by"> |
| 38 <option value="-f">fields</option> | 33 <option value="-f">fields</option> |
| 39 <option value="-c">characters</option> | 34 <option value="-c">characters</option> |
| 40 <option value="-b">bytes</option> | |
| 41 </param> | 35 </param> |
| 42 <when value="-f"> | 36 <when value="-f"> |
| 43 <param name="list" type="data_column" data_ref="input" multiple="true" label="List of Fields" help="(-f)" /> | 37 <param name="delimiter" type="select" label="Delimited by"> |
| 38 <option value="">Tab</option> | |
| 39 <option value=" ">Whitespace</option> | |
| 40 <option value=".">Dot</option> | |
| 41 <option value=",">Comma</option> | |
| 42 <option value="-">Dash</option> | |
| 43 <option value="_">Underscore</option> | |
| 44 <option value="|">Pipe</option> | |
| 45 </param> | |
| 46 <conditional name="colnames_option"> | |
| 47 <param name="header" type="select" label="Is there a header for the data's columns ?"> | |
| 48 <option value="Y">Yes</option> | |
| 49 <option value="N" selected="true">No</option> | |
| 50 </param> | |
| 51 <when value="Y"> | |
| 52 <param name="list" type="data_column" data_ref="input" use_header_names="true" multiple="true" label="List of Fields" help="(-f)" /> | |
| 53 </when> | |
| 54 <when value="N"> | |
| 55 <param name="list" type="data_column" data_ref="input" multiple="true" label="List of Fields" help="(-f)" /> | |
| 56 </when> | |
| 57 </conditional> | |
| 44 </when> | 58 </when> |
| 45 <when value="-c"> | 59 <when value="-c"> |
| 46 <param name="list" type="text" value="" label="List of characters" help="These will be kept/discarded (depending on 'operation'). <BR /> Examples: 1,3,4 or 2-5"> | 60 <param name="list" type="text" value="" label="List of characters" help="These will be kept/discarded (depending on 'operation'). <BR /> Examples: 1,3,4 or 2-5"> |
| 47 <sanitizer> | |
| 48 <valid initial="string.printable"> | |
| 49 <remove value="'"/> | |
| 50 </valid> | |
| 51 </sanitizer> | |
| 52 </param> | |
| 53 </when> | |
| 54 <when value="-b"> | |
| 55 <param name="list" type="text" value="" label="List of Bytes" help="These will be kept/discarded (depending on 'operation'). <BR /> Examples: 1,3,4 or 2-5"> | |
| 56 <sanitizer> | 61 <sanitizer> |
| 57 <valid initial="string.printable"> | 62 <valid initial="string.printable"> |
| 58 <remove value="'"/> | 63 <remove value="'"/> |
| 59 </valid> | 64 </valid> |
| 60 </sanitizer> | 65 </sanitizer> |
| 68 <data format="tabular" name="output"> | 73 <data format="tabular" name="output"> |
| 69 <actions> | 74 <actions> |
| 70 <conditional name="cut_type_options.cut_element"> | 75 <conditional name="cut_type_options.cut_element"> |
| 71 <!-- fields --> | 76 <!-- fields --> |
| 72 <when value="-f"> | 77 <when value="-f"> |
| 73 <conditional name="delimiter"> | 78 <conditional name="cut_type_options.delimiter"> |
| 74 <when value="T"> | 79 <when value="T"> |
| 75 <conditional name="input"> | 80 <conditional name="input"> |
| 76 <when datatype_isinstance="interval"> | 81 <when datatype_isinstance="interval"> |
| 77 <action type="format" default="tabular"> | 82 <action type="format" default="tabular"> |
| 78 <option type="from_param" name="list" column="0" offset="0"> <!-- chromCol is 1--> | 83 <option type="from_param" name="list" column="0" offset="0"> <!-- chromCol is 1--> |
| 182 </conditional> | 187 </conditional> |
| 183 </actions> | 188 </actions> |
| 184 </data> | 189 </data> |
| 185 </outputs> | 190 </outputs> |
| 186 <tests> | 191 <tests> |
| 187 <test> | 192 <test expect_num_outputs="1"> |
| 188 <param name="input" value="cut1.txt"/> | 193 <param name="input" value="cut1.txt"/> |
| 189 <param name="list" value="1,3,4"/> | 194 <param name="list" value="1,3,4"/> |
| 190 <param name="delimiter" value=""/> | 195 <param name="delimiter" value=""/> |
| 191 <output name="output" file="cut_results1.txt"/> | 196 <output name="output" file="cut_results1.txt"/> |
| 197 <assert_command> | |
| 198 <has_text text="-f '1,3,4'"/> | |
| 199 </assert_command> | |
| 192 </test> | 200 </test> |
| 193 <test> | 201 |
| 202 <test expect_num_outputs="1"> | |
| 194 <param name="input" value="cut1.txt"/> | 203 <param name="input" value="cut1.txt"/> |
| 195 <param name="list" value="2" /> | 204 <conditional name="cut_type_options"> |
| 196 <param name="delimiter" value="" /> | 205 <param name="delimiter" value="" /> |
| 206 <conditional name="colnames_option"> | |
| 207 <param name="header" value="Y"/> | |
| 208 <!-- in the test we can (apparently) not select by header name --> | |
| 209 <param name="list" value="2" /> | |
| 210 </conditional> | |
| 211 </conditional> | |
| 197 <param name="complement" value="--complement" /> | 212 <param name="complement" value="--complement" /> |
| 198 <output name="output" file="cut_results2.txt"/> | 213 <output name="output" file="cut_results2.txt"/> |
| 214 <assert_command> | |
| 215 <has_text text="-f '2'"/> | |
| 216 </assert_command> | |
| 199 </test> | 217 </test> |
| 200 <test> | 218 <test expect_num_outputs="1"> |
| 201 <param name="input" value="cut1.txt"/> | 219 <param name="input" value="cut1.txt"/> |
| 202 <param name="list" value="-3" /> | 220 <param name="list" value="-3" /> |
| 203 <param name="delimiter" value="" /> | 221 <param name="delimiter" value="" /> |
| 204 <param name="cut_element" value="-c" /> | 222 <param name="cut_element" value="-c" /> |
| 205 <output name="output" file="cut_results3.txt"/> | 223 <output name="output" file="cut_results3.txt"/> |
