The R package CTSV implements the CTSV approach developed by Jinge Yu and Xiangyu Luo that detects cell-type-specific spatially variable genes accounting for excess zeros. CTSV directly models sparse raw count data through a zero-inflated negative binomial regression model, incorporates cell-type proportions, and performs hypothesis testing based on R package pscl. The package outputs p-values and q-values for genes in each cell type, and CTSV is scalable to datasets with tens of thousands of genes measured on hundreds of spots. CTSV can be installed in Windows, Linux, and Mac OS.
Bioconductor package: qvalue (>=2.24.0)
if (!requireNamespace("BiocManager", quietly=TRUE))
install.packages("BiocManager")
BiocManager::install("CTSV", version = "devel")
or
devtools::install_github("jingeyu/CTSV")
The following shows an example that runs the main functions "ctsv" and "SVGene" in our package.
``` {r, eval=FALSE} library(CTSV)
data(CTSVexample_data) spe <- CTSVexample_data[[1]] W <- CTSVexample_data[[2]] gamma_true <- CTSVexample_data[[3]]
G <- nrow(spe)
n <- ncol(spe)
K <- ncol(W) print(G) print(n) print(K)
print(sum(rowSums(gamma_true)>0))
result <- ctsv(spe,W,num_core = 8)
head(result$qval)
re <- svGene(result$qval,0.05)
print(re$SVGene)
or you can simply run
``` {r, eval=FALSE}
library(CTSV)
example(ctsv)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.