项目作者: xzhoulab

项目描述 :
Identifying spatial pattern genes
高级语言: R
项目地址: git://github.com/xzhoulab/SPRINT.git
创建时间: 2019-04-29T11:56:30Z
项目社区:https://github.com/xzhoulab/SPRINT

开源协议:

下载


SPRINT

SPRINT is an efficient method to identify genes with spatial expression pattern.
The intended applications are spatially resolved RNA-sequencing from e.g.
Spatial Transcriptomics, or in situ gene expression measurements from
e.g. SeqFISH, Merfish.

System requirements

SPRINT has been tested on R 3.3.1 and is platform independent (tested on Linux, OS X and Windows)
Installation can then be done via the devtools package:

  1. library('devtools')
  2. devtools::install_github('xzhoulab/SPRINT')

Alternatively, installation can then be done from a local binary package from the shell:

  1. R CMD INSTALL SPRINT_1.0.0.tar.gz

Sample Code: Analysis of Breast Cancer Data

  1. library('SPRINT')
  2. load("~/data/Layer2_BC_Count.rds")
  3. ## rawcount matrix of genes by cells/spots
  4. rawcount[1:5,1:5]
17.907x4.967 18.965x5.003 18.954x5.995 17.846x5.993 20.016x6.019
GAPDH 1 7 5 1 2
USP4 1 0 0 0 0
MAPKAPK2 1 1 0 0 1
CPEB1 0 0 0 0 0
LANCL2 0 0 0 0 0
  1. ## extract the coordinates from the rawdata
  2. info <- cbind.data.frame(x=as.numeric(sapply(strsplit(colnames(rawcount),split="x"),"[",1)),
  3. y=as.numeric(sapply(strsplit(colnames(rawcount),split="x"),"[",2)),
  4. total_counts=apply(rawcount,2,sum))
  5. rownames(info) <- colnames(rawcount)
  6. ## filter genes and cells/spots and create the SPRINT object for following analysis
  7. sprint <- CreateSPRINTObject(counts=rawcount, location=info[,1:2],
  8. prectage = 0.1,
  9. min_total_counts = 10)
  10. ## total counts for each cell/spot
  11. sprint@lib_size <- apply(sprint@counts, 2, sum)
  12. ## Take the first ten genes as an example
  13. sprint@counts <- sprint@counts[1:10,]
  14. ## Estimating Parameter Under Null
  15. sprint <- sprint.vc(sprint,covariates = NULL, lib_size=sprint@lib_size, num_core=1,verbose=F)
  16. ## Calculating pval
  17. sprint <- sprint.test(sprint, check_positive = T, verbose=F)
  18. ## Check pvals
  19. head(sprint@res_mtest[,c("combined_pvalue","adjusted_pvalue")])
combined_pvalue adjusted_pvalue
GAPDH 7.477171e-09 1.683453e-07
MAPKAPK2 1.016078e-01 5.952118e-01
MCL1 1.149519e-08 1.683453e-07
TMEM109 4.303998e-01 1.000000e+00
TMEM189 6.189064e-01 1.000000e+00
ITPK1 7.213287e-01 1.000000e+00