在朋友圈刷到了一个(Published: 25 March 2024)的文章:《Assessing GPT-4 for cell type annotation in single-cell RNA-seq analysis》,题目短小精悍,就两个作者,关键是发表在《Nature Methods》杂志,算是生信顶刊了。
install.packages("openai") remotes::install_github("Winnie09/GPTCelltype") # IMPORTANT! Assign your OpenAI API key. See Vignette for details Sys.setenv(OPENAI_API_KEY = 'your_openai_API_key')
麻烦的是这个时候需要打开自己的r运行代码的时候设置一下自己的OPENAI_API_KEY值哦,需要登录chatGPT官网注册账号并且获取 OPENAI_API_KEY 即可。接下来就是自己的单细胞转录组数据的降维聚类分群后的FindAllMarkers拿到每个亚群的基因列表,就可以运行它的核心就一句话代码而已:
res ,把命名好的亚群给回去我们的seurat对象即可,如下所示:
# Assume you have already run the Seurat pipeline https://satijalab.org/seurat/ # "obj" is the Seurat object; "markers" is the output from FindAllMarkers(obj) # Cell type annotation by GPT-4 res 'gpt-4')
# Assign cell type annotation back to Seurat object [email protected]$celltype # Visualize cell type annotation on UMAP DimPlot(obj,group.by='celltype')
如果你仔细看它这个思路最早是在预印本,Hou, W. and Ji, Z., 2023. Assessing GPT-4 for cell type annotation in single-cell RNA-seq analysis. bioRxiv, pp.2023-04, doi: https://doi.org/10.1101/2023.04.16.537094.,也就是说是 2023.04.16 ,但是我朋友圈的小伙伴早一个多月就测试了同样的思路: