GitHub
Back to all tutorials

Core analysis

scRNA-seq Analysis

This tutorial analyzes one 10x Genomics scRNA-seq dataset in CellPilot: loading an H5 count file, reading the clusters, naming cell types, plotting marker genes, and changing analysis parameters. Every command is typed in the chat box of the AI Assistant panel; no code or API key is needed. The screenshots come from CellPilot 2.1.0 running this exact dataset, so you can compare your screen with each step.

Input data

The example is the 10x Genomics 10k Mouse Kidney Cells, scFFPE singleplex dataset: a filtered feature-barcode matrix in H5 format with 9,616 cells and 19,059 genes. Download it in a terminal (or open the link in a browser):

curl -O https://cf.10xgenomics.com/samples/cell-exp/7.1.0/10k_mouse_kidney_scFFPE_singleplex_10k_mouse_kidney_scFFPE_singleplex/10k_mouse_kidney_scFFPE_singleplex_10k_mouse_kidney_scFFPE_singleplex_count_sample_filtered_feature_bc_matrix.h5

For your own data, CellPilot reads the filtered_feature_bc_matrix.h5 from Cell Ranger, or a 10x MatrixMarket folder (matrix.mtx.gz, features.tsv.gz or genes.tsv.gz, barcodes.tsv.gz). No renaming is needed.

1. Load the dataset

  1. Open CellPilot.
  2. In the Data Loader & Model panel, set Data Type to scRNA-seq and Data to Single sample.
  3. Click Browse and select the downloaded H5 file (or the folder that contains it).
  4. Wait for the analysis to finish; the status messages in the chat show each step.

CellPilot runs the standard single-cell workflow on your computer (bakana / scran.js): quality control, normalization, highly variable genes, PCA, a nearest-neighbor graph, UMAP, graph-based clustering, and marker detection. Quality control is automatic: cells more than 3 median absolute deviations (MADs) from the median in total counts, detected genes, or mitochondrial fraction are removed.

What you should see: 8,302 of 9,616 cells pass quality control, the UMAP shows 21 clusters (numbered from 0), and the data panel lists the file type (10X HDF5), cell and gene counts.
CellPilot after loading the mouse kidney dataset: UMAP colored by cluster
After loading: the UMAP View (top left) colored by cluster, and the data panel (bottom right) with 8,302 cells and 19,059 genes.

Cluster numbers come from the clustering of this dataset. If your numbers differ slightly (another CellPilot version can split the cells a little differently), use the cell type names from step 3 rather than the numbers below.

2. Explore a cluster

Ask about any cluster by its number:

Tell me about cluster 6
Find markers for cluster 6

The first command answers in the chat with the cluster size and its top marker genes. The second opens the full marker table in the Analysis View: genes ranked by how specifically they are expressed in the cluster compared with all other cells (Wilcoxon rank-sum test). avg_log2FC is the fold change, pct.1 and pct.2 the fraction of cells expressing the gene inside and outside the cluster. Click a gene name to plot it.

Cluster 6 has 719 cells (8.7% of all cells); its top markers include Higd1c, Mpped1 and Gcm1. Step 3 identifies it as proximal tubule S3.
Marker gene table of cluster 6
Marker genes of cluster 6 in the Analysis View.

3. Identify cell types

Annotate all clusters

CellPilot compares every cluster with built-in reference atlases and reports the most similar cell type, how confident the match is, and the genes it shares with the reference. It first finds the organ (here, kidney) and then only considers that organ's cell types plus immune cells. The comparison runs on your computer; it is a similarity to published atlases, not an AI judgement. Clusters marked ? are not clear-cut; ask what is cluster N to see the genes that tell the candidates apart.

Cluster annotation table
The chat lists every cluster with its likely cell type and the genes it shares with the reference; the same results appear as a table in the Analysis View.

CellPilot then asks whether to rename the clusters with these names. Reply yes to use them. In this tutorial we reply no and name the main kidney cell types ourselves in the next step. For this dataset the annotation gives, among others:

