美文网首页
ScType 自动注释

ScType 自动注释

作者: oceanandshore | 来源:发表于2023-04-17 21:01 被阅读0次

ScType 用的好像比较少,就两篇教程。
ScType 数据库:单细胞自动化注释工具 - 简书 (jianshu.com)
全方位讲解单细胞自动化注释工具

本来是有网站的,上不去。 https://sctype.app
只有github IanevskiAleksandr/sc-type (github.com)

这个注释方法和singleR一样简单,代码如下:

### sctpye注释

install.packages("HGNChelper")

# load libraries and functions #加载三个包
lapply(c("dplyr","Seurat","HGNChelper","openxlsx"), library, character.only = T)

#加载写好的代码
# load gene set preparation function
source("https://raw.githubusercontent.com/IanevskiAleksandr/sc-type/master/R/gene_sets_prepare.R")

# load cell type annotation function
source("https://raw.githubusercontent.com/IanevskiAleksandr/sc-type/master/R/sctype_score_.R")


#加载参考基因集ScTypeDB_short.xlsx,提取其中的Immune system
db_ = "https://raw.githubusercontent.com/IanevskiAleksandr/sc-type/master/ScTypeDB_full.xlsx";
tissue = "Immune system"

gs_list = gene_sets_prepare(db_, tissue)
gs_list


#细胞类型中阳性和阴性标记基因

gs_list$gs_positive
gs_list$gs_negative

###用读取rds的方法会报错
#load example scRNA-seq matrix
#scRNAseqData = readRDS(file = "./scRNA1_20230414.rds")
#注释
#es.max = sctype_score(scRNAseqData = scRNAseqData, scaled = TRUE, gs = gs_list$gs_positive, gs2 = gs_list$gs_negative)
Error in dimnames(x) <- dn : 'dimnames' applied to non-array
In addition: Warning message:
In sctype_score(scRNAseqData = scRNAseqData, scaled = TRUE, gs = gs_list$gs_positive,  :
 
 Error in dimnames(x) <- dn : 'dimnames' applied to non-array


#注释
es.max = sctype_score(scRNAseqData = scRNA1[["RNA"]]@scale.data, scaled = TRUE, 
                      gs = gs_list$gs_positive, gs2 = gs_list$gs_negative) 

View(es.max)

# merge by cluster
cL_resutls = do.call("rbind", lapply(unique(scRNA1@meta.data$seurat_clusters), function(cl){
  es.max.cl = sort(rowSums(es.max[ ,rownames(scRNA1@meta.data[scRNA1@meta.data$seurat_clusters==cl, ])]), decreasing = !0)
  head(data.frame(cluster = cl, type = names(es.max.cl), scores = es.max.cl, ncells = sum(scRNA1@meta.data$seurat_clusters==cl)), 10)
}))

sctype_scores = cL_resutls %>% group_by(cluster) %>% top_n(n = 1, wt = scores)  

sctype_scores
write.csv(sctype_scores, "./celltype_anno_sctypeR20230417.csv")

这是做出的注释:

cluster type
0 CD8+ NKT-like cells
1 Memory CD4+ T cells
2 CD8+ NKT-like cells
3 Classical Monocytes
4 Natural killer cells
5 Naive CD4+ T cells
6 γδ-T cells
7 Macrophages
8 CD4+ NKT-like cells
9 Pre-B cells
10 Non-classical monocytes
11 Endothelial
12 Naive CD4+ T cells
13 Erythroid-like and erythroid precursor cells
14 Naive B cells
15 Platelets
16 Cancer cells
17 HSC/MPP cells
18 Neutrophils
19 Non-classical monocytes
20 Progenitor cells

此数据为PBMC,看来注释的也是不靠谱,没比sigleR的fine注释强到那里去。也就做个参考,还是以main注释为基础,慢慢找marker 比较靠谱。

相关文章

  • ScType 数据库:单细胞自动化注释工具

    ScType 数据库(https://sctype.app) 生信人文章:https://mp.weixin.qq...

  • Flutter自动注释(尾注释)、 Android Studio

    相信大家都找Flutter自动注释、Flutter尾注释、 Android Studio自动注释、Flutter尾...

  • 2019-04-08 idea配置

    取消 自动更新 类-添加自动注释 方法-添加自动注释 自动导包 --类 大小写字符自动联想 序列化serialVe...

  • WebStorm快捷键

    1 自动注释和撤销注释:ctrl+/在一句代码前面用 ctrl+/ 可以自动注释和撤销注释,js,html都可以,...

  • WebStorm技巧快捷键

    1.自动注释和撤销注释:ctrl+/ 在一句代码前面用 ctrl+/ 可以自动注释和撤销注释,js,html都可以...

  • 单细胞转录组细胞注释概述

    细胞注释三步走:1)自动注释、2)手动注释、3)验证 首先,自动注释目前分两大类,一类是用预定的‘marker g...

  • 常用Xcode插件

    自动生成注释插件,匹配代码注释 VVDocumenter 正在编辑行可自动高亮,很实用 Backlight-fo...

  • iOS开发者代码规范

    1. 代码注释格式 (1)文件注释:采用Xcode自动生成的注释格式。 // // AppDelegate.h /...

  • 小鼠自动注释

    ###########################SingleR对小鼠免疫单细胞自动注释 #install.p...

  • idea添加注释

    类注释 方法注释 1.添加自定义注释分组 2.添加自定义注释 使用效果 附加 添加自动获取参数注释 $param$...

网友评论

      本文标题:ScType 自动注释

      本文链接:https://www.haomeiwen.com/subject/dlmzddtx.html