infercnvpy is a Python library to infer copy number variation (CNV) from single-cell and spatial transcriptomics
data.
tl.infercnv averages the expression of neighboring genes along the genome and compares it with
normal reference cells, or with the mean of all cells if no reference is given.
The result is an expression signal that follows copy number, not a measurement of DNA.
tl.infercnv follows the method of R inferCNV with a few changes, which the method page lists.
It can process datasets larger than memory in blocks of cells.
infercnvpy works on the AnnData objects of the scverse ecosystem.
tl.copy_number is a separate count model for raw UMI counts.
It estimates the copy number profiles of clones (groups of cells with the same profile), and it labels each cell as
likely aneuploid (tumor) or diploid (normal).
The results of tl.infercnv look similar, but not identical, to those of R inferCNV.
With small gene panels, as in imaging-based spatial data, only large changes can be detected.
tl.detectability estimates which changes a given panel can detect.
We are happy about feedback and contributions.
Please refer to the documentation. In particular, the
You need Python 3.13 or newer. There are several options to install infercnvpy:
- Install the latest release of
infercnvpyfrom PyPI:
pip install infercnvpy- Install the latest development version:
pip install git+https://github.com/scverse/infercnvpy.git@mainSee the release notes on GitHub.
For questions and help requests, you can reach out in the scverse discourse. If you found a bug, please use the issue tracker.
See the citation page of the documentation.
