view phyloseq_plot_richness.R @ 5:e8f58a93ff19 draft default tip

planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/phyloseq commit d905841a8c8eff6a2006492ef52b31f969e8206a
author iuc
date Tue, 07 Jan 2025 17:58:14 +0000
parents 92e77800ef2c
children
line wrap: on
line source

#!/usr/bin/env Rscript

suppressPackageStartupMessages(library("optparse"))
suppressPackageStartupMessages(library("phyloseq"))

option_list <- list(
    make_option(c("--input"), action = "store", dest = "input", help = "Input RDS file containing a phyloseq object"),
    make_option(c("--output"), action = "store", dest = "output", help = "Output PDF")
)

parser <- OptionParser(usage = "%prog [options] file", option_list = option_list)
args <- parse_args(parser, positional_arguments = TRUE)
opt <- args$options
phyloseq_obj <- readRDS(opt$input)
# Start PDF device driver and generate the plot.
dev.new()
pdf(file = opt$output)
plot_richness(phyloseq_obj, x = "samples", color = "samples")
dev.off()