intermediate 30 min

Data Portal for Single Cell Sequencing

Build an interactive viewer for single-cell RNA sequencing data using public datasets from the CZ CELLxGENE data portal.

Organise project

  1. Create a folder for your project on your computer

  2. Create a data folder outside of your project folder

Get single-cell data

  1. Browse the CELLxGENE collections and find a dataset. For this example we use the Allen Institute Adult Human Brain Atlas - specifically the midbrain (substantia nigra) snRNA-seq dataset.

  2. Download the .h5ad file to your laptop (it is 416.2 MB). The dataset contains 59,505 cells x 58,232 genes with 11 cell types across 3 donors. Key metadata columns include cell_type, cluster_id, supercluster_term, donor_id, and UMAP coordinates in obsm['X_UMAP'].

Get prompting!

  1. In Plan mode, type:
Build an interactive viewer for my single-cell RNA data. The file is at [path/to/data.h5ad].

Result

Single Cell Viewer

Publish to GitHub

Once your app is working, you can save it to GitHub:

Install GitHub CLI

  1. Download GitHub CLI
  2. Authenticate: gh auth login

Upload your code

In chat mode, ask:

Push my project to a new GitHub repository called [your-repo-name]

Or create a repo first:

Create a new private GitHub repository called [your-repo-name], then push my code to it

Keep your context clean while working

Long sessions building and debugging your app will fill the context window quickly. Before pushing to GitHub, read the Managing Context tutorial to learn how to use /compact, maintain a PLAN.md, and avoid hallucinations on longer projects.