annotate phyloseq_plot_richness.R @ 5:30c3ad698f2d draft default tip

planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/phyloseq commit fa72d860839082a926004d8a97a03a3e27701333
author iuc
date Fri, 04 Apr 2025 10:17:19 +0000
parents 5ce47c1b1499
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
0
5ce47c1b1499 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/phyloseq commit d905841a8c8eff6a2006492ef52b31f969e8206a
iuc
parents:
diff changeset
1 #!/usr/bin/env Rscript
5ce47c1b1499 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/phyloseq commit d905841a8c8eff6a2006492ef52b31f969e8206a
iuc
parents:
diff changeset
2
5ce47c1b1499 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/phyloseq commit d905841a8c8eff6a2006492ef52b31f969e8206a
iuc
parents:
diff changeset
3 suppressPackageStartupMessages(library("optparse"))
5ce47c1b1499 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/phyloseq commit d905841a8c8eff6a2006492ef52b31f969e8206a
iuc
parents:
diff changeset
4 suppressPackageStartupMessages(library("phyloseq"))
5ce47c1b1499 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/phyloseq commit d905841a8c8eff6a2006492ef52b31f969e8206a
iuc
parents:
diff changeset
5
5ce47c1b1499 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/phyloseq commit d905841a8c8eff6a2006492ef52b31f969e8206a
iuc
parents:
diff changeset
6 option_list <- list(
5ce47c1b1499 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/phyloseq commit d905841a8c8eff6a2006492ef52b31f969e8206a
iuc
parents:
diff changeset
7 make_option(c("--input"), action = "store", dest = "input", help = "Input RDS file containing a phyloseq object"),
5ce47c1b1499 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/phyloseq commit d905841a8c8eff6a2006492ef52b31f969e8206a
iuc
parents:
diff changeset
8 make_option(c("--output"), action = "store", dest = "output", help = "Output PDF")
5ce47c1b1499 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/phyloseq commit d905841a8c8eff6a2006492ef52b31f969e8206a
iuc
parents:
diff changeset
9 )
5ce47c1b1499 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/phyloseq commit d905841a8c8eff6a2006492ef52b31f969e8206a
iuc
parents:
diff changeset
10
5ce47c1b1499 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/phyloseq commit d905841a8c8eff6a2006492ef52b31f969e8206a
iuc
parents:
diff changeset
11 parser <- OptionParser(usage = "%prog [options] file", option_list = option_list)
5ce47c1b1499 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/phyloseq commit d905841a8c8eff6a2006492ef52b31f969e8206a
iuc
parents:
diff changeset
12 args <- parse_args(parser, positional_arguments = TRUE)
5ce47c1b1499 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/phyloseq commit d905841a8c8eff6a2006492ef52b31f969e8206a
iuc
parents:
diff changeset
13 opt <- args$options
5ce47c1b1499 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/phyloseq commit d905841a8c8eff6a2006492ef52b31f969e8206a
iuc
parents:
diff changeset
14 phyloseq_obj <- readRDS(opt$input)
5ce47c1b1499 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/phyloseq commit d905841a8c8eff6a2006492ef52b31f969e8206a
iuc
parents:
diff changeset
15 # Start PDF device driver and generate the plot.
5ce47c1b1499 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/phyloseq commit d905841a8c8eff6a2006492ef52b31f969e8206a
iuc
parents:
diff changeset
16 dev.new()
5ce47c1b1499 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/phyloseq commit d905841a8c8eff6a2006492ef52b31f969e8206a
iuc
parents:
diff changeset
17 pdf(file = opt$output)
5ce47c1b1499 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/phyloseq commit d905841a8c8eff6a2006492ef52b31f969e8206a
iuc
parents:
diff changeset
18 plot_richness(phyloseq_obj, x = "samples", color = "samples")
5ce47c1b1499 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/phyloseq commit d905841a8c8eff6a2006492ef52b31f969e8206a
iuc
parents:
diff changeset
19 dev.off()