Skip to main content

Installation

$ pip install bionmf

Usage

from bionmf import BioNMF       # Import model

model = BioNMF()
nmf = model.fit(                # NMFInfo object, see below for properties
    adata,                      # AnnData object
    rank_range = range(2, 3),
    n_runs = 3,
    cutoff = 0.95
)

adata = model.get_adata()       # Return AnnData object
                                # Stores cell-factors under .obsm['X_nmf']
                                # Stores gene-factors under .varm['factors']

genes = model.program_genes()   # Get differential expressed genes per program
model.plot_cophcorr("cc.html")  # Cophenetic correlation for each tested rank

Documentation

BioNMF(
    random_state,               # Initial random state
    **kwargs                    # Arguments for sklearn.decomposition.NMF
).fit(
    adata,                      # Accepts AnnData and DataFrame (must be cells as rows)
    rank_range,                 # Range of rank values to test
    n_runs,                     # Number of runs (random intializations) for each rank
    cutoff                      # Cophenetic correlation cutoff
)                               # -> returns NMFInfo object

NMFInfo(                        # Properties accessed as nmf.rank, nmf.W, etc.
    rank,                       # Chosen (best) rank
    W,                          # (genes by factors) matrix -> gene programs
    H,                          # (cells by factors) matrix -> program assignment
    connectivity_mat,           # (cells by cells) matrix -> program connectivity
    reconstruction_err,         # RMSE of reconstruction
    cophcorr                    # Cophenetic correlation
)

References

Brunet JP, Tamayo P, Golub TR, Mesirov JP. Metagenes and molecular pattern discovery using matrix factorization. Proc Natl Acad Sci U S A. 2004 Mar 23;101(12):4164-9. doi: 10.1073/pnas.0308531101. Epub 2004 Mar 11. PMID: 15016911; PMCID: PMC384712.

Metadata

Release files for bionmf 0.0.5

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for bionmf 0.0.5
File Size Uploaded Provenance
bionmf-0.0.5.tar.gz 20.5 kB Without provenance Details

Built distribution (wheel)

Table of built distributions (wheels) for bionmf 0.0.5
File Interpreter ABI Platform
bionmf-0.0.5-py3-none-any.whl Python 3 none any Details

Total release size: 40.3 kB

Release files / bionmf-0.0.5.tar.gz

Download URL bionmf-0.0.5.tar.gz
Size 20.5 kB
Tags Source
SHA-256 checksum
How to use checksums
db6411a989aee54b3d30eaf2cb1dc5615bca5e2124ff4443613d6e71e2b60bfe
BLAKE2b-256 checksum
How to use checksums
1ad69ba5fca5a071497ca9fc295b06996c04be5dd984d69f13bf058389efc0cd
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.12.0

Release files / bionmf-0.0.5-py3-none-any.whl

Download URL bionmf-0.0.5-py3-none-any.whl
Size 19.9 kB
Tags Python 3
SHA-256 checksum
How to use checksums
f0c482e825b6bc55b4590b81ddf2f33205da9679b66f8844546bc88cd887c02c
BLAKE2b-256 checksum
How to use checksums
15291cbe99b2e759f9406e7fafdfe67bec77d9e12a7495ebbde29b0e8dfa599b
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.12.0

Security for bionmf 0.0.5

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page