Skip to main content

NMF solver for gene programs.

Project description

Installation

$ pip install bionmf

Usage

from bionmf import BioNMF       # Import model

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

genes = model.program_genes()   # Get differential expressed genes per program

model.plot_cophcorr()           # Cophenetic correlation for each tested rank
model.plot_heatmap()            # Heaetmap of gene programs

Documentation

BioNMF(
    random_state,               # Initial random state
    **kwargs                    # Rest of arguments are passed to 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(
    rank,                       # 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
)

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

bionmf-0.0.3.tar.gz (19.0 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

bionmf-0.0.3-py3-none-any.whl (19.1 kB view details)

Uploaded Python 3

File details

Details for the file bionmf-0.0.3.tar.gz.

File metadata

  • Download URL: bionmf-0.0.3.tar.gz
  • Upload date:
  • Size: 19.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.0

File hashes

Hashes for bionmf-0.0.3.tar.gz
Algorithm Hash digest
SHA256 75b6ed6957d9b3c2b32209bc9376aca4d316703166f5ccf182bb475955afb193
MD5 265cf2f4cfbaef39cf74bbf822b6f15d
BLAKE2b-256 d1e1fac2ea37e069cff41fa806990851a76e777c9a96ea648266da5abc178e25

See more details on using hashes here.

File details

Details for the file bionmf-0.0.3-py3-none-any.whl.

File metadata

  • Download URL: bionmf-0.0.3-py3-none-any.whl
  • Upload date:
  • Size: 19.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.0

File hashes

Hashes for bionmf-0.0.3-py3-none-any.whl
Algorithm Hash digest
SHA256 9f902864e0587fe36edb177dbdf7df0a2de0886bfa7d854ce4b022dbc6d0e214
MD5 6b8994beb68f54c638b02c60e745d9b3
BLAKE2b-256 65608db9d2b293cea1f7dffdbade05048c49b449d613539c9a9dbfc596629533

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page