comparison phyloseq_from_biom.R @ 2:dfe800a3faaf draft default tip

planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/phyloseq commit 5ec9f9e81bb9a42dec5c331dd23215ca0b027b2b
author iuc
date Sat, 16 Mar 2024 07:56:05 +0000
parents
children
comparison
equal deleted inserted replaced
1:92e77800ef2c 2:dfe800a3faaf
1 #!/usr/bin/env Rscript
2
3 suppressPackageStartupMessages(library("optparse"))
4 suppressPackageStartupMessages(library("phyloseq"))
5 suppressPackageStartupMessages(library("tidyverse"))
6
7 option_list <- list(
8 make_option(c("--BIOMfilename"), action = "store", dest = "biom", help = "Input BIOM file"),
9 make_option(c("--treefilename"), action = "store", dest = "tree", default = NULL, help = "Input Tree newick/nexus file"),
10 make_option(c("--parseFunction"), action = "store", dest = "parsefoo", default = "parse_taxonomy_default", help = "Parse function parse_taxonomy_default/read_tree_greengenes"),
11 make_option(c("--refseqfilename"), action = "store", dest = "sequences", default = NULL, help = "Input Sequence fasta file"),
12 make_option(c("--output"), action = "store", dest = "output", help = "RDS output")
13 )
14
15 parser <- OptionParser(usage = "%prog [options] file", option_list = option_list)
16 args <- parse_args(parser, positional_arguments = TRUE)
17 opt <- args$options
18
19 parsefoo <- get(opt$parsefoo)
20 phyloseq_obj <- import_biom(
21 BIOMfilename = opt$biom,
22 treefilename = opt$tree,
23 refseqfilename = opt$sequences,
24 parseFunction = parsefoo
25 )
26
27 print(phyloseq_obj)
28
29 # save R object to file
30 saveRDS(phyloseq_obj, file = opt$output, compress = TRUE)