View source: R/registration_wrapper.R
registration_wrapper | R Documentation |
This function is provided for convenience. It runs all the functions
required for computing the modeling_results
. This can be useful for
finding marker genes on a new spatially-resolved transcriptomics dataset
and thus using it for run_app()
. The results from this function can also be
used for performing spatial registration through layer_stat_cor()
and
related functions of sc/snRNA-seq datasets.
registration_wrapper(
sce,
var_registration,
var_sample_id,
covars = NULL,
gene_ensembl = NULL,
gene_name = NULL,
suffix = "",
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 |
gene_ensembl |
A |
gene_name |
A |
suffix |
A |
min_ncells |
An |
pseudobulk_rds_file |
A |
We chose a default of min_ncells = 10
based on OSCA from section 4.3
at
http://bioconductor.org/books/3.15/OSCA.multisample/multi-sample-comparisons.html.
They cite https://doi.org/10.1038/s41467-020-19894-4 as the paper where
they came up with the definition of "very low" being 10. You might want
to use registration_pseudobulk()
and manually explore sce_pseudo$ncells
to choose the best cutoff.
A list()
of data.frame()
with the statistical results. This is
similar to fetch_data("modeling_results")
.
Other spatial registration and statistical modeling functions:
registration_block_cor()
,
registration_model()
,
registration_pseudobulk()
,
registration_stats_anova()
,
registration_stats_enrichment()
,
registration_stats_pairwise()
## 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)))
## Compute all modeling results
example_modeling_results <- registration_wrapper(
sce,
var_registration = "Cell_Cycle",
var_sample_id = "sample_id",
covars = c("age"),
gene_ensembl = "ensembl",
gene_name = "gene_name",
suffix = "wrapper"
)
## Explore the results from registration_wrapper()
class(example_modeling_results)
length(example_modeling_results)
names(example_modeling_results)
lapply(example_modeling_results, head)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.