Skip to content

Commit a063500

Browse files
authored
Merge pull request #11 from ElementoLab/uv-migration
Uv migration and explicit LICENSE
2 parents 545f719 + 8f48007 commit a063500

12 files changed

Lines changed: 4899 additions & 612 deletions

File tree

.github/workflows/python-app.yml

Lines changed: 20 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -1,53 +1,33 @@
1-
# This workflow will install Python dependencies, run tests and lint with a single version of Python
2-
# For more information see: https://help.github.com/actions/language-and-framework-guides/using-python-with-github-actions
3-
41
name: Python application UTAG test automation
5-
62
on:
73
push:
8-
branches: [ main, dev ]
4+
branches: [main, dev]
95
pull_request:
10-
branches: [ main, dev ]
11-
6+
branches: [main, dev]
127
permissions:
138
contents: read
14-
159
jobs:
1610
build:
17-
name: every OS
11+
name: Test on ${{ matrix.os }} / py${{ matrix.python-version }}
1812
strategy:
1913
matrix:
20-
# run 2 copies of the current job in parallel
21-
# and they will load balance all specs
22-
os: ['ubuntu-latest','macos-latest'] #, 'windows-latest']
23-
python-version: [3.9.19, 3.10.11]
14+
os: ['ubuntu-latest', 'macos-latest']
15+
python-version: ['3.12', '3.13']
2416
fail-fast: false
25-
2617
runs-on: ${{ matrix.os }}
27-
2818
steps:
29-
# Checkout the latest code from the repo
30-
- uses: actions/checkout@v3
31-
- name: Set up Python ${{ matrix.python-version }}
32-
uses: actions/setup-python@v3
33-
with:
34-
python-version: ${{ matrix.python-version }}
35-
# Display the Python version being used
36-
- name: Display Python version
37-
run: python -c "import sys; print(sys.version)"
38-
# Install the package using the setup.py
39-
- name: Install dependencies
40-
run: |
41-
python -m pip install --upgrade pip
42-
pip install flake8 pytest
43-
if [ -f requirements.txt ]; then pip install -r requirements.txt; fi
44-
pip install .
45-
- name: Lint with flake8
46-
run: |
47-
# stop the build if there are Python syntax errors or undefined names
48-
flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics
49-
# exit-zero treats all errors as warnings. The GitHub editor is 127 chars wide
50-
flake8 . --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics
51-
- name: Test with pytest
52-
run: |
53-
pytest utag/tests/utag_test.py
19+
- uses: actions/checkout@v4
20+
21+
- name: Install uv
22+
uses: astral-sh/setup-uv@v4
23+
with:
24+
enable-cache: true
25+
26+
- name: Set up Python ${{ matrix.python-version }}
27+
run: uv python install ${{ matrix.python-version }}
28+
29+
- name: Install dependencies
30+
run: uv sync --group test
31+
32+
- name: Test with pytest
33+
run: uv run pytest utag/tests/utag_test.py

LICENSE

Lines changed: 674 additions & 0 deletions
Large diffs are not rendered by default.

Makefile

Lines changed: 0 additions & 50 deletions
This file was deleted.

README.md