ClustersCell typeShort name used below
1, 3, 6, 9proximal tubule (PT-S2, PT-S1, PT-S3, PT-S1/S2)PT
5, 12thick ascending limb of the loop of Henle (medullary, cortical)TAL
15podocytePod
0, 4, 16endothelial cells (peritubular capillary, vasa recta)—
2, 17distal convoluted tubule (DCT2, DCT1)—
13, 14collecting duct (type B intercalated cells, inner medullary collecting duct)—
8, 11, 18fibroblasts, pericytes / smooth muscle, macrophages—

4. Rename clusters

Give clusters biological names. Several clusters can share one name, and several renames can be chained in one message:

Rename cluster 1, 3, 6 and 9 to PT, then rename cluster 5 and 12 to TAL, then rename cluster 15 to Pod

The UMAP, plots, and marker searches now use the new names. A name shared by several clusters works as one group:

Find markers for PT
The PT marker table covers all four clusters together (2,057 cells); its top genes are proximal tubule transporters such as Slc22a30 and Slc22a28.
UMAP with renamed clusters and PT marker genes
Renamed clusters on the UMAP (PT, TAL, Pod) and the marker genes of the PT group.

CellPilot keeps the original cluster numbers internally; cluster 1 still works after renaming. A name that matches no cluster (for example Find markers for PT before any cluster is called PT) is answered with a short note instead of a result.

5. Plot marker genes

Gene names are typed as they appear in the dataset (mouse genes here, e.g. Slc5a2; human genes are upper case, e.g. SLC5A2):

Plot Slc5a2
Violin plot Slc5a2
Dotplot Slc5a2 Umod Nphs2 Pecam1 Ptprc
Change color to green black red

Plot colors the UMAP by expression; Violin plot shows the expression per cluster; Dotplot compares several genes across clusters (dot size: fraction of cells expressing the gene; color: mean expression). Violin and dot plots use your cluster names. Change color recolors the last expression or dot plot.

UMAP colored by Slc5a2 expression
Plot Slc5a2: SGLT2, expressed in the early proximal tubule.
Violin plot of Slc5a2 by cluster
Violin plot Slc5a2: highest in the PT group.
Dot plot of five marker genes
Dotplot: Slc5a2 (PT), Umod (TAL), Nphs2 (podocytes), Pecam1 (endothelium), Ptprc (immune cells).
Dot plot with a green-black-red color scale
Change color to green black red applied to the dot plot.

6. Adjust analysis parameters

See the settings of any step, then change them in plain words. CellPilot reruns only the steps that need it.

List parameters for cell filtering
Rerun the analysis by setting min gene = 500
Rerun umap with min dist = 0.4
Recluster the cells using resolution = 2.0
CommandWhat happens
List parameters for cell filteringShows the quality-control settings and how many cells were kept (8,302 of 9,616).
Rerun the analysis by setting min gene = 500Also removes cells with fewer than 500 detected genes, on top of the automatic quality control, and reruns the whole analysis: 8,065 cells remain. You can also set min UMIs or mito, e.g. filter cells with mito above 15%.
Rerun umap with min dist = 0.4Recomputes only the UMAP layout (larger values spread the points more); clusters stay the same.
Recluster the cells using resolution = 2.0Recomputes the clusters: higher resolution gives more, smaller clusters (27 clusters here), lower gives fewer.

Rerunning the analysis or reclustering creates new clusters, so cluster names you gave earlier are cleared; annotate or rename again afterwards.

Cell filtering parameters in the chat
List parameters for cell filtering after setting min gene = 500: the automatic thresholds (162 counts, 2.6% mitochondrial reads) are kept and the gene minimum is raised to 500.
UMAP after reclustering at resolution 2.0
After Recluster the cells using resolution = 2.0: 27 clusters.

7. Save and revisit results

CellPilot saves the analysis (UMAP, clusters, and cluster names) as cellpilot_results.json next to the data. When you load the same dataset again, CellPilot asks whether to load the previous results, so you can continue where you left off without rerunning the analysis.