Skip to contents

RunSCExplorer

Usage

RunSCExplorer(
  base_dir = "SCExplorer",
  DataFile = "Data.hdf5",
  MetaFile = "Meta.hdf5",
  title = "SCExplorer",
  initial_dataset = NULL,
  initial_reduction = NULL,
  initial_group = NULL,
  initial_feature = NULL,
  initial_assay = NULL,
  initial_slot = NULL,
  initial_label = FALSE,
  initial_cell_palette = "Paired",
  initial_feature_palette = "Spectral",
  initial_theme = "theme_scp",
  initial_size = 4,
  initial_ncol = 3,
  initial_arrange = NULL,
  initial_raster = NULL,
  session_workers = 2,
  plotting_workers = 8,
  create_script = TRUE,
  style_script = require("styler", quietly = TRUE),
  overwrite = FALSE,
  return_app = TRUE
)

Arguments

base_dir

A string. The base directory of the SCExplorer app. Default is "SCExplorer".

DataFile

A string. The name of the HDF5 file that stores data matrices for each dataset. Default is "Data.hdf5".

MetaFile

A string. The name of the HDF5 file that stores metadata for each dataset. Default is "Meta.hdf5".

title

A string. The title of the SCExplorer app. Default is "SCExplorer".

initial_dataset

A string. The initial dataset to be loaded into the app. Default is NULL.

initial_reduction

A string. The initial dimensional reduction method to be loaded into the app. Default is NULL.

initial_group

A string. The initial variable to group cells in the app. Default is NULL.

initial_feature

A string. The initial feature to be loaded into the app. Default is NULL.

initial_assay

A string. The initial assay to be loaded into the app. Default is NULL.

initial_slot

A string. The initial slot to be loaded into the app. Default is NULL.

initial_label

A string. Whether to add labels in the initial plot. Default is FALSE.

initial_cell_palette

A string. The initial color palette for cells. Default is "Paired".

initial_feature_palette

A string. The initial color palette for features. Default is "Spectral".

initial_theme

A string. The initial theme for plots. Default is "theme_scp".

initial_size

A numeric. The initial size of plots. Default is 4.

initial_ncol

A numeric. The initial number of columns for arranging plots. Default is 3.

initial_arrange

A logical. Whether to use "Row" as the initial arrangement. Default is TRUE.

initial_raster

A logical. Whether to perform rasterization in the initial plot. By default, it is set to automatic, meaning it will be TRUE if the number of cells in the initial datasets exceeds 100,000.

session_workers

A numeric. The number of workers for concurrent execution in an asynchronous programming session. Default is 2.

plotting_workers

A numeric. The number of threads per worker for parallel plotting. Default is 8.

create_script

A logical. Whether to create the SCExplorer app script. Default is TRUE.

style_script

A logical. Whether to style the SCExplorer app script. Default is TRUE.

overwrite

A logical. Whether to overwrite existing files. Default is FALSE.

return_app

A logical. Whether to return the SCExplorer app. Default is TRUE.

Examples

if (FALSE) {
data("pancreas_sub")
pancreas_sub <- Standard_SCP(pancreas_sub)
data("panc8_sub")
panc8_sub <- Integration_SCP(srtMerge = panc8_sub, batch = "tech", integration_method = "Seurat")

PrepareSCExplorer(list(mouse_pancreas = pancreas_sub, human_pancreas = panc8_sub), base_dir = "./SCExplorer", overwrite = TRUE)

# Create the app.R script
app <- RunSCExplorer(
  base_dir = "./SCExplorer",
  initial_dataset = "mouse_pancreas",
  initial_group = "CellType",
  initial_feature = "Neurog3",
  session_workers = 2,
  overwrite = TRUE
)
list.files("./SCExplorer") # This directory can be used as site directory for Shiny Server.

# Run shiny app
if (interactive()) {
  shiny::runApp(app)
}
# Note: If SCP installed in the isolated environment using renv, you need to add `renv::activate(project = "path/to/SCP_env")` to the app.R script.

####################################################################################################################
# You can deploy the app on the self-hosted shiny server(https://www.rstudio.com/products/shiny/shiny-server/).
# Or deploy the app on the website(https://www.shinyapps.io) for free:

### step1: set the repository URL for Bioconductor packages and update them to the latest version
# options(repos = BiocManager::repositories())
# BiocManager::install(ask = FALSE)

### step2: install "rsconnect" package and authorize your account
# install.packages("rsconnect")
# library(rsconnect)
# setAccountInfo(name = "<NAME>", token = "<TOKEN>", secret = "<SECRET>")

### step3: deploy the app
# deployApp("./SCExplorer")
}