Getting Started#

Tutorials for using single-cell data with PyTorch. These materials are aimed at two groups: machine learning practitioners new to genomics, and genomics researchers wanting to use deep learning.

Tutorials#

Tutorial

Audience

Duration

Open in Colab

What it covers

Basics: Single-cell Data in AnnData format

ML practitioners new to single-cell data

30-45 min

Open in Colab

What scRNA-seq data is and how it differs from typical ML datasets

Basics: Machine Learning with PyTorch

Genomics researchers new to ML

45-60 min

Open in Colab

PyTorch basics explained using genomics examples

Single-cell data in PyTorch

All participants

45-60 min

Open in Colab

Use AnnData’s AnnLoader for per-cell classification and regression

Patient-level learning

Participants interested in sample-level prediction

30-45 min

Open in Colab

Model patient-level cell populations with PyTorch datasets and ggml-ot

Suggested workshop flow: Choose the primer for the domain that is less familiar to you. In a mixed workshop, participants can work through the two primers in parallel, then regroup for Single-cell data in PyTorch. Continue with Patient-level learning as an optional advanced tutorial.

Local installation#

Google Colab requires no local setup. To run the tutorials locally on macOS or Linux:

git clone https://github.com/DaminK/AnnData_Pytorch_Tutorials.git
cd AnnData_Pytorch_Tutorials
python -m venv .venv && .venv/bin/python -m pip install -r requirements.txt
.venv/bin/python -m jupyter lab

The third line creates the virtual environment and installs the dependencies into it in one shell command. Activation is not required. On Windows, replace .venv/bin/python with .venv\Scripts\python.exe.

What you’ll learn#

These tutorials show you how to:

  • Load scRNA-seq data with Scanpy and inspect AnnData objects

  • Build supervised models with PyTorch

  • Handle sparse, high-dimensional biological data

  • Batch cells with AnnData’s AnnLoader and model patient-level data with ggml-ot

  • Evaluate classification and regression workflows

The tutorials include notes explaining genomics concepts for ML practitioners and ML concepts for genomics researchers.

Acknowledgments#

These tutorials use Scanpy, AnnData, PyTorch, and ggml-ot. Documentation is built with Jupyter Book.

Additional Resources#

Useful links:

License#

This project is available under the MIT License.