Scanpy – Single-Cell Analysis in Python#
Scanpy is a scalable toolkit for analyzing single-cell gene expression data built jointly with anndata. It includes preprocessing, visualization, clustering, trajectory inference and differential expression testing. The Python-based implementation efficiently deals with datasets of more than one million cells. For datasets too large to fit into memory, many scanpy functions are now compatible with dask (warning: experimental).
Discuss usage on the scverse Discourse. Read the documentation. If you’d like to contribute by opening an issue or creating a pull request, please take a look at our contribution guide.
scanpy is part of the scverse® project (website, governance) and is fiscally sponsored by NumFOCUS. If you like scverse® and want to support our mission, please consider making a tax-deductible donation to help the project pay for developer time, professional services, travel, workshops, and a variety of other needs.
Public API#
Our public API is documented in the API section of these docs.
We cannot guarantee the stability of our internal APIs, whether it’s the location of a function, its arguments, or something else.
In other words, we do not officially support (or encourage users to do) something like from scanpy.logging import debug as logging is not documented, even though it does not contain a leading underscore.
However, we are aware that many users do use these internal APIs and thus encourage them to open an issue or migrate to the public API.
That is, if something is missing from our public API as documented, for example a feature you wish to be exported publicly, please open an issue.
New to scanpy? Check out the installation guide.
The tutorials walk you through real-world applications of scanpy.
The API reference contains a detailed description of the scanpy API.
Need help? Reach out on our forum to get your questions answered!
Find a bug? Interested in improving scanpy? Checkout our GitHub for the latest developments.
Working with millions of cells and have a GPU available? rapids-singlecell mirrors the scanpy API with order-of-magnitude speedups on core preprocessing, neighbors, embedding, and clustering steps.
Other resources
Follow changes in the release notes.
Discover tools that build on or complement scanpy in the scverse ecosystem, and follow scverse-wide news at scverse.org/blog.
Check out our contribution guide for development practices.
Consider citing Genome Biology (2018) along with original references.