-
Notifications
You must be signed in to change notification settings - Fork 0
JUMP Pilot Image Data Downloader and Loader #1
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
Merged
Merged
Changes from all commits
Commits
Show all changes
15 commits
Select commit
Hold shift + click to select a range
31d5bab
Updated license to give credit to the university
d481ef3
feat(package): scaffold jump-image-datasets and jump_pilot APIs
63a1e03
test(jump_pilot): verify metadata loading and downloader outputs
4bf6dc1
docs(jump_pilot): add packaged metadata download examples
a1e5caa
ci: add uv-based cross-platform test workflow
26e6fe5
chore: ignore local AGENTS guidance file
08a99f1
docs(image_downloader): add comprehensive class and function docstrings
5f5c6bf
docs(image_metadata): document metadata path and cache APIs
ceb846d
docs: add pip install instructions for installing from main branch
1fc95ef
docs: add executed pilot download notebook output
89af6d0
ci: enforce frozen dependency resolution in test workflow
b8faceb
docs: add provenance documentation for packaged JUMP pilot metadata p…
a820520
Added myself as an author
c2010ba
build(deps): raise pandas minimum to modern supported versions
506bc22
Define top-level package API and stabilize metadata-cache tests
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,31 @@ | ||
| name: Tests | ||
|
|
||
| on: | ||
| pull_request: | ||
| push: | ||
| branches: [main] | ||
|
|
||
| jobs: | ||
| test: | ||
| runs-on: ${{ matrix.os }} | ||
| strategy: | ||
| fail-fast: false | ||
| matrix: | ||
| os: [ubuntu-latest, macos-latest] | ||
| python-version: ["3.10", "3.11", "3.12", "3.13", "3.14"] | ||
|
|
||
| steps: | ||
| - name: Checkout | ||
| uses: actions/checkout@v4 | ||
|
|
||
| - name: Setup uv | ||
| uses: astral-sh/setup-uv@v4 | ||
|
|
||
| - name: Setup Python | ||
| run: uv python install ${{ matrix.python-version }} | ||
|
|
||
| - name: Sync test dependencies | ||
| run: uv sync --frozen --group test --python ${{ matrix.python-version }} | ||
|
|
||
| - name: Run tests | ||
| run: uv run --frozen --group test --python ${{ matrix.python-version }} pytest |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,8 @@ | ||
| __pycache__/ | ||
| .pytest_cache/ | ||
| .ruff_cache/ | ||
| .venv/ | ||
| dist/ | ||
| build/ | ||
| *.egg-info/ | ||
| AGENTS.md |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,2 +1,85 @@ | ||
| # jump_image_data_downloader | ||
| Allows JUMP users to download JUMP images by filtering JUMP image metadata. | ||
| # jump-image-datasets | ||
|
|
||
| `jump-image-datasets` provides packaged JUMP pilot metadata and utilities for downloading image files from metadata tables. | ||
|
|
||
| ## Install | ||
|
|
||
| ### Local development with uv | ||
|
|
||
| ```bash | ||
| uv venv | ||
| uv sync --group test | ||
| ``` | ||
|
|
||
| ### Editable install | ||
|
|
||
| ```bash | ||
| uv pip install -e . | ||
| ``` | ||
|
|
||
| ### Install from the GitHub repo with pip | ||
|
|
||
| ```bash | ||
| pip install "git+https://github.com/WayScience/jump_image_data_downloader.git" | ||
| ``` | ||
|
|
||
| This installs the package directly from the latest code, rather than from a PyPI release. | ||
|
|
||
| ## Usage | ||
|
|
||
| ```python | ||
| from jump_image_datasets.jump_pilot import image_downloader, image_metadata | ||
|
|
||
| # Load packaged metadata parquet as a DataFrame. | ||
| metadata_df = image_metadata.load_metadata() | ||
|
|
||
| # Download a small subset. | ||
| summary = image_downloader.download_images_with_metadata( | ||
| df=metadata_df.head(10), | ||
| url_column="Metadata_FileUrl", | ||
| default_output_dir="downloaded_jump_pilot_images", | ||
| parallel=True, | ||
| workers=8, | ||
| ) | ||
| print(summary) | ||
| ``` | ||
|
|
||
| For a full runnable example, see `docs/download_images_examples.ipynb`. | ||
|
|
||
| ## Packaged metadata provenance | ||
|
|
||
| This repository ships a packaged metadata table at: | ||
|
|
||
| - `src/jump_image_datasets/jump_pilot/data/2020_11_04_CPJUMP1_all_plates.parquet` | ||
|
|
||
| ### Why this file exists | ||
|
|
||
| The file is included so users can immediately load a stable JUMP pilot metadata table (via `jump_image_datasets.jump_pilot.image_metadata`) without requiring a separate data-fetch or preprocessing step. | ||
|
|
||
| ### How it was created | ||
|
|
||
| This parquet was generated from the JUMP Cell Painting Gallery using: | ||
|
|
||
| - https://github.com/WayScience/JUMP-single-cell/blob/main/0.download_data/2.download_image_metadata.ipynb | ||
|
|
||
| Upstream source pattern used by that notebook: | ||
|
|
||
| - `s3://cellpainting-gallery/cpg0000-jump-pilot/source_4/workspace/load_data_csv/2020_11_04_CPJUMP1/*/load_data.csv` | ||
|
|
||
| ### Transform summary | ||
|
|
||
| The generation workflow in `2.download_image_metadata.ipynb`: | ||
|
|
||
| - Lists all per-plate `load_data.csv` files for run `2020_11_04_CPJUMP1` (51 files in the captured run) from public S3 (`anon=True`). | ||
| - Reads each plate CSV, appends provenance columns: | ||
| - `source_plate` (plate ID parsed from path) | ||
| - `source_s3_path` (full S3 CSV path) | ||
| - Concatenates all plate tables into one DataFrame. | ||
| - Reshapes channel URL columns from wide to long using `melt`: | ||
| - URL columns become `Metadata_ChannelURLName` | ||
| - URL values become `Metadata_FileUrl` | ||
| - Adds normalized channel/stain annotations by mapping URL column names: | ||
| - `Metadata_ChannelName`: `ER`, `AGP`, `Mito`, `DNA`, `RNA`, `BF`, `HZ_BF`, `LZ_BF` | ||
| - `Metadata_StainName`: corresponding stain labels (or `NA` for brightfield channels) | ||
| - Derives `Metadata_Filename` from the final path component of `Metadata_FileUrl`. | ||
| - Writes parquet with `index=False` as `data/2020_11_04_CPJUMP1_all_plates.parquet` (captured shape: `(1495400, 32)`). | ||
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.