Skip to main content

Spatial Transcriptomics Imputation Tool (SpaMean-Impute)

Project description

SpaMeanImpute

Spatial Transcriptomics Imputation Tool (SpaMean-Impute)

SpaMeanImpute is a Python package for imputing missing gene expression values in spatial transcriptomics datasets.
It leverages spatial neighborhood information to improve downstream clustering and analysis.


✨ Features

  • Spatially-aware imputation using k-nearest neighbors in spatial coordinates.
  • Highly variable gene selection with scanpy.
  • Evaluation pipeline for imputation and clustering performance.
  • Command-line interface (CLI) for easy integration into workflows.
  • Compatible with .h5ad AnnData files.

📦 Installation

You can install SpaMeanImpute from PyPI:

pip install SpaMeanImpute

Or install directly from the GitHub repository:

git clone https://github.com/FahimHafiz/SpaMean-Impute/tree/main/SpaMeanImpute
cd SpaMeanImpute
pip install -e .

🚀 Usage

After installation, you can run:

spamean-impute input_file.h5ad \
    -k 9 \
    --threshold 0.1 \
    --n_top 5000 \
    --output_file imputed_output.h5ad

Arguments:

input_file — Path to input .h5ad file.

-k — Number of spatial neighbors (default: 9).

--threshold — Drop threshold for zero imputation (default: 0.1).

--n_top — Number of highly variable genes (default: 5000, use 'all' to skip filtering).

--output_file — Path to save the imputed .h5ad file.

🐍 Python API

import spa_mean_impute
from spa_mean_impute.imputer import SpaMeanImpute

imputer = SpaMeanImpute(k=9, threshold=0.1, n_top=5000)
results = imputer.run("input_file.h5ad", output_file="imputed_output.h5ad")

print("Results:", results)

📁 Project Structure

spa_mean_impute/ init.py imputer.py cli.py utils.py tests/ test_imputer.py setup.py pyproject.toml README.md LICENSE.txt

✅ Running Tests

python -m unittest discover tests

📄 License

This project is licensed under the MIT License — see the LICENSE.txt file for details. For any problem, feel free to contact fahimhafiz@cse.uiu.ac.bd or create an issue!

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

spameanimpute-0.1.0.tar.gz (7.5 kB view details)

Uploaded Source

Built Distribution

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

spameanimpute-0.1.0-py3-none-any.whl (7.9 kB view details)

Uploaded Python 3

File details

Details for the file spameanimpute-0.1.0.tar.gz.

File metadata

  • Download URL: spameanimpute-0.1.0.tar.gz
  • Upload date:
  • Size: 7.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.10.16

File hashes

Hashes for spameanimpute-0.1.0.tar.gz
Algorithm Hash digest
SHA256 9016d2456877fc3229392d5c87335aaef633e70f8c85d948cfae891a3c23677b
MD5 b9c63a0331ea6ff3b21f0b76b9ae5885
BLAKE2b-256 58e90ec56f9bd44d350978a0c42be0bf968366aa0564e73e63a5235c2b9aabc4

See more details on using hashes here.

File details

Details for the file spameanimpute-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: spameanimpute-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 7.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.10.16

File hashes

Hashes for spameanimpute-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 1f6a627e32fc0be6ce9977330b2b74d0c491829d82ade884b3a278626f6bdc88
MD5 09bd29c978d3abc12fe567566d3ab5db
BLAKE2b-256 545563d83f658af2cce5a436e8ba552fad49cb7a9f66370442d799338831d4ea

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