Mercurial > repos > iuc > phyloseq_plot_bar
comparison phyloseq_plot_bar.xml @ 6:0150f6dcd750 draft
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/phyloseq commit a5ae2f86b2955290a4c81ab234f02cc51020f970
| author | iuc |
|---|---|
| date | Thu, 13 Mar 2025 09:47:28 +0000 |
| parents | 4b5439de35c8 |
| children |
comparison
equal
deleted
inserted
replaced
| 5:4b5439de35c8 | 6:0150f6dcd750 |
|---|---|
| 8 <command detect_errors="exit_code"><![CDATA[ | 8 <command detect_errors="exit_code"><![CDATA[ |
| 9 Rscript '${__tool_directory__}/phyloseq_plot_bar.R' | 9 Rscript '${__tool_directory__}/phyloseq_plot_bar.R' |
| 10 --input '$input' | 10 --input '$input' |
| 11 --x '$x' | 11 --x '$x' |
| 12 --fill '$fill' | 12 --fill '$fill' |
| 13 --facet '${facet}' | 13 --facet '$facet' |
| 14 --topX '$topX' | |
| 15 '$keepOthers' | |
| 16 '$keepNonAssigned' | |
| 17 '$normalize' | |
| 18 '$normalize_x' | |
| 19 '$nolines' | |
| 20 --width '$width' | |
| 21 --height '$height' | |
| 22 --device '$device' | |
| 14 --output '$output' | 23 --output '$output' |
| 15 --topX '${topX}' | |
| 16 --keepOthers '${keepOthers}' | |
| 17 --keepNonAssigned '${keepNonAssigned}' | |
| 18 --normalize '${normalize}' | |
| 19 --width '${width}' | |
| 20 --height '${height}' | |
| 21 --device '${device}' | |
| 22 --nolines '${nolines}' | |
| 23 ]]></command> | 24 ]]></command> |
| 24 <inputs> | 25 <inputs> |
| 25 <expand macro="phyloseq_input"/> | 26 <expand macro="phyloseq_input"/> |
| 26 <param name="x" type="text" optional="true" label="X-axis variable" help="Variable for the x-axis (e.g., Sample, Phylum). If not specified, the Samples are taken." /> | 27 <param name="x" type="text" optional="true" label="X-axis variable" help="Variable for the x-axis (Metadata columns). If not specified, the Samples are taken." /> |
| 27 <param name="fill" type="text" label="Fill variable" help="Variable to color the bars (e.g., Genus, Order)." /> | 28 <param name="fill" type="text" label="Fill variable" help="Variable to color the bars (e.g., Genus, Species). Use 'ASV' as argument to show each OTU/ASV." /> |
| 28 <param name="facet" type="text" optional="true" label="Facet by variable" help="Variable to facet the chart by (e.g., SampleType)." /> | 29 <param name="facet" type="text" optional="true" label="Facet by variable" help="Variable to facet the chart by (e.g., SampleType)." /> |
| 29 <param name="topX" value="10" type="integer" optional="true" label="Top X" help="Only show the ranks with the top X abundance." /> | 30 <param name="topX" value="10" type="integer" optional="true" label="Top X" help="Only show the ranks with the top X abundance." /> |
| 30 <param name="keepOthers" type="boolean" label="Keep 'Others'" help="Keep OTUs which are not in top X as 'Others'." /> | 31 <param name="keepOthers" type="boolean" truevalue="--keepOthers" falsevalue="" label="Keep 'Others'" help="Keep OTUs which are not in top X as 'Others'." /> |
| 31 <param name="keepNonAssigned" type="boolean" label="Keep Non Assigned" help="Keep OTUs that are not assigned at this rank and label as 'Not Assigned'." /> | 32 <param name="keepNonAssigned" type="boolean" truevalue="--keepNonAssigned" falsevalue="" label="Keep 'Not Assigned'" help="Keep OTUs that are not assigned at this rank and label as 'Not Assigned'." /> |
| 32 <param name="normalize" type="boolean" label="Normalize" help="Normalize abundances to sum to 100%. Normalization is performed before Top X selection." /> | 33 <param name="normalize" type="boolean" truevalue="--normalize" falsevalue="" label="Normalize" help="Normalize abundances to sum to 100%. Normalization is performed before Top X selection." /> |
| 34 <param name="normalize_x" type="boolean" truevalue="--normalize_x" falsevalue="" label="Normalize x" help="Normalize abundances of the x group to sum to 100%. Normalization is performed before Top X selection. Ignores facetting!" /> | |
| 35 <param name="nolines" type="boolean" truevalue="--nolines" falsevalue="" label="Remove Separation Lines" help="Do not add OTU separation lines in the bars." /> | |
| 33 <param name="width" type="float" value="10" optional="true" label="Plot Width" help="Width of the output plot in inches." /> | 36 <param name="width" type="float" value="10" optional="true" label="Plot Width" help="Width of the output plot in inches." /> |
| 34 <param name="height" type="float" value="8" optional="true" label="Plot Height" help="Height of the output plot in inches." /> | 37 <param name="height" type="float" value="8" optional="true" label="Plot Height" help="Height of the output plot in inches." /> |
| 35 <param name="device" type="select" value="pdf" label="Output Device" help="Device to use for the output file. Options include pdf, png, and others."> | 38 <param name="device" type="select" value="pdf" label="Output Device" help="File format to use for the output file. "> |
| 36 <option value="pdf">PDF</option> | 39 <option value="pdf">PDF</option> |
| 37 <option value="png">PNG</option> | 40 <option value="png">PNG</option> |
| 38 <option value="jpeg">JPEG</option> | 41 <option value="jpg">JEG</option> |
| 39 <option value="tiff">TIFF</option> | 42 <option value="tiff">TIFF</option> |
| 40 </param> | 43 </param> |
| 41 <param name="nolines" type="boolean" label="Remove Separation Lines" help="Do not add separation lines between bars in the chart." /> | |
| 42 </inputs> | 44 </inputs> |
| 43 <outputs> | 45 <outputs> |
| 44 <data name="output" format="pdf" label="Bar Chart (${device})"> | 46 <data name="output" format="pdf" label="Bar Chart (${device})"> |
| 45 <change_format> | 47 <change_format> |
| 46 <when format="pdf" value="pdf"/> | 48 <when input="device" format="pdf" value="pdf"/> |
| 47 <when format="png" value="png"/> | 49 <when input="device" format="png" value="png"/> |
| 48 <when format="jpeg" value="jpeg"/> | 50 <when input="device" format="jpg" value="jpg"/> |
| 49 <when format="tiff" value="tiff"/> | 51 <when input="device" format="tiff" value="tiff"/> |
| 50 </change_format> | 52 </change_format> |
| 51 | |
| 52 </data> | 53 </data> |
| 53 </outputs> | 54 </outputs> |
| 54 | 55 |
| 55 <tests> | 56 <tests> |
| 56 <!-- Test 1: Basic functionality with x and fill variables --> | 57 <!-- Test 1: Basic functionality with x and fill variables --> |
| 57 <test> | 58 <test> |
| 58 <param name="input" value="output.phyloseq" ftype="phyloseq"/> | 59 <param name="input" value="output.phyloseq" ftype="phyloseq"/> |
| 59 <param name="x" value="Property"/> | 60 <param name="x" value="Property"/> |
| 60 <param name="fill" value="Phylum"/> | 61 <param name="fill" value="Phylum"/> |
| 61 <param name="device" value="pdf"/> | 62 <param name="device" value="png"/> |
| 62 <output name="output" ftype="pdf"> | 63 <output name="output" file="expected_output_01.png" ftype="png" compare="image_diff"/> |
| 63 <assert_contents> | |
| 64 <has_text text="%PDF"/> | |
| 65 <has_text text="%%EOF"/> | |
| 66 </assert_contents> | |
| 67 </output> | |
| 68 </test> | 64 </test> |
| 69 | 65 |
| 70 <!-- Test 2: TopX filtering and normalization --> | 66 <!-- Test 2: TopX filtering and normalization --> |
| 71 <test> | 67 <test> |
| 72 <param name="input" value="output.phyloseq" ftype="phyloseq"/> | 68 <param name="input" value="output.phyloseq" ftype="phyloseq"/> |
| 73 <param name="x" value="Property"/> | 69 <param name="x" value="Property"/> |
| 74 <param name="fill" value="Genus"/> | 70 <param name="fill" value="Genus"/> |
| 75 <param name="facet" value="SampleType"/> | 71 <param name="facet" value="Number"/> |
| 76 <param name="topX" value="10"/> | 72 <param name="topX" value="10"/> |
| 77 <param name="normalize" value="true"/> | 73 <param name="normalize" value="true"/> |
| 78 <output name="output" ftype="pdf"> | 74 <param name="device" value="png"/> |
| 79 <assert_contents> | 75 <output name="output" file="expected_output_02.png" ftype="png" compare="image_diff"/> |
| 80 <has_text text="%PDF"/> | |
| 81 <has_text text="%%EOF"/> | |
| 82 </assert_contents> | |
| 83 </output> | |
| 84 </test> | 76 </test> |
| 85 | 77 |
| 86 <!-- Test 3: without OTU lines, Others and non assigned --> | 78 |
| 87 <test> | 79 <!-- Test 3: without OTU lines, Others and non assigned --> |
| 80 <test> | |
| 88 <param name="input" value="output.phyloseq" ftype="phyloseq"/> | 81 <param name="input" value="output.phyloseq" ftype="phyloseq"/> |
| 89 <param name="x" value="Sample"/> | 82 <param name="x" value="Sample"/> |
| 90 <param name="fill" value="Genus"/> | 83 <param name="fill" value="Genus"/> |
| 91 <param name="facet" value=""/> | 84 <param name="facet" value=""/> |
| 92 <param name="topX" value="10"/> | 85 <param name="topX" value="10"/> |
| 93 <param name="normalize" value="false"/> | 86 <param name="normalize" value="false"/> |
| 94 <param name="keepOthers" value="false"/> | 87 <param name="keepOthers" value="true"/> |
| 95 <param name="keepNonAssigned" value="false"/> | 88 <param name="keepNonAssigned" value="false"/> |
| 96 <param name="nolines" value="true"/> | 89 <param name="nolines" value="true"/> |
| 97 <param name="device" value="pdf"/> | 90 <param name="device" value="png"/> |
| 98 <output name="output" file="expected_output.pdf" ftype="pdf" compare="sim_size"/> | 91 <output name="output" file="expected_output_03.png" ftype="png" compare="image_diff"/> |
| 99 </test> | 92 </test> |
| 100 | 93 |
| 101 <!-- Test 4: with normalization, Others and non assigned --> | 94 <!-- Test 4: with normalization, Others and non assigned --> |
| 102 <test> | 95 <test> |
| 103 <param name="input" value="output.phyloseq" ftype="phyloseq"/> | 96 <param name="input" value="output.phyloseq" ftype="phyloseq"/> |
| 104 <param name="x" value="Sample"/> | 97 <param name="x" value="Sample"/> |
| 105 <param name="fill" value="Genus"/> | 98 <param name="fill" value="Genus"/> |
| 106 <param name="facet" value=""/> | 99 <param name="facet" value=""/> |
| 107 <param name="topX" value="10"/> | 100 <param name="topX" value="10"/> |
| 108 <param name="normalize" value="true"/> | 101 <param name="normalize" value="true"/> |
| 109 <param name="keepOthers" value="true"/> | 102 <param name="keepOthers" value="true"/> |
| 110 <param name="keepNonAssigned" value="true"/> | 103 <param name="keepNonAssigned" value="true"/> |
| 111 <param name="nolines" value="false"/> | 104 <param name="nolines" value="false"/> |
| 112 <param name="device" value="pdf"/> | 105 <param name="device" value="png"/> |
| 113 <output name="output" file="expected_output_normalize.pdf" ftype="pdf" compare="sim_size"/> | 106 <output name="output" file="expected_output_04.png" ftype="png" compare="image_diff"/> |
| 114 </test> | 107 </test> |
| 108 | |
| 109 <!-- Test 5: with normalization, Others and non assigned, normalization x --> | |
| 110 <test> | |
| 111 <param name="input" value="output.phyloseq" ftype="phyloseq"/> | |
| 112 <param name="x" value="Property"/> | |
| 113 <param name="fill" value="Genus"/> | |
| 114 <param name="facet" value=""/> | |
| 115 <param name="topX" value="10"/> | |
| 116 <param name="normalize" value="true"/> | |
| 117 <param name="keepOthers" value="true"/> | |
| 118 <param name="keepNonAssigned" value="true"/> | |
| 119 <param name="normalize_x" value="true"/> | |
| 120 <param name="nolines" value="false"/> | |
| 121 <param name="device" value="png"/> | |
| 122 <output name="output" file="expected_output_05.png" ftype="png" compare="image_diff"/> | |
| 123 </test> | |
| 124 | |
| 125 <!-- Test 6: Minimal --> | |
| 126 <test> | |
| 127 <param name="input" value="output.phyloseq" ftype="phyloseq"/> | |
| 128 <param name="device" value="png"/> | |
| 129 <output name="output" file="expected_output_06.png" ftype="png" compare="image_diff"/> | |
| 130 </test> | |
| 131 | |
| 115 </tests> | 132 </tests> |
| 116 | 133 |
| 117 <help> | 134 <help> |
| 118 **Description** | 135 <![CDATA[ |
| 136 **Description** | |
| 119 | 137 |
| 120 This tool generates bar charts from a phyloseq object using the `plot_bar` function. | 138 This tool generates bar charts from a phyloseq object using the 'plot_bar' function in R. |
| 139 It allows filtering, normalization, and customization of plots for visualizing microbial community composition. | |
| 121 | 140 |
| 122 **Inputs** | 141 **Inputs** |
| 123 | 142 |
| 124 - **Input**: A phyloseq object in RDS format. | 143 - **Input**: A phyloseq object in RDS format. |
| 125 - **X-axis variable**: The variable to use for the x-axis (e.g., Sample, Phylum). | |
| 126 - **Fill variable**: (Optional) The variable to use for the bar fill colors (e.g., Genus, Order). | |
| 127 - **Facet by variable**: (Optional) A variable to facet the bar chart (e.g., SampleType). | |
| 128 - **Width and Height**: Dimensions of the plot in inches (default: 10x8). | |
| 129 - **Device**: Output format (e.g., pdf, png, jpeg, tiff). | |
| 130 | 144 |
| 131 **Outputs** | 145 - **X-axis variable**: The variable to use for the x-axis (Metadata columns). |
| 132 | 146 |
| 133 - A file containing the bar chart in the specified format. | 147 - **Fill variable**: (Optional) The variable to use for the bar fill colors (e.g., Genus, Species). |
| 134 | 148 |
| 135 **Usage Notes** | 149 - **Facet by variable**: (Optional) A variable to facet the bar chart (e.g., SampleType). |
| 136 | 150 |
| 137 Ensure that the input file is a valid phyloseq object in RDS format. | 151 - **Top X**: Display only the top X most abundant taxa. |
| 138 </help> | 152 |
| 153 - **Keep 'Others'**: Group non-top taxa as 'Others'. | |
| 154 | |
| 155 - **Keep 'Not Assigned'**: Retain unassigned taxa labeled as 'Not Assigned'. | |
| 156 | |
| 157 - **Normalize**: Normalize abundances to sum to 100%. | |
| 158 | |
| 159 - **Remove Separation Lines**: Do not add OTU separation lines in the bars. | |
| 160 | |
| 161 - **Width and Height**: Dimensions of the plot in inches (default: 10x8). | |
| 162 | |
| 163 - **Device**: Output format (e.g., pdf, png, jpg, tiff). | |
| 164 | |
| 165 **Outputs** | |
| 166 | |
| 167 - A file containing the bar chart in the specified format. | |
| 168 | |
| 169 **Usage Notes** | |
| 170 | |
| 171 Ensure that the input file is a valid phyloseq object in RDS format. | |
| 172 | |
| 173 **Examples** | |
| 174 | |
| 175 - *Basic Bar Plot with Others and Not Assigned and with separation lines* | |
| 176 | |
| 177 .. image:: $PATH_TO_IMAGES/standard_plot.png | |
| 178 :width: 515 | |
| 179 :height: 395 | |
| 180 | |
| 181 - *Faceted Plot* | |
| 182 | |
| 183 .. image:: $PATH_TO_IMAGES/facet_plot.png | |
| 184 :width: 515 | |
| 185 :height: 395 | |
| 186 | |
| 187 - *ASV as fill input and removed separation lines* | |
| 188 | |
| 189 .. image:: $PATH_TO_IMAGES/asv_fill_plot.png | |
| 190 :width: 515 | |
| 191 :height: 395 | |
| 192 ]]> | |
| 193 </help> | |
| 194 | |
| 139 <expand macro="citations"/> | 195 <expand macro="citations"/> |
| 140 </tool> | 196 </tool> |
