Metadata-Version: 2.1
Name: morpheus-spatial
Version: 1.0.3
Summary: 
Author: neonine2
Author-email: jerry.wang95@yahoo.ca
Requires-Python: >=3.9,<3.12
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.9
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Provides-Extra: audio
Requires-Dist: Jinja2 (>=3.1.4)
Requires-Dist: aiohttp (>=3.9.4)
Requires-Dist: certifi (>=2024.7.4)
Requires-Dist: dill (>=0.3.8,<0.4.0)
Requires-Dist: h5py (>=3.10.0,<4.0.0)
Requires-Dist: idna (>=3.7)
Requires-Dist: lightning (>=2.0.0,<3.0.0)
Requires-Dist: numpy (<=1.26)
Requires-Dist: pandas (>=2.2.1,<3.0.0)
Requires-Dist: pillow (>=10.3.0)
Requires-Dist: ray (>=2.11.0,<3.0.0)
Requires-Dist: scikit-learn (>=1.5.0)
Requires-Dist: torch (==2.0.0)
Requires-Dist: torchvision (>=0.15.1,<0.16.0)
Description-Content-Type: text/markdown

<img src="assets/morpheus-high-resolution-logo-transparent.png" alt="Morpheus logo" width="800" height="auto">

Morpheus is an integrated deep learning framework that takes large scale spatial omics profiles of patient tumors, and combines a formulation of T-cell infiltration prediction as a self-supervised machine learning problem with a counterfactual optimization strategy to generate minimal tumor perturbations predicted to boost T-cell infiltration.

<img src="assets/summary_fig.png" alt="Graphical summary of the Morpheus framework" width="800" height="auto">

Update: We are currently working on tutorial notebooks for running optimization on Slurm with fan-out across multiple CPU nodes, stay tuned!

## Getting Started

### Prerequisites

- Python >=3.9, <3.12
- PyTorch Lightning 2.2.0 or higher
- CUDA 11.7 or higher (for GPU acceleration)
- Other dependencies listed in `requirements.txt`

Note numpy 2.0 or above not currently supported

### Installation

#### Option 1: Using pip (PyPI)

Run the following in the command line

```bash
pip install morpheus-spatial
```

#### Option 2: From Source

To install Morpheus from source, clone the repository and install the dependencies:

```bash
git clone https://github.com/neonine2/morpheus-spatial.git
cd morpheus-spatial
pip install -r requirements.txt
pip install .
```

### Tutorial

See `tutorial_notebook.ipynb` for a complete, self-contained workflow on using Morpheus to generate therapeutic strategies.

### Known Issues

#### OpenMP Conflicts on macOS

Some users may encounter warnings about conflicting OpenMP libraries. If you see a warning about Intel OpenMP and LLVM OpenMP being loaded at the same time, please see [https://github.com/joblib/threadpoolctl/blob/master/multiple_openmp.md](https://github.com/joblib/threadpoolctl/blob/master/multiple_openmp.md) for more information and possible workarounds.

### Repository Structure

- **`assets/`**: Contains images and other assets used in the documentation and the project.
- **`examples/`**: Example scripts and notebooks demonstrating various use cases of the Morpheus framework.
  - **`tutorial.ipynb`**: A notebook demonstrating how to reproduce the primary analyses of the paper.
- **`reproduction/`**: Includes Jupyter notebooks and scripts for reproducing the main analyses presented in the associated research paper.
  - **`reproduction_notebook.ipynb`**: A notebook demonstrating how to reproduce the primary analyses of the paper.
- **`src/`**: The main package directory containing all core modules and functions.
- **`tests/`**: Contains unit tests for the different modules of the package.
- **`requirements.txt`**: A file listing all Python dependencies required to run the project.

