Skip to main content

A tool to generate coembeddings from IF image embeddings and PPI network embeddings

Project description

Cell Maps CoEmbedder

The Cell Maps CoEmbedding is part of the Cell Mapping Toolkit

https://img.shields.io/pypi/v/cellmaps_coembedding.svg https://app.travis-ci.com/idekerlab/cellmaps_coembedding.svg?branch=main Documentation Status Zenodo DOI badge

Creates Coembedding from Cell Maps ImmunoFluorscent Image Embedder and Cell Maps PPI Embedder using an implementation of MUSE

Dependencies

Compatibility

  • Python 3.8 - 3.11

Installation

git clone https://github.com/idekerlab/cellmaps_coembedding
cd cellmaps_coembedding
pip install -r requirements_dev.txt
make dist
pip install dist/cellmaps_coembedding*whl

Run make command with no arguments to see other build/deploy options including creation of Docker image

make

Output:

clean                remove all build, test, coverage and Python artifacts
clean-build          remove build artifacts
clean-pyc            remove Python file artifacts
clean-test           remove test and coverage artifacts
lint                 check style with flake8
test                 run tests quickly with the default Python
test-all             run tests on every Python version with tox
coverage             check code coverage quickly with the default Python
docs                 generate Sphinx HTML documentation, including API docs
servedocs            compile the docs watching for changes
testrelease          package and upload a TEST release
release              package and upload a release
dist                 builds source and wheel package
install              install the package to the active Python's site-packages
dockerbuild          build docker image and store in local repository
dockerpush           push image to dockerhub

Before running tests, please install pip install -r requirements_dev.txt.

For developers

To deploy development versions of this package

Below are steps to make changes to this code base, deploy, and then run against those changes.

  1. Make changes

    Modify code in this repo as desired

  2. Build and deploy

# From base directory of this repo cellmaps_coembedding
pip uninstall cellmaps_coembedding -y ; make clean dist; pip install dist/cellmaps_coembedding*whl

Needed files

The output directories for the image embeddings (see Cell Maps Image Embedding) and protein-protein interaction network embeddings (see Cell Maps PPI Embedding) are required.

Usage

For information invoke cellmaps_coembeddingcmd.py -h

Example usage

cellmaps_coembeddingcmd.py ./cellmaps_coembedding_outdir --embeddings ./cellmaps_image_embedding_outdir ./cellmaps_ppi_embedding_outdir

Via Docker

Example usage

Coming soon...

Cite

If you find this tool useful, please cite:

Lenkiewicz, J., Churas, C., Hu, M., Qian, G., Jain, M., Levinson, M. A., … & Schaffer, L. V. (2025). Cell Mapping Toolkit: An end-to-end pipeline for mapping subcellular organization. Bioinformatics, 41(6), btaf205.

Credits

This package was created with Cookiecutter and the audreyr/cookiecutter-pypackage project template.

History

1.6.0 (2026-07-08)

  • Added the ProMERGE co-embedding algorithm, accessible via --algorithm promerge. ProMERGE co-embeds a query context against a base (anchor) context, disentangling shared from context-specific signal using either a learned mutual-information estimator (MINE) or direct subtraction. Adds the cellmaps_coembedding.promerge package and ProMERGECoEmbeddingGenerator, along with --lambda_disentangle, --lambda_l2_disentangle, and --lambda_var flags.

  • Bug fix: corrected a syntax error (== in place of =) in the ProMERGECoEmbeddingGenerator constructor that prevented runner from importing.

  • Bug fix: added promerge to the --algorithm choices so the algorithm is reachable from the command line.

  • Added a test suite for ProMERGE covering generator and CLI wiring, the CoEmbed model forward pass, save_results, and end-to-end training smoke tests.

1.5.0 (2025-10-23)

  • Deprecated cellmaps_coembedding.protein_gps module in favor of cellmaps_coembedding.proteinprojector. Updated documentation accordingly.

