Skip to main content

Interpretable super-resolution dimension reduction of spatial transcriptomics data by DeepFuseNMF

Overview

alt

DeepFuseNMF is based on a multi-modal neural network that takes advantage of the high-dimensionality of transcriptomics data and the super-resolution of image data to achieve interpretable super-resolution dimension reduction. The high-dimensional expression data enable refined functional annotations and the super-resolution image data help to enhance the spatial resolution.

Based on the super-resolution embedding and the reconstruction of gene expressions, DeepFuseNMF can then perform super-resolution downstream analyses, such as spatial domain detection, gene expression recovery, and identification of embedding-associated genes as well as super-resolution cluster-associated genes.

Installation

Please install DeepFuseNMF from pypi with:

pip install DeepFuseNMF

Or clone this repository and use

pip install -e .

in the root of this repository.

Quick start

Prepare your data and run the following command:

python run_DeepFuseNMF.py --config config.json --device 0 --verbose

config.json is a JSON file that contains the paths to the input data and the output directory. The JSON file should look like this:

{
    "settings": {
        "root_path": "your_root_path",
        "project": "your_project_name"
    },
    "sections": [
        {
            "name": "name of section A",
            "image_path": "image path of section A",
            "spot_coord_path": "spot coordinate path of section A",
            "spot_exp_path": "spot expression path of section A"
        },
        {
            "name": "name of section B",
            "image_path": "image path of section B",
            "spot_coord_path": "spot coordinate path of section B",
            "spot_exp_path": "spot expression path of section B"
        }
    ],
    "paras": {
        "scale_factor": [scale_factor_A, scale_factor_B],
        "radius": [radius_A, radius_B],
        "reference": {"name of section B": "name of section A"}
    }
}

All parameters of run_DeepFuseNMF.py are optional. The following are the:

  • --config or -c: the path to the configuration file
  • --rank or -r: the rank / number of components of the NMF model, default is 20
  • --seed or -s: the random seed, default is 123
  • --device or -d: the device to run the model, e.g., 0, 1, 2, etc, default is 0
  • --visualize: whether to visualize the results, default is True
  • --save_score: whether to save the embedding, use --save_score to save all scores
  • --save_model: whether to save the model, use --save_model to save the model
  • --verbose: whether to print the log information, use --verbose to print the log information

Please refer to the Tutorial/ and configs/README.md for more details.

Release files for DeepFuseNMF 0.3.0

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

Source distribution (sdist)

Source distribution for DeepFuseNMF 0.3.0
File Size Uploaded
DeepFuseNMF-0.3.0.tar.gz 27.3 kB Details

Release files / DeepFuseNMF-0.3.0.tar.gz

Download URL DeepFuseNMF-0.3.0.tar.gz
Size 27.3 kB
Tags Source
SHA-256 checksum
How to use checksums
90cfdef230dab50aa657b79301c1e0f53e6265352a210c9f7843620499519772
BLAKE2b-256 checksum
How to use checksums
7a6e504ccd1605a4443c45fbfcfb597e27d7cf78296dac40cb98f4f5e7c30c90
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/5.1.1 CPython/3.11.7

Release history Release notifications | RSS feed

This release

0.3.0 This release

1 release file

0.2.0

1 release file

0.0.1

2 release files

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