View source: R/run_scfeatures.R
run_proportion_logit | R Documentation |
This function calculates the proportions of cells belonging to each cell type,
and applies a logit transformation to the proportions.
The input data must contain sample
and celltype
metadata column.
The function supports scRNA-seq and spatial proteomics.
The function returns a dataframe with samples as rows and cell types as columns.
run_proportion_logit(data, type = "scrna", ncores = 1)
data |
A list object containing |
type |
The type of dataset, either "scrna", "spatial_t", or "spatial_p". |
ncores |
Number of cores for parallel processing. |
a dataframe of samples x features The features are in the form of celltype a, celltype b, with the number representing proportions.
utils::data("example_scrnaseq" , package = "scFeatures")
data <- example_scrnaseq[1:50, 1:20]
celltype <- data$celltype
sample <- data$sample
data <- data@assays$RNA@data
alldata <- scFeatures:::formatData(data = data, celltype = celltype, sample = sample )
feature_proportion_logit <- run_proportion_logit(
alldata,
type = "scrna", ncores = 1
)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.