Metadata-Version: 2.4
Name: SpacePath
Version: 0.1.0
Summary: Pathway and molecular family analysis for MSI-based spatial metabolomics and lipidomics
License-Expression: MIT
License-File: LICENSE
Author: johaGL
Author-email: johanna.galvis@u-bordeaux.fr
Requires-Python: >=3.10,<3.13
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Requires-Dist: anndata (>=0.11.4,<1.0)
Requires-Dist: click (>=8.2.1,<9.0)
Requires-Dist: coverage (>=7.9.1,<8.0)
Requires-Dist: fastcluster (>=1.3.0,<2.0)
Requires-Dist: matplotlib (>=3.10.3,<4.0)
Requires-Dist: matplotlib-venn
Requires-Dist: metaspace-converter (>=1.1.1,<2.0)
Requires-Dist: networkx (>=3.4.2,<4.0)
Requires-Dist: numpy (>=2.2.6,<3.0)
Requires-Dist: openpyxl (>=3.1.5,<4.0)
Requires-Dist: pandas (>=2.3.0,<3.0)
Requires-Dist: pydantic (>=2.9.2,<3.0)
Requires-Dist: pyimzml (>=1.5.1,<2.0)
Requires-Dist: pytest (>=8.4.1,<9.0)
Requires-Dist: pytest-cov (>=6.2.1,<7.0)
Requires-Dist: python-dotenv (>=0.5.1,<1.0)
Requires-Dist: python-igraph (>=0.11.9,<1.0)
Requires-Dist: pyyaml (>=6.0.2,<7.0)
Requires-Dist: rdkit (>=2025.3.3,<2026.0)
Requires-Dist: scanpy (>=1.11.2,<2.0)
Requires-Dist: scikit-learn (>=1.7.0,<2.0)
Requires-Dist: scipy (>=1.15.2,<2.0)
Requires-Dist: seaborn (>=0.13.2,<1.0)
Requires-Dist: setuptools (>=56.0.0,<56.1.0)
Requires-Dist: squidpy (>=1.6.3,<2.0)
Requires-Dist: tqdm (>=4.67.1,<5.0)
Description-Content-Type: text/markdown

