#install
devtools::install_local("yourpath/CytoTRACE_0.3.3.tar.gz")
#load
library(CytoTRACE)
sva/ccaPP/HiClimR/ncdf4这几个包没有的用BiocManager安装一下,安装HiClimR/ncdf4的时候可能会报错(dependency ‘ncdf4’ is not available for package ‘HiClimR’),在linux终端安装netcdf就好了。
sudo apt-get install libnetcdf-dev
- 推断拟时序起点,可视化结果储存在本地
####提取表型文件
table(sc$celltype)
phe <- sc$celltype
phe = as.character(phe)
names(phe) <- rownames(sc@meta.data)
####提取表达矩阵
mat <- as.matrix(sc@assays$RNA@counts)
mat[1:4,1:4]
results <- CytoTRACE(mat = mat)
#可视化
plotCytoGenes(results, numOfGenes = 10)
plotCytoTRACE(results, phenotype = phe)