Skip to contents

Run SCExplorer

Usage

RunSCExplorer(
  base_dir = "SCExplorer",
  data_file = "data.hdf5",
  meta_file = "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 = "Chinese",
  initial_feature_palette = "Spectral",
  initial_theme = "theme_scop",
  initial_size = 4,
  initial_ncol = 3,
  initial_arrange = NULL,
  initial_raster = NULL,
  create_script = TRUE,
  style_script = TRUE,
  overwrite = TRUE,
  return_app = TRUE,
  verbose = TRUE
)

Arguments

base_dir

The base directory of the SCExplorer app.

data_file

HDF5 file that stores data matrices for each dataset.

meta_file

HDF5 file that stores metadata for each dataset.

title

The title of the SCExplorer app.

initial_dataset

The initial dataset to be loaded into the app.

initial_reduction

The initial dimensional reduction method to be loaded into the app.

initial_group

The initial variable to group cells in the app.

initial_feature

The initial feature to be loaded into the app.

initial_assay

The initial assay to be loaded into the app.

initial_slot

The initial layer to be loaded into the app.

initial_label

Whether to add labels in the initial plot.

initial_cell_palette

The initial color palette for cells.

initial_feature_palette

The initial color palette for features.

initial_theme

The initial theme for plots.

initial_size

The initial size of plots.

initial_ncol

The initial number of columns for arranging plots.

initial_arrange

Whether to use "Row" as the initial arrangement.

initial_raster

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.

create_script

Whether to create the SCExplorer app script.

style_script

Whether to style the SCExplorer app script.

overwrite

Whether to overwrite existing data in the data file.

return_app

Whether to return the SCExplorer app.

verbose

Whether to print the message. Default is TRUE.

Examples

if (FALSE) { # \dontrun{
data(pancreas_sub)
pancreas_sub <- RunStandardWorkflow(pancreas_sub)
data(panc8_sub)
panc8_sub <- RunIntegration(
  panc8_sub,
  batch = "tech",
  integration_methods = "Harmony"
)
panc8_sub <- RunStandardWorkflow(panc8_sub)

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

# Create the app.R script
app <- RunSCExplorer(
  base_dir = "./SCExplorer",
  initial_dataset = "mouse_pancreas",
  initial_group = "CellType",
  initial_feature = "Ncoa2"
)
# Check files
list.files("./SCExplorer")

# Run shiny app
thisutils::check_r("shiny", verbose = FALSE)
thisutils::get_namespace_fun("shiny", "runApp")(app)
# Note: If scop installed in the isolated environment using renv,
# add `renv::activate(project = "path/to/scop_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: install "rsconnect" package and authorize your account
# install.packages("rsconnect")
# library(rsconnect)
# setAccountInfo(
#   name = "<NAME>",
#   token = "<TOKEN>",
#   secret = "<SECRET>"
# )

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