Mercurial > repos > iuc > phyloseq_from_biom
annotate phyloseq_plot_richness.R @ 4:b8a4de1a4e19 draft default tip
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/phyloseq commit 26f87cc62468c9c329b33246af4f14e2659856f9
author | iuc |
---|---|
date | Fri, 10 Jan 2025 14:58:36 +0000 |
parents | c0101c72b8af |
children |
rev | line source |
---|---|
0
c0101c72b8af
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/phyloseq commit 5ec9f9e81bb9a42dec5c331dd23215ca0b027b2b
iuc
parents:
diff
changeset
|
1 #!/usr/bin/env Rscript |
c0101c72b8af
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/phyloseq commit 5ec9f9e81bb9a42dec5c331dd23215ca0b027b2b
iuc
parents:
diff
changeset
|
2 |
c0101c72b8af
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/phyloseq commit 5ec9f9e81bb9a42dec5c331dd23215ca0b027b2b
iuc
parents:
diff
changeset
|
3 suppressPackageStartupMessages(library("optparse")) |
c0101c72b8af
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/phyloseq commit 5ec9f9e81bb9a42dec5c331dd23215ca0b027b2b
iuc
parents:
diff
changeset
|
4 suppressPackageStartupMessages(library("phyloseq")) |
c0101c72b8af
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/phyloseq commit 5ec9f9e81bb9a42dec5c331dd23215ca0b027b2b
iuc
parents:
diff
changeset
|
5 |
c0101c72b8af
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/phyloseq commit 5ec9f9e81bb9a42dec5c331dd23215ca0b027b2b
iuc
parents:
diff
changeset
|
6 option_list <- list( |
c0101c72b8af
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/phyloseq commit 5ec9f9e81bb9a42dec5c331dd23215ca0b027b2b
iuc
parents:
diff
changeset
|
7 make_option(c("--input"), action = "store", dest = "input", help = "Input RDS file containing a phyloseq object"), |
c0101c72b8af
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/phyloseq commit 5ec9f9e81bb9a42dec5c331dd23215ca0b027b2b
iuc
parents:
diff
changeset
|
8 make_option(c("--output"), action = "store", dest = "output", help = "Output PDF") |
c0101c72b8af
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/phyloseq commit 5ec9f9e81bb9a42dec5c331dd23215ca0b027b2b
iuc
parents:
diff
changeset
|
9 ) |
c0101c72b8af
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/phyloseq commit 5ec9f9e81bb9a42dec5c331dd23215ca0b027b2b
iuc
parents:
diff
changeset
|
10 |
c0101c72b8af
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/phyloseq commit 5ec9f9e81bb9a42dec5c331dd23215ca0b027b2b
iuc
parents:
diff
changeset
|
11 parser <- OptionParser(usage = "%prog [options] file", option_list = option_list) |
c0101c72b8af
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/phyloseq commit 5ec9f9e81bb9a42dec5c331dd23215ca0b027b2b
iuc
parents:
diff
changeset
|
12 args <- parse_args(parser, positional_arguments = TRUE) |
c0101c72b8af
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/phyloseq commit 5ec9f9e81bb9a42dec5c331dd23215ca0b027b2b
iuc
parents:
diff
changeset
|
13 opt <- args$options |
c0101c72b8af
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/phyloseq commit 5ec9f9e81bb9a42dec5c331dd23215ca0b027b2b
iuc
parents:
diff
changeset
|
14 phyloseq_obj <- readRDS(opt$input) |
c0101c72b8af
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/phyloseq commit 5ec9f9e81bb9a42dec5c331dd23215ca0b027b2b
iuc
parents:
diff
changeset
|
15 # Start PDF device driver and generate the plot. |
c0101c72b8af
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/phyloseq commit 5ec9f9e81bb9a42dec5c331dd23215ca0b027b2b
iuc
parents:
diff
changeset
|
16 dev.new() |
c0101c72b8af
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/phyloseq commit 5ec9f9e81bb9a42dec5c331dd23215ca0b027b2b
iuc
parents:
diff
changeset
|
17 pdf(file = opt$output) |
c0101c72b8af
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/phyloseq commit 5ec9f9e81bb9a42dec5c331dd23215ca0b027b2b
iuc
parents:
diff
changeset
|
18 plot_richness(phyloseq_obj, x = "samples", color = "samples") |
c0101c72b8af
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/phyloseq commit 5ec9f9e81bb9a42dec5c331dd23215ca0b027b2b
iuc
parents:
diff
changeset
|
19 dev.off() |