Lines changed: 34 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,8 @@
11
# Unsupervised discovery of tissue architechture with graphs (UTAG)
2-
[![Zenodo badge](https://zenodo.org/badge/doi/10.1038/s41592-022-01657-2.svg)](https://doi.org/10.1038/s41592-022-01657-2) ⬅️ read the published article here <br>
3-
[![Biorxiv badge](https://zenodo.org/badge/doi/10.1101/2022.03.15.484534.svg)](https://doi.org/10.1101/2022.03.15.484534) ⬅️ read the preprint here <br>
4-
[![Zenodo badge](https://zenodo.org/badge/doi/10.5281/zenodo.6376767.svg)](https://doi.org/10.5281/zenodo.6376767) ⬅️ Preprocessed Multiplexed Image Data and UTAG results <br>
5-
6-
2+
[![Nature Badge](https://img.shields.io/static/v1?label=DOI&message=10.1038/s41592-022-01657-2&color=blue)](https://doi.org/10.1038/s41592-022-01657-2) ⬅️ read the published article here <br>
3+
[![Biorxiv Badge](https://img.shields.io/static/v1?label=DOI&message=10.1101/2022.03.15.484534&color=red)](https://doi.org/10.1101/2022.03.15.484534) ⬅️ read the preprint here <br>
4+
[![Zenodo Badge](https://img.shields.io/static/v1?label=DOI&message=10.5281/zenodo.6376767&color=527ea9)](https://doi.org/10.5281/zenodo.6376767) ⬅️ Preprocessed Multiplexed Image Data and UTAG results <br>
5+
76
This package implements segmentation of multiplexed imaging data into microanatomical domains.
87
Multiplexed imaging data types are typically imaging mass cytometry (IMC), co-detection by indexing (CODEX), multiplexed ion beam imaging by time of flight (MIBI-TOF), cyclic immunofluorescence (CyCIF), and others.
98
The package also provides functions for the downstream analysis of the detected micro-anatomical structure.
@@ -13,33 +12,23 @@ The package also provides functions for the downstream analysis of the detected
1312

1413
### Install from github
1514

15+
With pip:
1616
```bash
1717
pip install git+https://github.com/ElementoLab/utag.git@main
1818
```
19+
With [`uv`](https://docs.astral.sh/uv/):
20+
```bash
21+
uv add git+https://github.com/ElementoLab/utag
22+
```
23+
1924
Installation should take less than 10 seconds.
2025

2126
#### Requirements
2227
There are no specific hardware requirements.
2328

2429
Software requirements:
2530
- UTAG has been tested on Mac OS, Linux, and Windows [WSL](https://docs.microsoft.com/en-us/windows/wsl/about) (Windows Subsystem for Linux).
26-
- Python 3.9+ (tested on 3.9.19)
27-
- Python packages (automatically installed by `pip`):
28-
- numpy
29-
- pandas
30-
- anndata
31-
- scanpy
32-
- parc
33-
- squidpy
34-
- scipy
35-
- matplotlib
36-
- tqdm
37-
- networkx
38-
- parmap
39-
- scikit-learn
40-
- setuptools_scm (may require manual installation for MacOS through pip)
41-
42-
Specific versions of Python packages have been pinned to the [setup.cfg](setup.cfg) file.
31+
- Python 3.12+ (tested on 3.12)
4332

4433
## Tutorial
4534
Check out new [tutorial](documentation/UTAG%20Tutorial.ipynb) for how to run and visualize results with UTAG on your own data with minimal required input (numeric cell feature matrix and xy coordinates).
@@ -137,7 +126,7 @@ For more detailed usage of the package and downstream analysis, please refer to
137126

138127
## Running UTAG on R
139128

140-
To make UTAG available to R users, we port the python code to using the `reticulate` package. The code was tested under after installing `UTAG` natively for python 3.8.10 and under conda environment with python 3.10.4, on Ubuntu 20.04.3 LTS and R 4.2.0.
129+
To make UTAG available to R users, we port the python code to using the `reticulate` package.
141130

142131
Nonetheless, we highly recommend that users use our package in python for more involved analysis as the package has been developed and tested more thoroughly in python.
143132

@@ -147,7 +136,6 @@ library(reticulate)
147136

148137
# grab python interpreter
149138
use_python('/usr/bin/python3') # in case UTAG is installed on native python
150-
# use_condaenv('utag') # in case UTAG is installed using conda
151139
# use_virtualevn('utag') # in case UTAG is installed under virtualenv
152140

153141

@@ -192,3 +180,25 @@ or before by:
192180
```bash
193181
pytest utag/tests/utag_test.py
194182
```
183+
184+
# License
185+
This project is licensed under the GPLv3+ license. Please see the [LICENSE](LICENSE) file for details.
186+
187+
# Citation
188+
If you use UTAG in your research, please cite:
189+
190+
```
191+
Kim, J., Rustam, S., Mosquera, J.M. et al. Unsupervised discovery of tissue architecture in multiplexed imaging. Nat Methods 19, 1653–1661 (2022). https://doi.org/10.1038/s41592-022-01657-2
192+
```
193+
194+
```bibtex
195+
@article{kim2022unsupervised,
196+
title={Unsupervised discovery of tissue architecture in multiplexed imaging},
197+
author={Kim, Junbum and Rustam, Samir and Mosquera, Juan Miguel and Shayhiev, Renat and Rendeiro, Andre F and Elemento, Olivier},
198+
journal={Nature Methods},
199+
volume={19},
200+
pages={1653--1661},
201+
year={2022},
202+
publisher={Nature Publishing Group}
203+
}
204+
```

environment.yml

Lines changed: 0 additions & 137 deletions
This file was deleted.

0 commit comments

Comments
 (0)