Load and preprocess scRNA-seq/snRNA-seq data using seurat SCTransform workflow.

load_scdata(
  ref,
  data_type = c("cellranger", "h5", "matrix"),
  meta_info,
  nfeature_rna = 200,
  percent_mt = 40,
  cc.genes = NULL,
  vars_to_regress = c("percent_mt", "phase"),
  id,
  verbose,
  ...
)

Arguments

ref

path to scRNA-seq/snRNA-seq data.

data_type

a character value specifying data type of the input scRNA-seq/snRNA-seq data, should be one of "cellranger", "h5", "matrix".

meta_info

a data.frame with rows representing cells, columns representing cell attributes.

nfeature_rna

minimum # of features with non-zero UMIs. Cells with # of features lower than nfeature_rna will be removed. Default to 200.

percent_mt

maximum percentage of mitochondria (MT) mapped UMIs. Cells with MT percentage higher than percent_mt will be removed. Default to 40.

cc.genes

cell-cycle genes curated by Seurat. Can be loaded via data(cc.genes)

vars_to_regress

a list of character values indicating the variables to regress for SCTransform normalization step. Default is to regress out MT percentage ("percent_mt") & cell cycle effects ("phase")

id

a character value specifying project or sample id. Only used for printing purposes.

verbose

logical value indicating whether to print messages.

...

additional parameters passed to SCTransform.

Value

a Seurat-class object.

Details

For more details, refer to construct_ref

Examples

if (FALSE) {
samplepath1 <- paste0(system.file("extdata", package = "SCdeconR"), "/refdata/sample1")
samplepath2 <- paste0(system.file("extdata", package = "SCdeconR"), "/refdata/sample2")
ref_list <- c(samplepath1, samplepath2)
phenopath1 <- paste0(system.file("extdata", package = "SCdeconR"),
"/refdata/phenodata_sample1.txt")
phenopath2 <- paste0(system.file("extdata", package = "SCdeconR"),
"/refdata/phenodata_sample2.txt")
phenodata_list <- c(phenopath1,phenopath2)
tmp <- load_scdata(
  ref = ref_list[[1]],
  data_type = c("cellranger"),
  meta_info = fread(file = phenodata_list[[1]], check.names = FALSE, header = TRUE),
  nfeature_rna = 50,
  vars_to_regress = c("percent_mt"),
  id = 1,
  verbose = TRUE)
}