CTSV | R Documentation |
Detection of cell-type-specific spatially variable genes
CTSV(spe, W, num_core = 1, BPPARAM = NULL)
spe |
An SpatialExperiment class. |
W |
An n by K cell-type proportion matrix, where K is the number of cell types. The column names of W are cell type names. |
num_core |
Number of cores if using paralleling. The default is one. |
BPPARAM |
Optional additional argument for parallelization. The default is NULL, in which case |
A list with a G by 2K matrix of p-values and a G by 2K matrix of q-values.
pval |
A G by 2K matrix of p-values. The first K columns correspond to the first coordinate, and the last K columns to the second coordinate. |
qval |
A G by 2K matrix of q-values. The first K columns correspond to the first coordinate, and the last K columns to the second coordinate. |
library(CTSV) #read example data data(CTSVexample_data) spe <- CTSVexample_data[[1]] W <- CTSVexample_data[[2]] gamma_true <- CTSVexample_data[[3]] # gene number G <- nrow(spe) # spot number n <- ncol(spe) # cell type number K <- ncol(W) G n K # SV genes in each cell type: rownames(W)[which(gamma_true[,1] == 1)] rownames(W)[which(gamma_true[,2] == 1)] # Number of SV genes at the aggregated level: sum(rowSums(gamma_true)>0) #--- Run CTSV ---- result <- CTSV(spe,W,num_core = 8) # View on q-value matrix head(result$qval) # detect SV genes re <- svGene(result$qval,0.05) #SV genes in each cell type: re$SVGene
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.