Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Release 0.1.4 #54

Merged
merged 4 commits into from
Aug 15, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 22 additions & 3 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,11 @@ on:
branches: [ "main" ]

jobs:
build:
test:
runs-on: ubuntu-latest

strategy:
matrix:
python-version: [ '3.9', '3.10', '3.11', '3.12' ]
steps:
- uses: actions/checkout@v3
- name: Install Poetry
Expand All @@ -19,7 +21,7 @@ jobs:
uses: snok/install-poetry@v1
- uses: actions/setup-python@v4
with:
python-version: '3.9'
python-version: ${{ matrix.python-version }}
cache: 'poetry'
- name: Install project
if: steps.cached-poetry-dependencies.outputs.cache-hit != 'true'
Expand All @@ -31,6 +33,23 @@ jobs:
- name: Pytest
run: |
poetry run pytest

docs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Install Poetry
with:
virtualenvs-create: true
virtualenvs-in-project: true
uses: snok/install-poetry@v1
- uses: actions/setup-python@v4
with:
python-version: '3.12'
cache: 'poetry'
- name: Install project
if: steps.cached-poetry-dependencies.outputs.cache-hit != 'true'
run: poetry install --with docs,dev --no-interaction
- name: Build documentation
run: |
mkdir gh-pages
Expand Down
6 changes: 3 additions & 3 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM python:3.10-slim
FROM python:3.12-slim

WORKDIR /code

Expand All @@ -25,7 +25,7 @@ ENV POETRY_HOME=/opt/poetry

# install poetry into its own venv
RUN python3 -m venv $POETRY_HOME && \
$POETRY_HOME/bin/pip install poetry==1.7.1
$POETRY_HOME/bin/pip install poetry==1.8.0

ENV VIRTUAL_ENV=/poetry-env \
PATH="/poetry-env/bin:$POETRY_HOME/bin:$PATH"
Expand All @@ -39,6 +39,6 @@ USER $USERNAME
COPY --chown=${USER_UID}:${USER_GID} pyproject.toml poetry.lock README.md /code/
COPY --chown=${USER_UID}:${USER_GID} starling/__init__.py /code/starling/__init__.py

RUN poetry install --with docs,dev
RUN poetry install --with docs,dev && poetry self add poetry-plugin-export

