Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

36 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

AnnData PyTorch Tutorials

Deploy Jupyter Book License: MIT

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.

View the interactive tutorial website →

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
Grouped cell populations Participants interested in sample-level prediction 30-45 min Open in Colab Model patient-region samples 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 Grouped cell populations 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 grouped cell populations 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.

About

Tutorials on using Single-cell and Spatial Transcriptomics Data in Pytorch

Resources

Stars

Watchers

Forks

Releases

Packages

Contributors

Languages