R/prepShinyCellModular.R
prepShinyCellModular.RdTakes a Seurat object from single cell experiments and prepares all files
needed to run a ShinyCellModular interactive Shiny app. Writes HDF5 counts,
ShinyCell config files, optional 3D UMAP, marker genes, and motif data to
out_dir.
prepShinyCellModular(
seurat_obj = NULL,
seurat_rds = NULL,
out_dir = "ShinyCellModular_app",
shiny_title = "ShinyCellModular Intermediate",
assays_selected = "RNA",
ident_col = NULL,
do_variable_features = TRUE,
do_markers = FALSE,
markers_file = NULL,
markers_overwrite = FALSE,
markers_res_pattern = "res\\.",
do_umap3d = FALSE,
umap3d_reductions = c("pca"),
umap3d_dims = 1:30,
umap3d_name_suffix = "_umap3d",
do_counts_h5 = TRUE,
counts_h5_file = NULL,
counts_overwrite = TRUE,
counts_layer = "counts",
do_make_app = TRUE,
gene_mapping = TRUE,
install_missing = FALSE,
verbose = TRUE,
do_motifs = "auto",
motifs_findmotifs = NULL,
motifs_overwrite = TRUE,
fragments_paths = NULL,
custom_colors = NULL,
default_genes = NULL,
help = FALSE
)Seurat object. Alternative to seurat_rds.
Path to a .rds Seurat object. Alternative to seurat_obj.
Output directory. Default: 'Files_ShinyCell'.
Title for the Shiny app.
Assay(s) to process. e.g. c('RNA', 'ATAC'). Default: 'RNA'.
Column to set as Idents. Default: NULL (uses existing).
Run FindVariableFeatures before creating the ShinyCell config. Default: TRUE.
Compute marker genes with presto. Default: FALSE.
Path for output markers parquet file. Default: auto.
Overwrite existing markers file. Default: FALSE.
Regex pattern to find resolution columns. Default: 'res\\.'.
Run 3D UMAP. Default: FALSE.
Reductions to use as input for 3D UMAP. Default: c('pca').
Dims to pass to UMAP (auto-capped to available). Default: 1:30.
Suffix appended to the 3D UMAP reduction name. Default: '_umap3d'.
Write raw counts to HDF5. Default: TRUE.
Path for output H5 file. Default: auto.
Overwrite existing H5 file. Default: TRUE.
Seurat layer to use for counts. Default: 'counts'.
Run makeShinyApp. Default: TRUE.
Map gene names in ShinyCell. Default: TRUE.
Auto-install missing packages. Default: FALSE.
Print progress messages. Default: TRUE.
Extract motifs from ATAC assay. Runs automatically when ATAC is in
assays_selected and the motifs slot is populated. Set to FALSE to skip.
Default: 'auto'.
Output of FindMotifs(), adds enrichment scores. Default: NULL.
Overwrite existing motif files. Default: TRUE.
Optional named list of fragment file path overrides by index.
e.g. list('1' = '/path/to/sample1.tsv.gz'). If NULL, paths are copied
from the original paths in the object. Default: NULL.
Named character vector of label -> hex color to override ShinyCell
default colors. Extra names not in the data are ignored. Default: NULL.
Character vector of gene names to set as defaults in the app
(e.g. c('CD4', 'CD8A')). If NULL, ShinyCell picks its own defaults.
Default: NULL.
Print the help message and return. Default: FALSE.
Invisibly returns NULL. Writes output files to out_dir.
if (FALSE) { # \dontrun{
prepShinyCellModular(
seurat_rds = "seurat_object.rds",
out_dir = "my_app_files",
do_umap3d = TRUE,
do_markers = TRUE
)
} # }