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

adding graph + tile stitching to trigger tests #395

Closed
wants to merge 86 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
86 commits
Select commit Hold shift + click to select a range
c769f91
add users and papers to README
Dana-Farber Dec 16, 2022
c71bc9b
Update README.md
Dana-Farber Dec 16, 2022
c4a72ff
Update README.md
Dana-Farber Feb 7, 2023
0d78e45
Update README.md
Dana-Farber Feb 8, 2023
0031f6e
Update README.md
Dana-Farber Feb 8, 2023
57782ab
Bump ipython from 7.31.1 to 8.10.0 in /docs
dependabot[bot] Feb 11, 2023
9d5ac7f
Merge pull request #346 from Dana-Farber-AIOS/dependabot/pip/docs/ipy…
jacob-rosenthal Apr 13, 2023
f159f80
Merge branch 'master' into v2.1.1
jacob-rosenthal Apr 13, 2023
e2c29b9
bump isort version for python 3.7 compatibility
jacob-rosenthal Apr 19, 2023
8553ee5
Update README.md
jacob-rosenthal May 5, 2023
9631286
Update readthedocs-requirements.txt
sreekarreddydfci May 9, 2023
42c4cc8
Update .readthedocs.yaml
sreekarreddydfci May 9, 2023
912834f
Update .readthedocs.yaml
sreekarreddydfci May 9, 2023
927c86e
Update .readthedocs.yaml
sreekarreddydfci May 9, 2023
eb62e29
Update readthedocs-requirements.txt
sreekarreddydfci May 9, 2023
03e9b36
Merge pull request #347 from Dana-Farber-AIOS/v2.1.1
jacob-rosenthal May 10, 2023
9b6ed8e
Merge pull request #348 from sreekarreddydfci/master
jacob-rosenthal May 11, 2023
837e8ec
Update _version.py
sreekarreddydfci May 17, 2023
8b88380
Update publish-to-pypi.yml
sreekarreddydfci May 18, 2023
9c91bc5
Update publish-to-pypi.yml
sreekarreddydfci May 22, 2023
1ac207f
Update publish-to-pypi.yml
sreekarreddydfci May 22, 2023
f289495
Update publish-to-pypi.yml
sreekarreddydfci May 22, 2023
05aefd8
Update publish-to-pypi.yml
sreekarreddydfci May 22, 2023
030618d
Update tests-conda.yml
sreekarreddydfci May 22, 2023
0f53968
Update tests-conda.yml
sreekarreddydfci May 22, 2023
c95fd1d
Update tests-conda.yml
sreekarreddydfci May 22, 2023
47e0ae0
Update tests-conda.yml
sreekarreddydfci May 22, 2023
735611f
Update environment.yml
sreekarreddydfci May 22, 2023
88e806c
Merge pull request #351 from Dana-Farber-AIOS/sreekarreddydfci-patch-1
jacob-rosenthal May 23, 2023
b3a0535
Update environment.yml
sreekarreddydfci May 26, 2023
312c1fc
Update environment.yml
sreekarreddydfci May 26, 2023
3b82262
Update tests-conda.yml
sreekarreddydfci May 26, 2023
25dac4a
Update tests-conda.yml
sreekarreddydfci May 26, 2023
7670a12
Update tests-conda.yml
sreekarreddydfci May 26, 2023
dfc21d5
Update tests-conda.yml
sreekarreddydfci May 26, 2023
9c2fa14
Merge pull request #1 from sreekarreddydfci/sreekarreddydfci-patch-1
sreekarreddydfci May 26, 2023
b630aec
Remove commented out lines
jacob-rosenthal May 30, 2023
572af26
Merge pull request #354 from sreekarreddydfci/master
jacob-rosenthal May 30, 2023
466ca3e
Merge branch 'master' into sreekarreddydfci-patch-2
jacob-rosenthal May 30, 2023
9343e4e
Merge pull request #352 from Dana-Farber-AIOS/sreekarreddydfci-patch-2
jacob-rosenthal May 30, 2023
935a630
allow manual workflow triggering
jacob-rosenthal May 30, 2023
b4b61b5
Merge pull request #355 from Dana-Farber-AIOS/workflows-dispatch
jacob-rosenthal May 30, 2023
1e32970
Update environment.yml (#361)
sreekarreddydfci Jul 26, 2023
68a7224
Update README.md
Dana-Farber Aug 23, 2023
b010489
Added graph API and restructured pathml.ml.models
VarunUllanat Nov 11, 2023
ac03714
Added new tests for hactnet
VarunUllanat Nov 15, 2023
4b6d1d5
Added tests for graph preprocessing and dataset feature extraction"
VarunUllanat Nov 15, 2023
374f8c1
Added new graph utils tests
VarunUllanat Nov 16, 2023
4952436
bugfix in colab installation instructions in README.md
Dana-Farber Nov 17, 2023
4196fa3
Merge pull request #376 from Dana-Farber-AIOS/Dana-Farber-patch-1
Dana-Farber Nov 17, 2023
dd61eea
Update readthedocs-requirements.txt (#377)
sreekarreddydfci Nov 20, 2023
6aefb39
Merge pull request #378 from VarunUllanat/dev_graph
VarunUllanat Nov 22, 2023
cc58118
Cleaned up code and fixed pre-commit errors
VarunUllanat Nov 22, 2023
7c92d9f
Cleaned up files and added comments and docstrings
VarunUllanat Nov 24, 2023
3274101
reformatted pathml/datasets/datasets.py
VarunUllanat Nov 29, 2023
346612e
removed torchvision dependency in environment.yml
VarunUllanat Nov 29, 2023
69fe55e
Merge branch 'dev_graph' into dev_graph
VarunUllanat Nov 29, 2023
1c1778c
Removed unused import in graph_tests
VarunUllanat Nov 29, 2023
7abc289
Merge branch 'dev_graph' of https://github.com/VarunUllanat/pathml in…
VarunUllanat Nov 29, 2023
644d3f2
Merge pull request #379 from VarunUllanat/dev_graph
VarunUllanat Nov 29, 2023
f8b89cd
Remove torchvision dependency in tests and added nn.Module input for …
VarunUllanat Nov 30, 2023
b1b0b29
Merge pull request #380 from VarunUllanat/dev_graph
VarunUllanat Nov 30, 2023
4ad79e5
Make flake8 compliant
VarunUllanat Dec 1, 2023
44c33f2
Merge pull request #381 from VarunUllanat/dev_graph
VarunUllanat Dec 1, 2023
bbf35bf
Updated environment.yml to include flexible numpy and scipy versions
VarunUllanat Dec 1, 2023
aa10b26
Merge pull request #383 from VarunUllanat/dev_graph
VarunUllanat Dec 1, 2023
da844df
Added capabilities for all possible versions of skimage and flake8 co…
VarunUllanat Dec 1, 2023
5a9d7d4
Merge pull request #385 from VarunUllanat/dev_graph
VarunUllanat Dec 1, 2023
3944c80
Changes spams installation in github workflows
VarunUllanat Dec 2, 2023
75f119d
Merge pull request #387 from VarunUllanat/dev_graph
VarunUllanat Dec 2, 2023
b027168
Updated skimage version for importing the graph module
VarunUllanat Dec 2, 2023
fc0e8b3
Merge pull request #389 from VarunUllanat/dev_graph
VarunUllanat Dec 2, 2023
c2fbdc9
Added tilestitching code
sreekarreddydfci Dec 4, 2023
7c733b1
Update environment.yml
sreekarreddydfci Dec 4, 2023
2d183db
Create testdata folder for tilestitching data
sreekarreddydfci Dec 4, 2023
4413b66
Add large .tif file with Git LFS
sreekarreddydfci Dec 4, 2023
4e983de
≈Merge branch 'dev_graphAPI' of https://github.com/sreekarreddydfci/p…
sreekarreddydfci Dec 4, 2023
f590dd2
Remove readme file in tests
sreekarreddydfci Dec 4, 2023
393983c
Update tests-conda.yml
sreekarreddydfci Dec 4, 2023
e4af3e4
Added exclude marker to run tests
sreekarreddydfci Dec 4, 2023
e2bdf96
Merge branch 'dev_graphAPI' of https://github.com/sreekarreddydfci/pa…
sreekarreddydfci Dec 4, 2023
d4e7f3f
Edited a testcase
sreekarreddydfci Dec 4, 2023
9aeec4f
Commented testcases
sreekarreddydfci Dec 4, 2023
c01d6a7
Merge pull request #391 from sreekarreddydfci/dev_graphAPI
VarunUllanat Dec 4, 2023
ab59e31
Make flake8 compliant
VarunUllanat Dec 6, 2023
b275a04
Removed tile stiching generated files
VarunUllanat Dec 6, 2023
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
Binary file added .coverage_others
Binary file not shown.
Binary file added .coverage_tilestitcher
Binary file not shown.
1 change: 1 addition & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
tests/testdata/tilestitching_testdata/*.tif filter=lfs diff=lfs merge=lfs -text
3 changes: 2 additions & 1 deletion .github/workflows/publish-to-pypi.yml
Original file line number Diff line number Diff line change
@@ -1,13 +1,14 @@
name: Publish PathML distribution to PyPI and TestPyPI

on:
workflow_dispatch:
release:
types: [published]

jobs:
build-n-publish:
name: Build and publish PathML distribution to PyPI and TestPyPI
runs-on: ubuntu-18.04
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@master
- name: Set up Python 3.9
Expand Down
105 changes: 89 additions & 16 deletions .github/workflows/tests-conda.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
name: Tests

on:
on:
workflow_dispatch:
pull_request:
branches:
- dev
Expand All @@ -17,60 +18,132 @@ jobs:
max-parallel: 5
matrix:
python-version: [3.8, 3.9]
timeout-minutes: 60 # add a timeout

steps:
- uses: actions/checkout@v2
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python-version }}
# Test matrix by printing the current Python version
- name: Display Python version
run: python -c "import sys; print(sys.version)"
- name: Install dependencies
shell: bash -l {0}
run: |
sudo apt-get update
# install openslide
sudo apt-get install openslide-tools
# install pandoc for making documentation
sudo apt-get install pandoc
- name: Setup Miniconda
# You may pin to the exact commit or the version.
# uses: conda-incubator/setup-miniconda@f4c00b0ec69bdc87b1ab4972613558dd9f4f36f3
uses: conda-incubator/[email protected]
uses: conda-incubator/setup-miniconda@v2
with:
add_pip_as_python_dependency: false
environment-file: environment.yml
auto-activate-base: false
activate-environment: pathml
environment-file: environment.yml
mamba-version: "*"
python-version: ${{ matrix.python-version }}
- name: Debugging
run: |
echo "Printing the environment.yml file..."
cat environment.yml
echo "Checking the status of mamba..."
mamba --version
echo "Checking the available disk space..."
df -h
- name: Install dependencies with mamba
shell: bash -l {0}
run: mamba env update --file environment.yml --name pathml
- name: Conda info
shell: bash -l {0}
run: |
conda info
conda list
- name: pip install pathml
shell: bash -l {0}

- name: Set default Temurin JDK 17
run: |
sudo update-java-alternatives --set temurin-17-jdk-amd64 || true
java -version

- name: Install PathML
shell: bash -l {0}
run: pip install -e .

- name: Install python-spams
shell: bash -l {0}
run: pip install spams

- name: disk usage
shell: bash -l {0}
run: |
sudo df -h
sudo du -h
- name: Test with pytest and generate coverage report

# - name: Check Coverage Command
# run: |
# which coverage
# coverage --version

# - name: Test with pytest for tile_stitcher
# run: |
# java -version
# python -m pytest tests/preprocessing_tests/test_tilestitcher.py

# - name: Test with pytest and generate coverage report
# shell: bash -l {0}
# run: |
# coverage run -m pytest -m "not slow and not exclude"
# coverage xml
# - name: Upload coverage to Codecov
# uses: codecov/codecov-action@v2
# with:
# token: ${{ secrets.CODECOV_TOKEN }}
# env_vars: OS,PYTHON
# fail_ci_if_error: true
# files: ./coverage.xml
# name: codecov-umbrella
# verbose: true

- name: Test other modules with pytest and generate coverage
shell: bash -l {0}
run: |
COVERAGE_FILE=.coverage_others coverage run -m pytest -m "not slow and not exclude"

- name: Test tile_stitcher with pytest and generate coverage
shell: bash -l {0}
run: |
coverage run -m pytest -m "not slow"
coverage xml
- name: Upload coverage to Codecov
COVERAGE_FILE=.coverage_tilestitcher coverage run -m pytest tests/preprocessing_tests/test_tilestitcher.py

- name: List Files in Directory
shell: bash -l {0}
run: |
ls -la

- name: Combine Coverage Data
shell: bash -l {0}
run: |
coverage combine .coverage_tilestitcher .coverage_others

- name: Generate Combined Coverage Report
shell: bash -l {0}
run: |
coverage xml -o combined_coverage.xml

# - name: Combine coverage data
# shell: bash -l {0}
# run: |
# coverage combine coverage_tilestitcher.xml coverage_others.xml
# coverage xml -o coverage_combined.xml

- name: Upload combined coverage to Codecov
uses: codecov/codecov-action@v2
with:
token: ${{ secrets.CODECOV_TOKEN }}
env_vars: OS,PYTHON
fail_ci_if_error: true
files: ./coverage.xml
files: ./combined_coverage.xml
name: codecov-umbrella
verbose: true

- name: Compile docs
shell: bash -l {0}
run: |
Expand Down
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -33,3 +33,6 @@ scratch.ipynb

# dask
dask-worker-space/

# tile stitching files
tools/*
2 changes: 1 addition & 1 deletion .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ repos:
- id: black

- repo: https://github.com/timothycrosley/isort
rev: 5.10.1
rev: 5.11.5
hooks:
- id: isort

Expand Down
6 changes: 5 additions & 1 deletion .readthedocs.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,17 @@
# Required
version: 2

build:
os: ubuntu-22.04
tools:
python: "3.8"

# Build documentation with Sphinx
sphinx:
configuration: docs/source/conf.py
builder: html
fail_on_warning: false

python:
version: "3.8"
install:
- requirements: docs/readthedocs-requirements.txt
74 changes: 62 additions & 12 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,19 +1,27 @@
<img src=https://raw.githubusercontent.com/Dana-Farber-AIOS/pathml/master/docs/source/_static/images/logo.png width="300">

<img src=https://raw.githubusercontent.com/Dana-Farber-AIOS/pathml/master/docs/source/_static/images/overview.png width="750">
🤖🔬 **PathML: Tools for computational pathology**

[![Downloads](https://static.pepy.tech/badge/pathml)](https://pepy.tech/project/pathml)
[![Documentation Status](https://readthedocs.org/projects/pathml/badge/?version=latest)](https://pathml.readthedocs.io/en/latest/?badge=latest)
[![codecov](https://codecov.io/gh/Dana-Farber-AIOS/pathml/branch/master/graph/badge.svg?token=UHSQPTM28Y)](https://codecov.io/gh/Dana-Farber-AIOS/pathml)
[![Code style: black](https://img.shields.io/badge/code%20style-black-000000.svg)](https://github.com/psf/black)
[![PyPI version](https://img.shields.io/pypi/v/pathml)](https://pypi.org/project/pathml/)
[![Downloads](https://pepy.tech/badge/pathml)](https://pepy.tech/project/pathml)
[![codecov](https://codecov.io/gh/Dana-Farber-AIOS/pathml/branch/master/graph/badge.svg?token=UHSQPTM28Y)](https://codecov.io/gh/Dana-Farber-AIOS/pathml)

⭐ **PathML objective is to lower the barrier to entry to digital pathology**

Imaging datasets in cancer research are growing exponentially in both quantity and information density. These massive datasets may enable derivation of insights for cancer research and clinical care, but only if researchers are equipped with the tools to leverage advanced computational analysis approaches such as machine learning and artificial intelligence. In this work, we highlight three themes to guide development of such computational tools: scalability, standardization, and ease of use. We then apply these principles to develop PathML, a general-purpose research toolkit for computational pathology. We describe the design of the PathML framework and demonstrate applications in diverse use cases.

🚀 **The fastest way to get started?**

docker pull pathml/pathml && docker run -it -p 8888:8888 pathml/pathml

| Branch | Test status |
| ------ | ------------- |
| master | ![tests](https://github.com/Dana-Farber-AIOS/pathml/actions/workflows/tests-conda.yml/badge.svg?branch=master) |
| dev | ![tests](https://github.com/Dana-Farber-AIOS/pathml/actions/workflows/tests-conda.yml/badge.svg?branch=dev) |

An open-source toolkit for computational pathology and machine learning.
<img src=https://raw.githubusercontent.com/Dana-Farber-AIOS/pathml/master/docs/source/_static/images/logo.png width="300">

<img src=https://raw.githubusercontent.com/Dana-Farber-AIOS/pathml/master/docs/source/_static/images/overview.png width="750">

**View [documentation](https://pathml.readthedocs.io/en/latest/)**

Expand Down Expand Up @@ -125,6 +133,24 @@ Note that these instructions assume that there are no other processes using port
Please refer to the `Docker run` [documentation](https://docs.docker.com/engine/reference/run/) for further instructions
on accessing the container, e.g. for mounting volumes to access files on a local machine from within the container.

## Option 4: Google Colab

To get PathML running in a Colab environment:

````
import os
!pip install openslide-python
!apt-get install openslide-tools
!apt-get install openjdk-8-jdk-headless -qq > /dev/null
os.environ["JAVA_HOME"] = "/usr/lib/jvm/java-8-openjdk-amd64"
!update-alternatives --set java /usr/lib/jvm/java-8-openjdk-amd64/jre/bin/java
!java -version
!pip install pathml
````

*Thanks to all of our open-source collaborators for helping maintain these installation instructions!*
*Please open an issue for any bugs or other problems during installation process.*

## CUDA

To use GPU acceleration for model training or other tasks, you must install CUDA.
Expand Down Expand Up @@ -191,12 +217,36 @@ See [contributing](https://github.com/Dana-Farber-AIOS/pathml/blob/master/CONTRI

# Citing

If you use `PathML` in your work, please cite our paper:
If you use `PathML` please cite:

- [**J. Rosenthal et al., "Building tools for machine learning and artificial intelligence in cancer research: best practices and a case study with the PathML toolkit for computational pathology." Molecular Cancer Research, 2022.**](https://doi.org/10.1158/1541-7786.MCR-21-0665)

So far, PathML was used in the following manuscripts:

- [J. Linares et al. **Molecular Cell** 2021](https://www.cell.com/molecular-cell/fulltext/S1097-2765(21)00729-2)
- [A. Shmatko et al. **Nature Cancer** 2022](https://www.nature.com/articles/s43018-022-00436-4)
- [J. Pocock et al. **Nature Communications Medicine** 2022](https://www.nature.com/articles/s43856-022-00186-5)
- [S. Orsulic et al. **Frontiers in Oncology** 2022](https://www.frontiersin.org/articles/10.3389/fonc.2022.924945/full)
- [D. Brundage et al. **arXiv** 2022](https://arxiv.org/abs/2203.13888)
- [A. Marcolini et al. **SoftwareX** 2022](https://www.sciencedirect.com/science/article/pii/S2352711022001558)
- [M. Rahman et al. **Bioengineering** 2022](https://www.mdpi.com/2306-5354/9/8/335)
- [C. Lama et al. **bioRxiv** 2022](https://www.biorxiv.org/content/10.1101/2022.09.28.509751v1.full)
- the list continues [**here 🔗 for 2023 and onwards**](https://scholar.google.com/scholar?oi=bibs&hl=en&cites=1157052756975292108)

# Users

<table style="border: 0px !important;"><tr><td>This is where in the world our most enthusiastic supporters are located:
<br/><br/>
<img src="https://user-images.githubusercontent.com/25375373/208137141-e450aa86-8433-415a-9cc7-c4274139bdc2.png" width="500px">
</td><td>
and this is where they work:
<br/><br/>
<img src="https://user-images.githubusercontent.com/25375373/208137644-f73c86d0-c5c7-4094-80d9-ea11e0edbdc5.png" width="400px">
</td>
</tr>
</table>

Rosenthal J, Carelli R, Omar M, Brundage D, Halbert E, Nyman J, Hari SN, Van Allen EM, Marchionni L, Umeton R, Loda M.
Building tools for machine learning and artificial intelligence in cancer research: best practices and a case study
with the PathML toolkit for computational pathology. *Molecular Cancer Research*, 2021.
DOI: [10.1158/1541-7786.MCR-21-0665](https://doi.org/10.1158/1541-7786.MCR-21-0665)
Source: https://ossinsight.io/analyze/Dana-Farber-AIOS/pathml#people

# License

Expand All @@ -209,6 +259,6 @@ Commercial license options are available also.

Questions? Comments? Suggestions? Get in touch!

[PathML@dfci.harvard.edu](mailto:PathML@dfci.harvard.edu)
[pathml@dfci.harvard.edu](mailto:pathml@dfci.harvard.edu)

<img src=https://raw.githubusercontent.com/Dana-Farber-AIOS/pathml/master/docs/source/_static/images/dfci_cornell_joint_logos.png width="750">
8 changes: 4 additions & 4 deletions docs/readthedocs-requirements.txt
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
sphinx==4.3.2
sphinx==7.1.2
nbsphinx==0.8.8
nbsphinx-link==1.3.0
sphinx-rtd-theme==1.0.0
sphinx-autoapi==1.8.4
ipython==7.31.1
sphinx-rtd-theme==1.3.0
sphinx-autoapi==3.0.0
ipython==8.10.0
sphinx-copybutton==0.4.0
28 changes: 16 additions & 12 deletions environment.yml
Original file line number Diff line number Diff line change
@@ -1,33 +1,37 @@
name: pathml

channels:
- conda-forge
- pytorch
- conda-forge

dependencies:
- pip==21.3.1
- python==3.8
- numpy==1.19.5
- scipy==1.7.3
- scikit-image==0.18.3
- numpy # orig = 1.19.5
- scipy # orig = 1.7.3
- scikit-image # orig 0.18.3
- matplotlib==3.5.1
- python-spams==2.6.1
- openjdk==8.0.152
- pytorch==1.10.1
- openjdk<=18.0.0
- pytorch==1.13.1 # orig = 1.10.1
- h5py==3.1.0
- dask==2021.12.0
- pydicom==2.2.2
- pytest==6.2.5
- pytest==7.4.0 # orig = 6.2.5
- pre-commit==2.16.0
- coverage==5.5
- networkx==3.1
- pip:
- python-bioformats==4.0.0
- python-javabridge==4.0.0
- protobuf==3.20.1
- deepcell==0.11.0
- protobuf==3.20.3
- deepcell==0.12.7 # orig = 0.11.0
- onnx==1.14.0
- onnxruntime==1.15.1
- opencv-contrib-python==4.5.3.56
- openslide-python==1.1.2
- openslide-python==1.2.0
- scanpy==1.8.2
- anndata==0.7.8
- tqdm==4.62.3
- loguru==0.5.3
- pandas==1.5.2 # orig no req
- torch-geometric==2.3.1
- jpype1
Loading
Loading