Skip to main content

Domain Invariant Representation through Adversarial Calibration (DIRAC), a graph neural network to integrate spatial multi-omic data into a unified domain

Project description

DIRAC (Domain Invariant Respresentation through Adversatial Calibration)

stars-badge pypi-badge docs-badge build-badge coverage-badge license-badge

Spatially resolved integration of multi-omics with DIRAC highlights cell-specific remodeling

DIRAC is a Python package, written in PyTorch and based on Scanpy.

DIRAC is a graph neural network to integrate spatial multi-omic data into a unified domain-invariant embedding space and to automate cell-type annotation by transferring labels from reference spatial or single-cell multi-omic data.

DIRAC primarily includes two integration paradigms: vertical integration and horizontal integration, which differ in their selection of anchors. In vertical integration, multiple data modalities from the same cells are jointly analyzed, using cell correspondences in single-cell data or spot correspondences in spatial data as anchors for alignment. In horizontal integration, the same data modality from distinct groups of cells is aligned using genomic features as anchors. The best way to familiarize yourself with DIRAC is to check out our tutorial, our notebook and our documentation.

Model architecture

For more details, please check out our publication.

Directory structure

.
├── sodirac                 # Main Python package
├── data                    # Data files
├── docs                    # Documentation files
├── environment.yaml        # Reproducible Python environment via conda
├── requirements.yaml       # Python packages required for issuing DIRAC
├── LICENSE
└── README.md

How to install DIRAC

To install DIRAC, make sure you have PyTorch and PyG installed. For more details on dependencies, refer to the environment.yml file.

Step 1: Set Up Conda Environment

conda create -n dirac-env python=3.9 r-base=4.3.1 rpy2 r-mclust r-yarrr

Step 2: Install PyTorch and PyG

Activate the environment and install PyTorch and PyG. Adjust the installation commands based on your CUDA version or choose the CPU version if necessary.

  • General Installation Command
conda activate dirac-env
pip install torch==2.1.0 torchvision==0.16.0 torchaudio==2.1.0 --index-url https://download.pytorch.org/whl/cu118
pip install pyg_lib==0.3.1+pt21cu118 torch_scatter torch_sparse torch_cluster torch_spline_conv -f https://data.pyg.org/whl/torch-2.1.0+cu118.html
pip install torch_geometric==2.3.1
  • Tips for selecting the correct CUDA version
    • Run the following command to verify CUDA version:
    nvcc --version
    
    • Alternatively, use:
    nvidia-smi
    
  • Modify installation commands based on CUDA
    • For CUDA 12.1
      pip install torch==2.1.0 torchvision==0.16.0 torchaudio==2.1.0 --index-url https://download.pytorch.org/whl/cu121
      pip install pyg_lib==0.3.1+pt21cu121 torch_scatter torch_sparse torch_cluster torch_spline_conv -f https://data.pyg.org/whl/torch-2.1.0+cu121.html
      pip install torch_geometric==2.3.1
      
    • For CPU-only
      pip install torch==2.1.0 torchvision==0.16.0 torchaudio==2.1.0 --index-url https://download.pytorch.org/whl/cpu
      pip install pyg_lib==0.3.1+pt21cpu torch_scatter torch_sparse torch_cluster torch_spline_conv -f https://data.pyg.org/whl/torch-2.1.0+cpu.html
      pip install torch_geometric==2.3.1
      

Step 3: Install dirac from shell

    pip install sodirac

Step 4: Import DIRAC in your jupyter notebooks or/and scripts

    import sodirac as sd

Installing within a conda environment is recommended.

Usage

Please checkout the documentations and tutorials at dirac.readthedocs.io.

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

sodirac-0.1.6.tar.gz (48.2 kB view details)

Uploaded Source

Built Distribution

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

sodirac-0.1.6-py3-none-any.whl (49.0 kB view details)

Uploaded Python 3

File details

Details for the file sodirac-0.1.6.tar.gz.

File metadata

  • Download URL: sodirac-0.1.6.tar.gz
  • Upload date:
  • Size: 48.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.12.9

File hashes

Hashes for sodirac-0.1.6.tar.gz
Algorithm Hash digest
SHA256 52d4e3f0935a1cd3760ea28a76a7c2859f641a939b282dbedabad5d2fe181d96
MD5 7904cd8a47d99d1a05f56c8d9c15d212
BLAKE2b-256 873ebc0d7167e0e80b233a8473d53731bdc8f536ada24f38eacb8e9362add3eb

See more details on using hashes here.

File details

Details for the file sodirac-0.1.6-py3-none-any.whl.

File metadata

  • Download URL: sodirac-0.1.6-py3-none-any.whl
  • Upload date:
  • Size: 49.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.12.9

File hashes

Hashes for sodirac-0.1.6-py3-none-any.whl
Algorithm Hash digest
SHA256 f455f2f0c8df863859bfaec2f8d7cd2237d14602db64839470a71161a04a7885
MD5 588a70437a068e9bc2c55e176ee78381
BLAKE2b-256 94e21834ffe5ef4c8c35c661fd9af383c3b0b28c1e6d5ccacfae55447f9851c4

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