comparison taxonomy-to-krona.xml @ 0:7bfd66707e6f draft

planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/mothur commit 3418f23b9768f5aafb86488f5ec1cb97530d4fb3
author iuc
date Tue, 20 Mar 2018 21:54:35 -0400
parents
children db30eb96ea23
comparison
equal deleted inserted replaced
-1:000000000000 0:7bfd66707e6f
1 <tool id="mothur_taxonomy_to_krona" name="Taxonomy-to-Krona" version="1.0">
2 <description>convert a mothur taxonomy file to Krona input format</description>
3 <macros>
4 <import>macros.xml</import>
5 </macros>
6 <command detect_errors="exit_code"><![CDATA[
7 cat $inputfile
8 | tail -n +2 ## remove header line
9 | cut -f2,3 ## remove first column
10 | sed 's/;/\t/g' ## split taxonomy field on semicolon
11 | sed 's/"//g' ## remove quotation marks
12 | sed 's/[ \t]*$//' ## remove trailing whitespace
13 #if $stripconfidences
14 | sed -r 's/[(][0-9]+[)]//g' ## remove confidence scores
15 #end if
16 > $outputfile
17 ]]></command>
18 <inputs>
19 <param name="inputfile" type="data" format="mothur.cons.taxonomy" label="Taxonomy file"
20 help="Mothur-formatted taxonomy file. Should have 3 columns; OTU-size-taxonomy"/>
21 <param name="stripconfidences" type="boolean" checked="false" label="Strip confidence values?"
22 help="Strip the confidence values enclosed in parentheses behind the taxonomy levels if present. e.g. Bacteria(100);Bacteroidetes(87);.."/>
23 </inputs>
24 <outputs>
25 <data name="outputfile" format="tabular" label="${tool.name} on ${on_string}: krona-formatted taxonomy file"/>
26 </outputs>
27 <tests>
28 <test><!-- test defaults -->
29 <param name="inputfile" value="example.constaxonomy"/>
30 <output name="outputfile">
31 <assert_contents>
32 <has_line_matching expression="^\d+(\t[\w\d\-()]+)+$"/>
33 <not_has_text text="Otu01"/>
34 <not_has_text text=";"/>
35 <has_text text="Bacteria"/>
36 <has_text text="(100)"/>
37 </assert_contents>
38 </output>
39 </test>
40 <test><!-- test with stripping of confidence scores -->
41 <param name="inputfile" value="example.constaxonomy"/>
42 <param name="stripconfidences" value="true"/>
43 <output name="outputfile">
44 <assert_contents>
45 <has_line_matching expression="^\d+(\t[\w\d\-]+)+$"/>
46 <not_has_text text="Otu01"/>
47 <not_has_text text=";"/>
48 <has_text text="Bacteria"/>
49 <not_has_text text="(100)"/>
50 </assert_contents>
51 </output>
52 </test>
53 </tests>
54 <help><![CDATA[
55 Krona text input requires a tab-delimited file with first column being a count, and the rest representing the hierarchy, for example::
56
57 2 Fats Saturated fat
58 3 Fats Unsaturated fat Monounsaturated fat
59 3 Fats Unsaturated fat Polyunsaturated fat
60 13 Carbohydrates Sugars
61 4 Carbohydrates Dietary fiber
62 21 Carbohydrates
63 5 Protein
64 4
65
66 This can be input into the Krona tool as generic text format, and would yield this `Krona plot`_.
67
68 .. _Krona plot: https://marbl.github.io/Krona/examples/xml.krona.html
69
70 ]]></help>
71 <expand macro="citations">
72 <citation type="doi">10.1186/1471-2105-12-385</citation>
73 </expand>
74 </tool>