Code Monkey home page Code Monkey logo

ctsv's Introduction

CTSV: Identification of cell-type-specific spatially variable genes accounting for excess zeros

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.

Prerequisites and Installation

  1. R version >= 4.2.0.

  2. CRAN package: stats (>= 4.1.0), doParallel (>= 1.0.16), doSNOW (>= 1.0.19), foreach (>= 1.5.1), pscl (>= 1.5.5)

    Bioconductor package: qvalue (>=2.24.0)

  3. Install the package CTSV.

if (!requireNamespace("BiocManager", quietly=TRUE))
    install.packages("BiocManager")
BiocManager::install("CTSV", version = "devel")

or

devtools::install_github("jingeyu/CTSV")

Example Code

The following shows an example that runs the main functions "ctsv" and "SVGene" in our package.

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)
print(G)
print(n)
print(K)
# SV genes in each cell type:
#' print(rownames(W)[which(gamma_true[,1] == 1)])
#' print(rownames(W)[which(gamma_true[,2] == 1)])
# Number of SV genes at the aggregated level:
print(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:
print(re$SVGene)

or you can simply run

library(CTSV)
example(ctsv)

Remarks

  • If you have any questions regarding this package, please contact Jinge Yu at [email protected].

ctsv's People

Contributors

jingeyu avatar

Stargazers

 avatar  avatar

Watchers

 avatar

ctsv's Issues

关于数据处理的问题

老师您好,我这里在复现论文的时候,能够利用说明书上的数据完成SV基因的识别,但是CTSV函数使用的CTSVexample_data中的spe这个列表我不太清楚要如何构造,用于其他数据的应用
image
我不清楚应该如何如何将计数矩阵和空间坐标进行转化,您这里可以给出一些帮助吗

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.