mvinyard / ann_nmf

AnnData wrapper of the ARD-NMF module from SignatureAnalyzer
MIT License
1 stars 0 forks source link
anndata nmf single-cell

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()

nmf.plot_umap_signatures(adata)

image

ann_nmf.ut.fetch_signature(nmf.nmf_genes, 1)
gene-sig-table-example

Conceptual background and foundational work

Acknowledgements