1.4.0 (2025-09-10)

  • Expose k parameter as flag

1.3.1 (2025-07-03)

  • Fix for UD-3116, missing header 0 row

1.3.0 (2025-05-29)

  • Create flags for parameters of proteingps coembedding algorithm

1.2.2 (2025-05-15)

  • Updated to PEP 517 compliant build system

  • Bug fixes: update constants, add back L2 normalization and fix separator issue for proteinGPS

1.2.1 (2025-04-14)

  • Fix scipy package version

1.2.0 (2025-03-19)

  • Added functionality to generate umap of embeddings (in cellmaps_coembedding.utils)

1.1.0 (2025-03-05)

  • Added functionality to evaluate embeddings using statistical analysis and visualization (functions get_embedding_eval_data and generate_embedding_evaluation_figures in cellmaps_coembedding.utils).

  • Update defauls (EPOCHS and DROPOUT)

1.0.0 (2025-01-28)

  • Rename auto coembedding name and proteinGPS. –algorithm auto option is depreacted and –algorithm proteingps should be used. The coembedding implementation was moved to ProteinGPSCoEmbeddingGenerator class and AutoCoEmbeddingGenerator is deprecated and calls proteingps. The package name was renamed from autoembed_sc to proteingps.

  • Removed l2 normalization

  • Constants updated in ProteinGPSCoEmbeddingGenerator (triplet_margin=0.2) and in proteingps’s fit_predict (triplet_margin=0.2, lambda_reconstruction=5.0, lambda_triplet=5.0)

  • Bug fix: add missing a .to(device) call to ensure tensors are correctly moved to the appropriate device.

  • Update version bounds of required packages

0.4.0 (2024-12-02)

  • Added README generation.

  • Refactor code.

  • Update defaults (EPOCHS)

0.3.1 (2024-09-13)

  • Bug fix: raise more informative error when no embeddings overlap.

0.3.0 (2024-09-06)

  • Added --provenance flag to pass a path to json file with provenance information. This removes the necessity of input directory to be an RO-Crate.

0.2.0 (2024-07-17)

  • Added a new coembedding algorithm accessible via flag --algorithm auto. This algorithm utilizes neural networks to generate latent embeddings, optimizing both reconstruction and triplet losses to improve embedding accuracy by learning intra- and inter-modality relationships.

0.1.0 (2024-02-12)

  • First release on PyPI.

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

cellmaps_coembedding-1.6.0.tar.gz (242.1 kB view details)

Uploaded Source

Built Distribution

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

cellmaps_coembedding-1.6.0-py2.py3-none-any.whl (257.4 kB view details)

Uploaded Python 2Python 3

File details

Details for the file cellmaps_coembedding-1.6.0.tar.gz.

File metadata

  • Download URL: cellmaps_coembedding-1.6.0.tar.gz
  • Upload date:
  • Size: 242.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.11.7

File hashes

Hashes for cellmaps_coembedding-1.6.0.tar.gz
Algorithm Hash digest
SHA256 fc9a5bf5f6d560a1962915a87911250eb69f46b059ab17b0c2f9ad4a41a9eb0b
MD5 849e9071b98ab8c52fb598bc7d5356d0
BLAKE2b-256 73c799b3fb2aa9ee332d2cba3d13c666cb6fceb28bafc350eb8ed34f9c939ba0

See more details on using hashes here.

File details

Details for the file cellmaps_coembedding-1.6.0-py2.py3-none-any.whl.

File metadata

File hashes

Hashes for cellmaps_coembedding-1.6.0-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 357d91cb3486aee7bcb3aee80ae0c3eb4fdeb8a622be950a70406b76df8c6b5c
MD5 5ec0bf22710323960a466832e6ec08bd
BLAKE2b-256 8f78364733db290faea2fd5d529a96299bdb545153f2c15eef04c36a462a6a9e

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