diff --git a/tools/phyloseq/phyloseq_plot_bar.R b/tools/phyloseq/phyloseq_plot_bar.R
index af86b57fd1a..d0d5830f39a 100755
--- a/tools/phyloseq/phyloseq_plot_bar.R
+++ b/tools/phyloseq/phyloseq_plot_bar.R
@@ -16,8 +16,8 @@ option_list <- list(
help = "Variable for x-axis (e.g., 'Sample', 'Phylum')"
),
make_option(c("--fill"),
- action = "store", dest = "fill",
- help = "Variable for fill color (e.g., 'Genus', 'Order')"
+ action = "store", dest = "fill", default = NULL,
+ help = "Variable for fill color (e.g., 'Genus', 'Order') (optional)"
),
make_option(c("--facet"),
action = "store", dest = "facet", default = NULL,
@@ -41,9 +41,6 @@ if (is.null(opt$input) || opt$input == "") {
if (is.null(opt$x) || opt$x == "") {
stop("Error: X-axis variable is required.")
}
-if (is.null(opt$fill) || opt$fill == "") {
- stop("Error: Fill variable is required.")
-}
if (is.null(opt$output) || opt$output == "") {
stop("Error: Output file is required.")
}
@@ -57,9 +54,6 @@ sample_vars <- colnames(sample_data(physeq))
if (!opt$x %in% sample_vars) {
stop(paste("Error: X-axis variable", opt$x, "does not exist in the sample data."))
}
-if (!opt$fill %in% sample_vars) {
- stop(paste("Error: Fill variable", opt$fill, "does not exist in the sample data."))
-}
# Generate bar plot
p <- plot_bar(physeq, x = opt$x, fill = opt$fill)
diff --git a/tools/phyloseq/phyloseq_plot_bar.xml b/tools/phyloseq/phyloseq_plot_bar.xml
index e91dc9dfcaf..9ef0713f6fe 100644
--- a/tools/phyloseq/phyloseq_plot_bar.xml
+++ b/tools/phyloseq/phyloseq_plot_bar.xml
@@ -36,14 +36,7 @@ Rscript '${__tool_directory__}/phyloseq_plot_bar.R'
-
-
-
-
-
- 1
-
-
+
@@ -67,7 +60,7 @@ Rscript '${__tool_directory__}/phyloseq_plot_bar.R'
- **Input**: A phyloseq object in RDS format.
- **X-axis variable**: The variable to use for the x-axis (e.g., Sample, Phylum).
- - **Fill variable**: The variable to use for the bar fill colors (e.g., Genus, Order).
+ - **Fill variable**: (Optional) The variable to use for the bar fill colors (e.g., Genus, Order).
- **Facet by variable**: (Optional) A variable to facet the bar chart (e.g., SampleType).
**Outputs**