ann-nmf

ann_nmf - AnnData wrapper of the ARD-NMF module from SignatureAnalyzer


Keywords
anndata, nmf, single-cell
License
MIT
Install
pip install ann-nmf==0.0.1

Documentation

ann_nmf.logo

PyPI pyversions PyPI version Code style: black

AnnData wrapper of the ARD-NMF module from SignatureAnalyzer-GPU.

Installation

Install using pip

pip install ann_nmf

Alternatively, install the development version:

git clone https://github.com/mvinyard/ann_nmf.git; cd ann_nmf;
pip install -e .

API overview

Import libraries and get some data

import ann_nmf
import scanpy as sc

adata = sc.datasets.pbmc3k()
ann_nmf.ut.preprocess_raw_counts(adata)

Key class:

nmf = ann_nmf.NMF(adata, outdir="nmf_results/pbmc3k") # saves .h5 file
nmf.run(n_runs=10, K0=20, max_iter=2000)

SignatureAnalyzer visualization:

nmf.cluster()
nmf.signatures()

Conceptual background and foundational work

Acknowledgements

  • Most of the code to wrap SignatureAnalyzer in an AnnData-friendly API was borrowed directly (and shamelessly) from Shankara Anand (@shankara-a) with only slight refactoring for more flexibility with fewer dependencies on install.