Metadata-Version: 2.4
Name: cnv-sc-rs
Version: 0.1.0
Classifier: Programming Language :: Rust
Classifier: Programming Language :: Python :: Implementation :: CPython
Classifier: Topic :: Scientific/Engineering :: Bio-Informatics
Requires-Dist: numpy>=1.23
Requires-Dist: scipy>=1.10
Requires-Dist: polars>=1.0
Requires-Dist: beartype>=0.19
Requires-Dist: anndata>=0.10 ; extra == 'anndata'
Provides-Extra: anndata
Summary: Copy number inference from single cell expression, in Rust. A port of the expression path of numbat.
Author-email: Gregor Lueg <gregorlueg@me.com>
License: MIT
Requires-Python: >=3.10
Description-Content-Type: text/markdown; charset=UTF-8; variant=GFM
Project-URL: Documentation, https://gregorlueg.github.io/cnv-sc-rs/
Project-URL: Repository, https://github.com/GregorLueg/cnv-sc-rs

# cnv-sc-rs

Copy number inference from single cell expression, in Rust. A port of the
expression path of [numbat](https://github.com/kharchenkolab/numbat) and
hahmmr (both MIT): inferCNV-style smoothing, a Poisson-lognormal HMM on
pseudobulks, consensus segments and per-cell segment posteriors.

```bash
pip install cnv-sc-rs            # core
pip install "cnv-sc-rs[anndata]" # plus infer_cnv_adata
```

```python
import cnv_sc_rs as cnv

# X: cells x genes raw counts (scipy sparse), loci per gene, normal cells
res = cnv.infer_cnv(X, chrom, start, end, reference=is_normal)
res.segments  # polars DataFrame, one row per consensus segment
res.p_tumour  # per cell
```

With scanpy:

```python
cnv.infer_cnv_adata(
    adata, reference_key="cell_type", reference_cat=["T cell", "B cell"], layer="counts"
)
```

Docs: https://gregorlueg.github.io/cnv-sc-rs/

