Skip to main content

CellNiche represents cellular microenvironments in atlas-scale spatial omics data with contrastive learning

Project description

CellNiche

Overview

CellNiche is a scalable, cell-centric framework for identifying and characterizing cellular micro-environments from atlas-scale, heterogeneous spatial omics data.
Instead of processing entire tissue slices, CellNiche samples local subgraphs around each cell and learns context-aware embeddings via contrastive learning, while explicitly decoupling molecular identity (gene expression or cell-type labels) from spatial proximity modeling.

Key Features

Installation

From Source

git clone https://github.com/Super-LzzZ/CellNiche.git
cd cellniche

From PyPI

pip install CellNiche

Requirements

  • Python ≥ 3.7
  • PyTorch ≥ 1.12
  • PyTorch Geometric (torch-geometric, torch-scatter, torch-sparse, torch-cluster, torch-spline-conv)
  • Scanpy ≥ 1.9
  • Anndata ≥ 0.9
  • scikit-learn ≥ 1.3
  • numpy ≥ 1.22
  • scipy ≥ 1.10
  • pandas ≥ 2.0
  • networkx ≥ 3.1
  • tqdm ≥ 4.67.1

You can install most dependencies with:

pip install torch torchvision torchaudio
pip install torch-geometric torch-scatter torch-sparse torch-cluster torch-spline-conv
pip install scanpy anndata scikit-learn numpy scipy pandas networkx tqdm

A successful example

conda create -n cellniche python=3.9
conda activate cellniche
pip install torch==2.0.1 torchvision==0.15.2 torchaudio==2.0.2
pip install torch_cluster-1.6.3+pt20cu117-cp39-cp39-linux_x86_64.whl
pip install torch_scatter-2.1.2+pt20cu117-cp39-cp39-linux_x86_64.whl
pip install torch_sparse-0.6.18+pt20cu117-cp39-cp39-linux_x86_64.whl
pip install torch_spline_conv-1.2.2+pt20cu117-cp39-cp39-linux_x86_64.whl
pip install torch-geometric==2.6.1
pip install CellNiche

pip install pyyaml
...

Tutorials

Coming soon

Getting Started

bash(recommend)

python ./cellniche/main.py --config ./configs/xxx.yaml

python

import cellniche

# Parse arguments from a YAML config
# Run training/inference
cellniche.main(["--config", "./configs/xxx.yaml"])

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

cellniche-0.1.4.tar.gz (15.6 kB view details)

Uploaded Source

Built Distribution

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

cellniche-0.1.4-py3-none-any.whl (17.5 kB view details)

Uploaded Python 3

File details

Details for the file cellniche-0.1.4.tar.gz.

File metadata

  • Download URL: cellniche-0.1.4.tar.gz
  • Upload date:
  • Size: 15.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.9.20

File hashes

Hashes for cellniche-0.1.4.tar.gz
Algorithm Hash digest
SHA256 5cc486dc3211fe8b565e91c25cdc77166414aabf85a22ba054946ae9574887fb
MD5 83cd984cb768d98781032cbfccef3faf
BLAKE2b-256 3fbedc883eab2cf409ff313a9c4ca124fdef03729ce8251974a3d49f76ba9562

See more details on using hashes here.

File details

Details for the file cellniche-0.1.4-py3-none-any.whl.

File metadata

  • Download URL: cellniche-0.1.4-py3-none-any.whl
  • Upload date:
  • Size: 17.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.9.20

File hashes

Hashes for cellniche-0.1.4-py3-none-any.whl
Algorithm Hash digest
SHA256 9c27e81f42ab87000a7d3e3002e2bc7e81d38916646bb026191ef64c755b478f
MD5 a6ac31342c9618c01cf47240c5d37e9c
BLAKE2b-256 54ae08287b83660fc26c8006c43c0f3ef4beda39dbe28445e65e23f9457b70bc

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