# The objective of this R script: Run SingleR
# Author: Yuan.Sh
# Date: 2021-10-07 17:07:34
# Blog: https://blog.csdn.net/qq_40966210/category_11165022.html
# Best Regards,
# Yuan.Sh (Major in Bioinfomatics & Deep-learning)
# ---------------------------------------
# School of Basic Medical Sciences,
# Fujian Medical University,
# Fuzhou, Fujian, China.
# please contact with me via the following ways:
# (a) e-mail :yuansh3354@163.com
# (b) QQ : 1044532817
###################################################################
# options
rm(list=ls())
dir()
options(stringsAsFactors = F)
options(as.is = T)
gc()
# packages
library(stringr)
library(magrittr)
library(SingleR)
library(Seurat)
# load data
load('/media/yuansh/14THHD/胰腺癌/pdac.RData')
sce = sce.big
rm(sce.big)
gc()
# SingleR
sce_for_SingleR <- GetAssayData(sce, slot="data")
sce_for_SingleR
# PD1(in T cell) PDCD1 // PDL1(in tumor) CD274
grep('CD274',rownames(sce),value = T)
library(SingleR)
hpca.se <- celldex::HumanPrimaryCellAtlasData()
hpca.se
clusters=sce@meta.data$seurat_clusters
pred.hesc <- SingleR(test = sce_for_SingleR,
ref = hpca.se,
labels = hpca.se$label.main,
#method = "cluster",
clusters = clusters,
assay.type.test = "logcounts",
assay.type.ref = "logcounts")
table(pred.hesc$labels)
save(list=ls(),file = '/media/yuansh/TOSHIBA EXT/singleR.rdata')
单细胞转录组——SingleR自动注释
最新推荐文章于 2024-05-27 09:59:42 发布