Mercurial > repos > iuc > mothur_sub_sample
comparison sub.sample.xml @ 0:8ccebd04ca3d draft
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/mothur commit 180a403421967d36f995941b1a4561349d75cfc5
| author | iuc |
|---|---|
| date | Fri, 24 Jun 2016 16:51:17 -0400 |
| parents | |
| children | f18e9f139d14 |
comparison
equal
deleted
inserted
replaced
| -1:000000000000 | 0:8ccebd04ca3d |
|---|---|
| 1 <tool profile="16.07" id="mothur_sub_sample" name="Sub.sample" version="@WRAPPER_VERSION@.0"> | |
| 2 <description>Create a sub sample</description> | |
| 3 <macros> | |
| 4 <import>macros.xml</import> | |
| 5 </macros> | |
| 6 <expand macro="requirements"/> | |
| 7 <expand macro="version_command"/> | |
| 8 <command detect_errors="aggressive"><![CDATA[ | |
| 9 ## create symlinks to input datasets | |
| 10 ln -s "$input.otu" input_otu.dat && | |
| 11 ln -s "$count" count.dat && | |
| 12 ln -s "$taxonomy" taxonomy.dat && | |
| 13 #if $input.format == "fasta": | |
| 14 ln -s "$input.name_in" input_name_in.dat && | |
| 15 #end if | |
| 16 #if ($input.format == "fasta" or $input.format == "list") and $input.use_group.to_filter == "yes": | |
| 17 ln -s "$input.use_group.group_in" input_use_group_group_in.dat && | |
| 18 #end if | |
| 19 | |
| 20 echo 'sub.sample( | |
| 21 #if $input.format == "fasta": | |
| 22 fasta=input_otu.dat | |
| 23 #if $input.name_in: | |
| 24 ,name=input_name_in.dat | |
| 25 #end if | |
| 26 #else | |
| 27 #if $input.format == "list": | |
| 28 list=input_otu.dat | |
| 29 #elif $input.format == "sabund": | |
| 30 sabund=input_otu.dat | |
| 31 #elif $input.format == "rabund": | |
| 32 rabund=input_otu.dat | |
| 33 #elif $input.format == "shared": | |
| 34 shared=input_otu.dat | |
| 35 #if $input.groups: | |
| 36 ,groups=${ str($input.groups).replace(",","-") } | |
| 37 #end if | |
| 38 #end if | |
| 39 #if $input.label: | |
| 40 ,label=${ str($input.label).replace(",","-") } | |
| 41 #end if | |
| 42 #end if | |
| 43 #if $input.format == "fasta" or $input.format == "list": | |
| 44 #if $input.use_group.to_filter == "yes": | |
| 45 ,group=input_use_group_group_in.dat | |
| 46 #if $input.use_group.groups: | |
| 47 ,groups=${ str($input.use_group.groups).replace(",","-") } | |
| 48 #end if | |
| 49 ,persample=$input.use_group.persample | |
| 50 #end if | |
| 51 #end if | |
| 52 #if $count: | |
| 53 ,count=count.dat | |
| 54 #end if | |
| 55 #if $taxonomy: | |
| 56 ,taxonomy=taxonomy.dat | |
| 57 #end if | |
| 58 #if $size: | |
| 59 ,size=$size | |
| 60 #end if | |
| 61 )' | |
| 62 | sed 's/ //g' ## mothur trips over whitespace | |
| 63 | mothur | |
| 64 ]]></command> | |
| 65 <inputs> | |
| 66 <conditional name="input"> | |
| 67 <param name="format" type="select" label="Select type of data to sub sample"> | |
| 68 <option value="fasta">FASTA</option> | |
| 69 <option value="list">OTU List</option> | |
| 70 <option value="shared">OTU Shared</option> | |
| 71 <option value="sabund">OTU Shared Abundance (sabund)</option> | |
| 72 <option value="rabund">OTU Relative Abundance (rabund)</option> | |
| 73 </param> | |
| 74 <when value="fasta"> | |
| 75 <param name="otu" type="data" format="fasta" label="fasta - "/> | |
| 76 <param name="name_in" type="data" format="mothur.names" optional="true" label="name - Group Names from your history"/> | |
| 77 <conditional name="use_group"> | |
| 78 <param name="to_filter" type="select" label="Use groups?"> | |
| 79 <option value="no">No</option> | |
| 80 <option value="yes">Yes</option> | |
| 81 </param> | |
| 82 <when value="no"/> | |
| 83 <when value="yes"> | |
| 84 <param name="group_in" type="data" format="mothur.groups" label="group - Groups"/> | |
| 85 <param name="groups" type="select" optional="true" label="groups - Pick groups to include" multiple="true"> | |
| 86 <options> | |
| 87 <filter type="data_meta" ref="group_in" key="groups"/> | |
| 88 </options> | |
| 89 </param> | |
| 90 <param name="persample" type="boolean" truevalue="true" falsevalue="false" checked="false" label="persample - select subsample of the same size from each of the groups"/> | |
| 91 </when> | |
| 92 </conditional> | |
| 93 </when> | |
| 94 <when value="list"> | |
| 95 <param name="otu" type="data" format="mothur.list" label="list - OTU List"/> | |
| 96 <conditional name="use_group"> | |
| 97 <param name="to_filter" type="select" label="Use groups"> | |
| 98 <option value="no">No</option> | |
| 99 <option value="yes">Yes</option> | |
| 100 </param> | |
| 101 <when value="no"/> | |
| 102 <when value="yes"> | |
| 103 <param name="group_in" type="data" format="mothur.groups" label="group - Groups"/> | |
| 104 <param name="groups" type="select" optional="true" label="groups - Pick groups to include" multiple="true"> | |
| 105 <options> | |
| 106 <filter type="data_meta" ref="group_in" key="groups"/> | |
| 107 </options> | |
| 108 </param> | |
| 109 <param name="persample" type="boolean" truevalue="true" falsevalue="false" checked="false" label="persample - select subsample of the same size from each of the groups"/> | |
| 110 </when> | |
| 111 </conditional> | |
| 112 <param name="label" type="select" label="label - OTU Labels" optional="true" multiple="true"> | |
| 113 <expand macro="labeloptions"/> | |
| 114 </param> | |
| 115 </when> | |
| 116 <when value="shared"> | |
| 117 <param name="otu" type="data" format="mothur.shared" label="shared - OTU Shared"/> | |
| 118 <param name="groups" type="select" optional="true" label="groups - Pick groups to include" multiple="true"> | |
| 119 <options> | |
| 120 <filter type="data_meta" ref="otu" key="groups"/> | |
| 121 </options> | |
| 122 </param> | |
| 123 <param name="label" type="select" label="label - OTU Labels" optional="true" multiple="true"> | |
| 124 <expand macro="labeloptions"/> | |
| 125 </param> | |
| 126 </when> | |
| 127 <when value="sabund"> | |
| 128 <param name="otu" type="data" format="mothur.sabund" label="sabund - OTU Species Abundance"/> | |
| 129 <param name="label" type="select" label="label - OTU Labels" optional="true" multiple="true"> | |
| 130 <expand macro="labeloptions"/> | |
| 131 </param> | |
| 132 </when> | |
| 133 <when value="rabund"> | |
| 134 <param name="otu" type="data" format="mothur.rabund" label="rabund - OTU Relative Abundance"/> | |
| 135 <param name="label" type="select" label="label - OTU Labels" optional="true" multiple="true"> | |
| 136 <expand macro="labeloptions"/> | |
| 137 </param> | |
| 138 </when> | |
| 139 </conditional> | |
| 140 <param name="size" type="integer" value="" min="1" optional="true" label="size - If set, the number of samples to pick"/> | |
| 141 <param name="count" type="data" format="mothur.count_table" optional="true" label="count - a count_table" help="generated by count.seqs"/> | |
| 142 <param name="taxonomy" type="data" format="taxonomy" optional="true" label="taxonomy - allows a taxonomy file"/> | |
| 143 </inputs> | |
| 144 <outputs> | |
| 145 <expand macro="logfile-output"/> | |
| 146 <data name="fasta_out" format_source="otu" from_work_dir="input_otu*.subsample.*" label="${tool.name} on ${on_string}: subsample.fasta"> | |
| 147 <filter>input['format'] == 'fasta'</filter> | |
| 148 </data> | |
| 149 <collection name="list_out" type="list" label="${tool.name} on ${on_string}: subsample.list"> | |
| 150 <filter>input['format'] == 'list'</filter> | |
| 151 <discover_datasets pattern=".*?\.(?P<designation>.*)\.subsample\.dat" format="mothur.list"/> | |
| 152 </collection> | |
| 153 <collection name="shared_out" type="list" label="${tool.name} on ${on_string}: subsample.shared"> | |
| 154 <filter>input['format'] == 'shared'</filter> | |
| 155 <discover_datasets pattern=".*?\.(?P<designation>.*)\.subsample\.dat" format="mothur.shared"/> | |
| 156 </collection> | |
| 157 <data name="sabund_out" format="mothur.sabund" from_work_dir="input_otu*.subsample.*" label="${tool.name} on ${on_string}: subsample.sabund"> | |
| 158 <filter>input['format'] == 'sabund'</filter> | |
| 159 </data> | |
| 160 <data name="rabund_out" format="mothur.rabund" from_work_dir="input_otu*.subsample.*" label="${tool.name} on ${on_string}: subsample.rabund"> | |
| 161 <filter>input['format'] == 'rabund'</filter> | |
| 162 </data> | |
| 163 <data name="names_out" format="mothur.names" from_work_dir="input_name_in*.subsample.*" label="${tool.name} on ${on_string}: subsample.names"> | |
| 164 <filter>input['format'] == 'fasta' and input['name_in']</filter> | |
| 165 </data> | |
| 166 <data name="group_out" format="mothur.groups" from_work_dir="input_use_group_group_in*.subsample.*" label="${tool.name} on ${on_string}: subsample.groups"> | |
| 167 <filter>(input['format'] == 'fasta' or input['format'] == 'list') and input['use_group']['to_filter'] == 'yes'</filter> | |
| 168 </data> | |
| 169 </outputs> | |
| 170 <tests> | |
| 171 <test><!-- test with list --> | |
| 172 <param name="format" value="list"/> | |
| 173 <param name="otu" value="amazon.an.list" ftype="mothur.list"/> | |
| 174 <output_collection name="list_out" count="36"> | |
| 175 <element name="0.20" ftype="mothur.list"> | |
| 176 <assert_contents> | |
| 177 <has_text text="label"/> | |
| 178 <has_text text="numOtus"/> | |
| 179 </assert_contents> | |
| 180 </element> | |
| 181 </output_collection> | |
| 182 <expand macro="logfile-test"/> | |
| 183 </test> | |
| 184 <test><!-- test with list and group file and label select--> | |
| 185 <param name="format" value="list"/> | |
| 186 <param name="otu" value="amazon.an.list" ftype="mothur.list"/> | |
| 187 <param name="to_filter" value="yes"/> | |
| 188 <param name="group_in" value="amazon.groups" ftype="mothur.groups"/> | |
| 189 <param name="groups" value="forest,pasture"/> | |
| 190 <param name="label" value="0.20,0.45,0.55"/> | |
| 191 <output_collection name="list_out" count="3"> | |
| 192 <element name="0.20" ftype="mothur.list"> | |
| 193 <assert_contents> | |
| 194 <has_text text="label"/> | |
| 195 <has_text text="numOtus"/> | |
| 196 </assert_contents> | |
| 197 </element> | |
| 198 </output_collection> | |
| 199 <expand macro="logfile-test"/> | |
| 200 </test> | |
| 201 <test><!-- test with fasta --> | |
| 202 <param name="format" value="fasta"/> | |
| 203 <param name="otu" value="amazon.fasta" ftype="fasta"/> | |
| 204 <output name="fasta_out" ftype="fasta"> | |
| 205 <assert_contents> | |
| 206 <has_text text=">U"/> | |
| 207 </assert_contents> | |
| 208 </output> | |
| 209 <expand macro="logfile-test"/> | |
| 210 </test> | |
| 211 <test><!-- test with fasta and group file and name file --> | |
| 212 <param name="format" value="fasta"/> | |
| 213 <param name="otu" value="amazon.fasta" ftype="fasta"/> | |
| 214 <param name="to_filter" value="yes"/> | |
| 215 <param name="group_in" value="amazon.groups" ftype="mothur.groups"/> | |
| 216 <param name="groups" value="forest,pasture"/> | |
| 217 <param name="name_in" value="amazon1.names" ftype="mothur.names"/> | |
| 218 <output name="fasta_out" ftype="fasta"> | |
| 219 <assert_contents> | |
| 220 <has_text_matching expression=">U[0-9]+"/> | |
| 221 </assert_contents> | |
| 222 </output> | |
| 223 <output name="group_out" ftype="mothur.groups"> | |
| 224 <assert_contents> | |
| 225 <has_line_matching expression="^U[0-9]+\t(forest|pasture)$"/> | |
| 226 </assert_contents> | |
| 227 </output> | |
| 228 <output name="names_out" ftype="mothur.names"> | |
| 229 <assert_contents> | |
| 230 <has_line_matching expression="^U[0-9]+\tU[0-9]+$"/> | |
| 231 </assert_contents> | |
| 232 </output> | |
| 233 <expand macro="logfile-test"/> | |
| 234 </test> | |
| 235 <test><!-- test with shared --> | |
| 236 <param name="format" value="shared"/> | |
| 237 <param name="otu" value="amazon.an.shared" ftype="mothur.shared"/> | |
| 238 <param name="label" value="unique,0.20"/> | |
| 239 <param name="groups" value="forest"/> | |
| 240 <output_collection name="shared_out" count="2"> | |
| 241 <element name="0.20" ftype="mothur.shared"> | |
| 242 <assert_contents> | |
| 243 <has_text text="label"/> | |
| 244 <has_text text="numOtus"/> | |
| 245 <has_text text="forest"/> | |
| 246 <not_has_text text="pasture"/> | |
| 247 </assert_contents> | |
| 248 </element> | |
| 249 </output_collection> | |
| 250 <expand macro="logfile-test"/> | |
| 251 </test> | |
| 252 <test><!-- test with rabund --> | |
| 253 <param name="format" value="rabund"/> | |
| 254 <param name="otu" value="amazon.an.rabund" ftype="mothur.rabund"/> | |
| 255 <output name="rabund_out" ftype="mothur.rabund"> | |
| 256 <assert_contents> | |
| 257 <has_text text="unique"/> | |
| 258 <has_text text="0.55"/> | |
| 259 </assert_contents> | |
| 260 </output> | |
| 261 <expand macro="logfile-test"/> | |
| 262 </test> | |
| 263 <test><!-- test with sabund --> | |
| 264 <param name="format" value="sabund"/> | |
| 265 <param name="otu" value="amazon.an.sabund" ftype="mothur.sabund"/> | |
| 266 <output name="sabund_out" ftype="mothur.sabund"> | |
| 267 <assert_contents> | |
| 268 <has_text text="unique"/> | |
| 269 <has_text text="0.55"/> | |
| 270 </assert_contents> | |
| 271 </output> | |
| 272 <expand macro="logfile-test"/> | |
| 273 </test> | |
| 274 </tests> | |
| 275 <help> | |
| 276 <![CDATA[ | |
| 277 | |
| 278 @MOTHUR_OVERVIEW@ | |
| 279 | |
| 280 **Command Documenation** | |
| 281 | |
| 282 The sub.sample_ command can be used as a way to normalize your data, or to create a smaller set from your original set. It takes as an input the following file types: fasta, list_, shared_, rabund_ and sabund_ to generate a new file that contains a sampling of your original file. | |
| 283 | |
| 284 .. _list: http://www.mothur.org/wiki/List_file | |
| 285 .. _shared: http://www.mothur.org/wiki/Shared_file | |
| 286 .. _rabund: http://www.mothur.org/wiki/Rabund_file | |
| 287 .. _sabund: http://www.mothur.org/wiki/Sabund_file | |
| 288 .. _sub.sample: http://www.mothur.org/wiki/Sub.sample | |
| 289 | |
| 290 ]]> | |
| 291 </help> | |
| 292 <expand macro="citations"/> | |
| 293 </tool> |
