Skip to content

Annotate Cell Types using Custom GPT

Notifications You must be signed in to change notification settings

XWcode11/CellTypeGPT

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

CellTypeGPT: Automatic cell type annotation with custom GPT

Installation

To install the latest version of CellTypeGPT package via Github, run the following commands in R:

remotes::install_github("XWcode11/CellTypeGPT")

🚀 Quick start with Seurat pipeline


# IMPORTANT! Assign your OpenAI API key. See Vignette for details
Sys.setenv(OPENAI_API_KEY = 'your_openai_API_key')

# Load packages
library(CellTypeGPT)


# 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 custom GPT
res <- annotate_cell_types(af.markers,tissuename='liver cancer', model = 'gpt-4o', topgenenumber=50, api_base = 'https://custom.url/v1/chat/completions')

# Assign cell type annotation back to Seurat object
[email protected]$celltype <- as.factor(res[as.character(Idents(obj))])

# Visualize cell type annotation on UMAP
DimPlot(obj,group.by='celltype')

About

Annotate Cell Types using Custom GPT

Resources

Stars

Watchers

Forks

Packages

No packages published

Languages

  • R 100.0%