GitHub View CyteType

First annotation

Run a minimal end-to-end CyteType annotation in Python or R.

A minimal end-to-end run. No API key required for the default configuration.

import scanpy as sc
from cytetype import CyteType

# Load your preprocessed AnnData
# adata must have clusters in adata.obs and rank_genes_groups in adata.uns
group_key = "leiden"

annotator = CyteType(
    adata,
    group_key=group_key,
    rank_key="rank_genes_" + group_key,
    n_top_genes=50,
)

adata = annotator.run(
    study_context="Human PBMC from healthy donor, 10X Genomics 3' scRNA-seq"
)

# Annotations are now in adata.obs
sc.pl.umap(adata, color=f"cytetype_annotation_{group_key}")
library(Seurat)
library(CyteTypeR)

# Find markers (if not already done)
pbmc.markers <- FindAllMarkers(pbmc, only.pos = TRUE)

# Step 1: prepare data
prepped_data <- PrepareCyteTypeR(
  obj = pbmc,
  marker_table = pbmc.markers,
  group_key = "seurat_clusters",
  n_top_genes = 50,
  coordinates_key = "umap"
)

# Step 2: submit and annotate
pbmc <- CyteTypeR(
  obj = pbmc,
  prepped_data = prepped_data,
  study_context = "Human PBMC from healthy donor, 10X Genomics 3' scRNA-seq"
)

# Annotations are now in obj@meta.data
DimPlot(pbmc, group.by = "cytetype_seurat_clusters")

A link to your interactive HTML report is printed during the run. Results are also written directly back to your object.

💡 Tip: The study_context string is the most important parameter for annotation quality. Describe tissue, organism, disease state, and experimental setup in one or two sentences.

Learn more

Python client

R client

Understanding your report