view 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 source

#!/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)