Mercurial > repos > gaelcge > r_signac_galaxy
diff signac-find_clusters.R @ 0:6e0b320d8b6a draft default tip
"planemo upload commit dc808171975d0012e25bd7b32adc7a5a5c56a145-dirty"
author | gaelcge |
---|---|
date | Tue, 02 Aug 2022 19:11:27 +0000 |
parents | |
children |
line wrap: on
line diff
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/signac-find_clusters.R Tue Aug 02 19:11:27 2022 +0000 @@ -0,0 +1,50 @@ +#!/usr/bin/env Rscript + +# Load optparse we need to check inputs + +suppressPackageStartupMessages(require(optparse)) + +# Load common functions + +suppressPackageStartupMessages(require(workflowscriptscommon)) + +# parse options + +option_list = list( + make_option( + c("--signac-object"), + action = "store", + default = NA, + type = 'character', + help = "" + ), + make_option( + c("--algorithm"), + action = "store", + default = NA, + type = 'character', + help = "." + ), + make_option( + c("--output-object-file"), + action = "store", + default = NA, + type = 'character', + help = "File name in which to store serialized R matrix object." + ) +) + +opt <- wsc_parse_args(option_list) + +suppressPackageStartupMessages(require(Seurat)) +suppressPackageStartupMessages(require(Signac)) + +set.seed(1234) + +# extract gene annotations from EnsDb +signac_object <- readRDS(file = opt$signac_object) + +signac_object <- FindClusters(object = signac_object, verbose = FALSE, algorithm = as.numeric(opt$algorithm)) + +# Output to a serialized R object +saveRDS(signac_object, file = opt$output_object_file)