COPY --chown=${USER_UID}:${USER_GID} . .
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@
![build](https://github.com/camlab-bioml/starling/actions/workflows/main.yml/badge.svg)
![](https://img.shields.io/badge/Python-3.9-blue)
![](https://img.shields.io/badge/Python-3.10-blue)
![](https://img.shields.io/badge/Python-3.11-blue)
![](https://img.shields.io/badge/Python-3.12-blue)


STARLING is a probabilistic model for clustering cells measured with spatial expression assays (e.g. IMC, MIBI, etc...) while accounting for segmentation errors.
Expand Down
1,559 changes: 805 additions & 754 deletions poetry.lock

Large diffs are not rendered by default.

10 changes: 7 additions & 3 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
[tool.poetry]
name = "biostarling"
packages = [{ include = "starling" }]
version = "0.1.3"
version = "0.1.4"
description = "Segmentation error aware clustering single-cell spatial expression data"
repository = "https://github.com/camlab-bioml/starling"
authors = ["Jett (Yuju) Lee <[email protected]>"]
Expand All @@ -10,17 +10,21 @@ keywords = ["imaging cytometry classifier single-cell"]
classifiers = [
"Intended Audience :: Science/Research",
"Programming Language :: Python :: 3.9",
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11",
"Programming Language :: Python :: 3.12",
]
license = "See License.txt"

[tool.poetry.dependencies]
python = ">= 3.9, < 3.11"
python = ">= 3.9, < 3.13"
phenograph = "^1.5.7"
flowsom = "^0.1.1"
numpy = "^1.26"
torch = "^2.4.0"
pandas = ">= 0.23.0"
pytorch-lightning = "^2.3.3"
scanpy = "^1.10.2"
torch = "^2.4.0"

[tool.poetry.group.dev]
optional = true
Expand Down
152 changes: 85 additions & 67 deletions requirements.txt
Original file line number Diff line number Diff line change
@@ -1,68 +1,86 @@
aiohttp==3.9.1 ; python_version >= "3.9" and python_version < "4.0"
aiosignal==1.3.1 ; python_version >= "3.9" and python_version < "4.0"
anndata==0.10.4 ; python_version >= "3.9" and python_version < "4.0"
array-api-compat==1.4 ; python_version >= "3.9" and python_version < "4.0"
aiohappyeyeballs==2.3.5 ; python_version >= "3.9" and python_version < "3.13"
aiohttp==3.10.3 ; python_version >= "3.9" and python_version < "3.13"
aiosignal==1.3.1 ; python_version >= "3.9" and python_version < "3.13"
anndata==0.10.8 ; python_version >= "3.9" and python_version < "3.13"
array-api-compat==1.8 ; python_version >= "3.9" and python_version < "3.13"
async-timeout==4.0.3 ; python_version >= "3.9" and python_version < "3.11"
attrs==23.2.0 ; python_version >= "3.9" and python_version < "4.0"
certifi==2023.11.17 ; python_version >= "3.9" and python_version < "4.0"
charset-normalizer==3.3.2 ; python_version >= "3.9" and python_version < "4.0"
colorama==0.4.6 ; python_version >= "3.9" and python_version < "4.0" and platform_system == "Windows"
contourpy==1.2.0 ; python_version >= "3.9" and python_version < "4.0"
cycler==0.12.1 ; python_version >= "3.9" and python_version < "4.0"
decorator==5.1.1 ; python_version >= "3.9" and python_version < "4.0"
exceptiongroup==1.2.0 ; python_version >= "3.9" and python_version < "3.11"
fcsparser==0.2.8 ; python_version >= "3.9" and python_version < "4.0"
flowcytometrytools==0.5.1 ; python_version >= "3.9" and python_version < "4.0"
flowsom==0.1.1 ; python_version >= "3.9" and python_version < "4.0"
fonttools==4.47.2 ; python_version >= "3.9" and python_version < "4.0"
frozenlist==1.4.1 ; python_version >= "3.9" and python_version < "4.0"
fsspec[http]==2023.12.2 ; python_version >= "3.9" and python_version < "4.0"
h5py==3.10.0 ; python_version >= "3.9" and python_version < "4.0"
idna==3.6 ; python_version >= "3.9" and python_version < "4.0"
igraph==0.10.8 ; python_version >= "3.9" and python_version < "4.0"
importlib-resources==6.1.1 ; python_version >= "3.9" and python_version < "3.10"
joblib==1.3.2 ; python_version >= "3.9" and python_version < "4.0"
kiwisolver==1.4.5 ; python_version >= "3.9" and python_version < "4.0"
leidenalg==0.10.1 ; python_version >= "3.9" and python_version < "4.0"
lightning-utilities==0.10.0 ; python_version >= "3.9" and python_version < "4.0"
llvmlite==0.41.1 ; python_version >= "3.9" and python_version < "4.0"
matplotlib==3.8.2 ; python_version >= "3.9" and python_version < "4.0"
minisom==2.3.1 ; python_version >= "3.9" and python_version < "4.0"
multidict==6.0.4 ; python_version >= "3.9" and python_version < "4.0"
natsort==8.4.0 ; python_version >= "3.9" and python_version < "4.0"
networkx==3.2.1 ; python_version >= "3.9" and python_version < "4.0"
numba==0.58.1 ; python_version >= "3.9" and python_version < "4.0"
numpy==1.26.3 ; python_version >= "3.9" and python_version < "4.0"
packaging==23.2 ; python_version >= "3.9" and python_version < "4.0"
pandas==2.1.4 ; python_version >= "3.9" and python_version < "4.0"
patsy==0.5.6 ; python_version >= "3.9" and python_version < "4.0"
phenograph==1.5.7 ; python_version >= "3.9" and python_version < "4.0"
pillow==10.2.0 ; python_version >= "3.9" and python_version < "4.0"
psutil==5.9.7 ; python_version >= "3.9" and python_version < "4.0"
pynndescent==0.5.11 ; python_version >= "3.9" and python_version < "4.0"
pyparsing==3.1.1 ; python_version >= "3.9" and python_version < "4.0"
python-dateutil==2.8.2 ; python_version >= "3.9" and python_version < "4.0"
pytorch-lightning==2.1.0 ; python_version >= "3.9" and python_version < "4.0"
pytz==2023.3.post1 ; python_version >= "3.9" and python_version < "4.0"
pyyaml==6.0.1 ; python_version >= "3.9" and python_version < "4.0"
requests==2.31.0 ; python_version >= "3.9" and python_version < "4.0"
scanpy==1.9.5 ; python_version >= "3.9" and python_version < "4.0"
scikit-learn==1.4.0 ; python_version >= "3.9" and python_version < "4.0"
scipy==1.11.4 ; python_version >= "3.9" and python_version < "4.0"
seaborn==0.13.1 ; python_version >= "3.9" and python_version < "4.0"
session-info==1.0.0 ; python_version >= "3.9" and python_version < "4.0"
setuptools==69.0.3 ; python_version >= "3.9" and python_version < "4.0"
six==1.16.0 ; python_version >= "3.9" and python_version < "4.0"
statsmodels==0.14.1 ; python_version >= "3.9" and python_version < "4.0"
stdlib-list==0.10.0 ; python_version >= "3.9" and python_version < "4.0"
texttable==1.7.0 ; python_version >= "3.9" and python_version < "4.0"
threadpoolctl==3.2.0 ; python_version >= "3.9" and python_version < "4.0"
torch==1.12.1 ; python_version >= "3.9" and python_version < "4.0"
torchmetrics==1.3.0.post0 ; python_version >= "3.9" and python_version < "4.0"
tqdm==4.66.1 ; python_version >= "3.9" and python_version < "4.0"
typing-extensions==4.9.0 ; python_version >= "3.9" and python_version < "4.0"
tzdata==2023.4 ; python_version >= "3.9" and python_version < "4.0"
umap-learn==0.5.5 ; python_version >= "3.9" and python_version < "4.0"
urllib3==2.1.0 ; python_version >= "3.9" and python_version < "4.0"
yarl==1.9.4 ; python_version >= "3.9" and python_version < "4.0"
zipp==3.17.0 ; python_version >= "3.9" and python_version < "3.10"
attrs==24.2.0 ; python_version >= "3.9" and python_version < "3.13"
colorama==0.4.6 ; python_version >= "3.9" and python_version < "3.13" and platform_system == "Windows"
contourpy==1.2.1 ; python_version >= "3.9" and python_version < "3.13"
cycler==0.12.1 ; python_version >= "3.9" and python_version < "3.13"
decorator==5.1.1 ; python_version >= "3.9" and python_version < "3.13"
exceptiongroup==1.2.2 ; python_version >= "3.9" and python_version < "3.11"
fcsparser==0.2.8 ; python_version >= "3.9" and python_version < "3.13"
filelock==3.15.4 ; python_version >= "3.9" and python_version < "3.13"
flowcytometrytools==0.5.1 ; python_version >= "3.9" and python_version < "3.13"
flowsom==0.1.1 ; python_version >= "3.9" and python_version < "3.13"
fonttools==4.53.1 ; python_version >= "3.9" and python_version < "3.13"
frozenlist==1.4.1 ; python_version >= "3.9" and python_version < "3.13"
fsspec==2024.6.1 ; python_version >= "3.9" and python_version < "3.13"
fsspec[http]==2024.6.1 ; python_version >= "3.9" and python_version < "3.13"
get-annotations==0.1.2 ; python_version >= "3.9" and python_version < "3.10"
h5py==3.11.0 ; python_version >= "3.9" and python_version < "3.13"
idna==3.7 ; python_version >= "3.9" and python_version < "3.13"
igraph==0.11.6 ; python_version >= "3.9" and python_version < "3.13"
importlib-resources==6.4.0 ; python_version >= "3.9" and python_version < "3.10"
jinja2==3.1.4 ; python_version >= "3.9" and python_version < "3.13"
joblib==1.4.2 ; python_version >= "3.9" and python_version < "3.13"
kiwisolver==1.4.5 ; python_version >= "3.9" and python_version < "3.13"
legacy-api-wrap==1.4 ; python_version >= "3.9" and python_version < "3.13"
leidenalg==0.10.2 ; python_version >= "3.9" and python_version < "3.13"
lightning-utilities==0.11.6 ; python_version >= "3.9" and python_version < "3.13"
llvmlite==0.43.0 ; python_version >= "3.9" and python_version < "3.13"
markupsafe==2.1.5 ; python_version >= "3.9" and python_version < "3.13"
matplotlib==3.9.1.post1 ; python_version >= "3.9" and python_version < "3.13"
minisom==2.3.2 ; python_version >= "3.9" and python_version < "3.13"
mpmath==1.3.0 ; python_version >= "3.9" and python_version < "3.13"
multidict==6.0.5 ; python_version >= "3.9" and python_version < "3.13"
natsort==8.4.0 ; python_version >= "3.9" and python_version < "3.13"
networkx==3.2.1 ; python_version >= "3.9" and python_version < "3.13"
numba==0.60.0 ; python_version >= "3.9" and python_version < "3.13"
numpy==1.26.4 ; python_version >= "3.9" and python_version < "3.13"
nvidia-cublas-cu12==12.1.3.1 ; platform_system == "Linux" and platform_machine == "x86_64" and python_version >= "3.9" and python_version < "3.13"
nvidia-cuda-cupti-cu12==12.1.105 ; platform_system == "Linux" and platform_machine == "x86_64" and python_version >= "3.9" and python_version < "3.13"
nvidia-cuda-nvrtc-cu12==12.1.105 ; platform_system == "Linux" and platform_machine == "x86_64" and python_version >= "3.9" and python_version < "3.13"
nvidia-cuda-runtime-cu12==12.1.105 ; platform_system == "Linux" and platform_machine == "x86_64" and python_version >= "3.9" and python_version < "3.13"
nvidia-cudnn-cu12==9.1.0.70 ; platform_system == "Linux" and platform_machine == "x86_64" and python_version >= "3.9" and python_version < "3.13"
nvidia-cufft-cu12==11.0.2.54 ; platform_system == "Linux" and platform_machine == "x86_64" and python_version >= "3.9" and python_version < "3.13"
nvidia-curand-cu12==10.3.2.106 ; platform_system == "Linux" and platform_machine == "x86_64" and python_version >= "3.9" and python_version < "3.13"
nvidia-cusolver-cu12==11.4.5.107 ; platform_system == "Linux" and platform_machine == "x86_64" and python_version >= "3.9" and python_version < "3.13"
nvidia-cusparse-cu12==12.1.0.106 ; platform_system == "Linux" and platform_machine == "x86_64" and python_version >= "3.9" and python_version < "3.13"
nvidia-nccl-cu12==2.20.5 ; platform_system == "Linux" and platform_machine == "x86_64" and python_version >= "3.9" and python_version < "3.13"
nvidia-nvjitlink-cu12==12.6.20 ; platform_system == "Linux" and platform_machine == "x86_64" and python_version >= "3.9" and python_version < "3.13"
nvidia-nvtx-cu12==12.1.105 ; platform_system == "Linux" and platform_machine == "x86_64" and python_version >= "3.9" and python_version < "3.13"
packaging==24.1 ; python_version >= "3.9" and python_version < "3.13"
pandas==2.2.2 ; python_version >= "3.9" and python_version < "3.13"
patsy==0.5.6 ; python_version >= "3.9" and python_version < "3.13"
phenograph==1.5.7 ; python_version >= "3.9" and python_version < "3.13"
pillow==10.4.0 ; python_version >= "3.9" and python_version < "3.13"
psutil==6.0.0 ; python_version >= "3.9" and python_version < "3.13"
pynndescent==0.5.13 ; python_version >= "3.9" and python_version < "3.13"
pyparsing==3.1.2 ; python_version >= "3.9" and python_version < "3.13"
python-dateutil==2.9.0.post0 ; python_version >= "3.9" and python_version < "3.13"
pytorch-lightning==2.4.0 ; python_version >= "3.9" and python_version < "3.13"
pytz==2024.1 ; python_version >= "3.9" and python_version < "3.13"
pyyaml==6.0.2 ; python_version >= "3.9" and python_version < "3.13"
scanpy==1.10.2 ; python_version >= "3.9" and python_version < "3.13"
scikit-learn==1.5.1 ; python_version >= "3.9" and python_version < "3.13"
scipy==1.13.1 ; python_version >= "3.9" and python_version < "3.13"
seaborn==0.13.2 ; python_version >= "3.9" and python_version < "3.13"
session-info==1.0.0 ; python_version >= "3.9" and python_version < "3.13"
setuptools==72.1.0 ; python_version >= "3.9" and python_version < "3.13"
six==1.16.0 ; python_version >= "3.9" and python_version < "3.13"
statsmodels==0.14.2 ; python_version >= "3.9" and python_version < "3.13"
stdlib-list==0.10.0 ; python_version >= "3.9" and python_version < "3.13"
sympy==1.13.2 ; python_version >= "3.9" and python_version < "3.13"
texttable==1.7.0 ; python_version >= "3.9" and python_version < "3.13"
threadpoolctl==3.5.0 ; python_version >= "3.9" and python_version < "3.13"
torch==2.4.0 ; python_version >= "3.9" and python_version < "3.13"
torchmetrics==1.4.1 ; python_version >= "3.9" and python_version < "3.13"
tqdm==4.66.5 ; python_version >= "3.9" and python_version < "3.13"
triton==3.0.0 ; platform_system == "Linux" and platform_machine == "x86_64" and python_version < "3.13" and python_version >= "3.9"
typing-extensions==4.12.2 ; python_version >= "3.9" and python_version < "3.13"
tzdata==2024.1 ; python_version >= "3.9" and python_version < "3.13"
umap-learn==0.5.6 ; python_version >= "3.9" and python_version < "3.13"
yarl==1.9.4 ; python_version >= "3.9" and python_version < "3.13"
zipp==3.20.0 ; python_version >= "3.9" and python_version < "3.10"
4 changes: 3 additions & 1 deletion starling/utility.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@
import scanpy.external as sce
import torch

# patch outdated flowsom dependencies
pd.DataFrame.as_matrix = pd.DataFrame.to_numpy
collections.MutableMapping = abc.MutableMapping
from flowsom import flowsom
from scanpy import AnnData
Expand Down Expand Up @@ -107,7 +109,7 @@ def init_clustering(
elif initial_clustering_method == "FS":
## needs to output to csv first
# ofn = OPATH + "fs_" + ONAME + ".csv"
pd.DataFrame(X).to_csv("fs.csv")
pd.DataFrame(adata.X).to_csv("fs.csv")
fsom = flowsom("fs.csv", if_fcs=False, if_drop=True, drop_col=["Unnamed: 0"])

fsom.som_mapping(
Expand Down
6 changes: 6 additions & 0 deletions tests/test_utility.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,12 @@ def test_init_clustering_pg(simple_adata):
assert_annotated(initialized, k)


def test_init_clustering_fs(simple_adata):
k = 2
initialized = init_clustering("FS", simple_adata, k)
assert_annotated(initialized, k)


def test_init_clustering_user(simple_adata):
k = 3
initialized = init_clustering(
Expand Down
Loading