Source: https://docs.nygen.io/CyteType/getting-started/quickstart/ Revision: 6ce97c558d4353ff1796056a86b1e6d8b42f4b4e Structured page: https://docs.nygen.io/CyteType/getting-started.quickstart.json Quickstart (Python) This page annotates the clusters of a small public dataset, 2,700 peripheral blood mononuclear cells (PBMCs) from 10x Genomics, starting from a fresh Python session. The preprocessing runs locally in a few minutes; the annotation itself runs on CyteType’s servers. The outputs on this page come from a real run of this notebook. Before you start, you need: Python 3.12 or newer with CyteType and Scanpy installed, for example with pip install cytetype "scanpy[leiden]" (see Installation ). A CyteType sign-in on this machine. Run cytetype setup once in a terminal (see Sign in and API keys ). Working in R? The same workflow with Seurat is in the R quickstart . Load and cluster the data CyteType annotates the clusters you define, using the marker genes you compute for them. These are the standard Scanpy steps: quality control, normalization, clustering and marker detection. # Import Scanpy for preprocessing and CyteType for annotation. import scanpy as sc from cytetype import CyteType, marker_dotplot # Use a consistent figure resolution for the plots below. sc.set_figure_params(dpi=100, frameon=False) # Download the 10x Genomics PBMC 3k dataset with raw counts. adata = sc.datasets.pbmc3k() adata 0%| | 0.00/5.58M [00:00 explains each requirement. # Check the inputs and build the files that are uploaded with the job. annotator = CyteType(adata, group_key="leiden", rank_key="rank_genes_leiden") Auto-detected gene symbols in adata.var_names (index) (0% ID-like, 100% unique). Using coordinates from 'X_umap' for visualization. Materialized canonical gene symbols in temporary column '__cytetype_gene_symbols' from adata.var_names. Calculating expression percentages: 0%| | 0/1 [00:00). The study context tells CyteType what the sample is. Include the organism, tissue and condition; Study context and metadata has more examples. # Describe the study, submit the job and wait for it to finish. adata = annotator.run( study_context=( "Peripheral blood mononuclear cells (PBMCs) from a healthy human donor, " "profiled with 10x Genomics 3' single-cell RNA-seq." ), metadata={"title": "PBMC 3k quickstart"}, ) Uploading vars.h5 artifact... Uploading: 0%| | 0/1 [00:00). # Get the link to the interactive report. adata.uns["cytetype_jobDetails"]["report_url"] 'https://cytetype.nygen.io/report/a1a55802-b137-4617-aab0-9a6fe65af05e' Save and clean up The results are stored in adata.obs and adata.uns, so they are saved with the AnnData file. cleanup() deletes the upload files and the helper column that CyteType added to adata.var. # Remove the upload files and the temporary helper column. annotator.cleanup() # Save the annotated data; the CyteType results are saved with it. adata.write_h5ad("pbmc3k_cytetype.h5ad") Deleted artifact file: vars.h5 Deleted artifact file: obs.duckdb Deleted temporary canonical gene-symbol column '__cytetype_gene_symbols'. Next steps Prepare your data : requirements for clusters, marker genes and gene symbols. The CyteType report : every section of the report. Results in AnnData and Seurat : all columns and keys. Interpret and review results : confidence, heterogeneity and limits. Use your own LLM : run CyteType with your own model provider.