View source: R/registration_pseudobulk.R
registration_pseudobulk | R Documentation |
Pseudo-bulk the gene expression, filter lowly-expressed genes, and normalize. This is the first step for spatial registration and for statistical modeling.
registration_pseudobulk(
sce,
var_registration,
var_sample_id,
covars = NULL,
min_ncells = 10,
pseudobulk_rds_file = NULL
)
sce |
A SingleCellExperiment-class object or one that inherits its properties. |
var_registration |
A |
var_sample_id |
A |
covars |
A |
min_ncells |
An |
pseudobulk_rds_file |
A |
A pseudo-bulked SingleCellExperiment-class object.
Other spatial registration and statistical modeling functions:
registration_block_cor()
,
registration_model()
,
registration_stats_anova()
,
registration_stats_enrichment()
,
registration_stats_pairwise()
,
registration_wrapper()
## Ensure reproducibility of example data
set.seed(20220907)
## Generate example data
sce <- scuttle::mockSCE()
## Add some sample IDs
sce$sample_id <- sample(LETTERS[1:5], ncol(sce), replace = TRUE)
## Add a sample-level covariate: age
ages <- rnorm(5, mean = 20, sd = 4)
names(ages) <- LETTERS[1:5]
sce$age <- ages[sce$sample_id]
## Add gene-level information
rowData(sce)$ensembl <- paste0("ENSG", seq_len(nrow(sce)))
rowData(sce)$gene_name <- paste0("gene", seq_len(nrow(sce)))
## Pseudo-bulk
sce_pseudo <- registration_pseudobulk(sce, "Cell_Cycle", "sample_id", c("age"), min_ncells = NULL)
colData(sce_pseudo)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.