[![License: MIT](https://img.shields.io/badge/License-MIT-green.svg)](https://opensource.org/licenses/MIT)  [![Poetry](https://img.shields.io/endpoint?url=https://python-poetry.org/badge/v0.json)](https://python-poetry.org/)   ![GitHub Release](https://img.shields.io/github/v/release/cbib/SpacePath)     [![DOI](https://zenodo.org/badge/DOI/10.5281/zenodo.23390206.svg)](https://doi.org/10.5281/zenodo.23390206)

 

SpacePath
===
A framework for pathways and molecular sets exploration of annotated Spatial Metabolomics and Lipidomics data


# Introduction

SpacePath is a novel bioinformatics framework designed to analyze spatial metabolomics and lipidomics in the context of metabolic pathways. It addresses challenges like compound identification ambiguities and incomplete pathway databases, enabling the mapping of metabolic processes onto tissue architecture.

SpacePath's approach integrates pathway activity scores at the spatial resolution level, and investigates unmapped features with a strategy that exploits the molecular similarity between chemical entities. It overcomes limitations of existing tools that lack spatial resolution capabilities, providing a generalizable solution for tissue-specific metabolic mapping, and facilitating the interpretation of complex mass spectrometry imaging data. When applied to cancer tissues, SpacePath can enhance the understanding of tumor metabolism.


<img width="900" height="500" alt="diagram-temporary-spacepath" src="https://github.com/user-attachments/assets/f1bab3aa-e198-457c-9c91-25e95cd2220a" />


Notably, SpacePath was applied on a collection of different types of healthy and tumoral tissues, including glioblastoma. By integrating complex spatially resolved lipidomics data and functional sets expressed as pathways or families, the method provided valuable insights about the glioblastoma's metabolic organization, prompting a potential impact on biomarker discovery.

_Note_: Our method also supports, as input data, the datasets consisting of aligned and recalibrated spectra intensities alongside their annotations, that are obtained from the [METASPACE](https://metaspace2020.org/) output. 


# Installing SpacePath 

## System Requirements
Running SpacePath requires an Unix environment with [python 3.10](http://www.python.org/). 
It was tested under Linux and MacOS environments.

 A virtual environment with poetry 2.3.3 is required
(see 'Explanation for creating a virtual environment').

<details><!--commentvirtualenv-->

 <summary>Explanation for creating a virtual environment
 <sub><sup>(click to show/hide)</sup></sub>
 </summary>

All the install process must occur in a virtual environment with poetry installed.
* with venv in python:
```
python3 -m venv spacepath
source spacepath/bin/activate  # activate
pip install poetry==2.3.3
```
* alternatiely, with conda, miniconda, micromamba or mamba (command examples below use micromamba):
  
```
micromamba create -n spacepath python=3.10.18 -c conda-forge poetry==2.3.3
```
* or use the provided .yaml file that is located at <code>tools/spacepath_env.yaml</code> :
```
micromamba create -f spacepath_env.yaml  
```

</details>


## Installation 

The full installation process should take less than 15 minutes on a standard computer (dependencies included). Two options are possible.

#### Option 1: Using a local clone and poetry

First clone `SpacePath` in your workspace (`git clone git@github.com:cbib/SpacePath.git`), then, follow the steps specified in the snippet below:
```
micromamba activate spacepath   # 1. activate your environment
cd SpacePath   # 2. locate into the cloned SpacePath
poetry install  # 3. install SpacePath
pip install sspa==1.0.4  # 4. intall sspa
```


#### Option 2: Install via `pip`

Follow the three steps specified in the snippet below:
```
micromamba activate spacepath   # activate your environment
pip install SpacePath         
pip install sspa==1.0.4
```

 
## After the install process

For subsequent use, just activate the environment (e.g. `micromamba activate spacepath`) as it has all the requirements already installed for running SpacePath.

# Using SpacePath

The generic command line to run the pipeline is:
```
SpacePath $input_file $data_folder $figures_folder
```

# Documentation

Documentation, examples of how to use `SpacePath`, and the specifics of the datasets used in the analyses 
are provided in the [Wiki](https://github.com/cbib/SpacePath/wiki) page.   

-------------

# For Developers

### Code organization of the `core` folder of SpacePath

The `core` folder contains the core classes for data and methods that are required for running SpacePath. It is organized into:

* `processing` directory contains the implemented high-level functions for the processed dedicated to the measurements and/or the pathways inputs
* `visualization` directory contains the implemented high-level scripts to produce figures
* `data` directory contains the python classes for data initialization alongside the methods proper to each data class
* `method` directory contains the python classes of the configurations and methods that are applied on diverse types of input objects, by invoking 'core/processing' functions
* `anndata_aux` directory contains the auxiliary functions for dataset download and formatting into an 'anndata' object


### Running unit tests 

Place yourself in `SpacePath/tests` and execute **`pytest`** or,  alternatively, `python -m unittest`. 


-------------
  
# Getting help

For any information or help, you can get in touch with: 

* [Johanna Galvis](mailto:deisy-johanna.galvis-rodriguez[AT]u-bordeaux.fr)


-------------

# LICENSE MIT

    Copyright (c) 2025
    
    Johanna Galvis (1,2)    deisy-johanna.galvis-rodriguez@u-bordeaux.fr

    Macha Nikolski (1,2)    macha.nikolski@u-bordeaux.fr
    
    (1) CNRS, IBGC - University of Bordeaux,
    1, rue Camille Saint-Saens, Bordeaux, France

    (2) CBiB - University of Bordeaux,
    146, rue Leo Saignat, Bordeaux, France

    
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.



