Skip to content
Open
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
5 changes: 5 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -168,6 +168,11 @@ cython_debug/
# test data directory
data

# local manifests
src/polus/plugins/_plugins/manifests/*
# allow python scripts insied manifests dir
!src/polus/plugins/_plugins/manifests/*.py
uv.lock

#macOS
*.DS_Store
Expand Down
27 changes: 27 additions & 0 deletions utils/bbbc-download-plugin/.bumpversion.cfg
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
[bumpversion]
current_version = 0.1.1-dev0
commit = True
tag = False
parse = (?P<major>\d+)\.(?P<minor>\d+)\.(?P<patch>\d+)(\-(?P<release>[a-z]+)(?P<dev>\d+))?
serialize =
{major}.{minor}.{patch}-{release}{dev}
{major}.{minor}.{patch}

[bumpversion:part:release]
optional_value = _
first_value = dev
values =
dev
_

[bumpversion:part:dev]

[bumpversion:file:pyproject.toml]
search = version = "{current_version}"
replace = version = "{new_version}"

[bumpversion:file:plugin.json]

[bumpversion:file:VERSION]

[bumpversion:file:src/polus/plugins/utils/bbbc_download/__init__.py]
21 changes: 21 additions & 0 deletions utils/bbbc-download-plugin/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
FROM python:3.13-slim

# environment variables defined in polusai/bfio
ENV EXEC_DIR="/opt/executables"
ENV POLUS_IMG_EXT=".ome.tif"
ENV POLUS_TAB_EXT=".csv"
ENV POLUS_LOG="INFO"

# Work directory defined in the base container
WORKDIR ${EXEC_DIR}

# When building from repo root: -f utils/bbbc-download-plugin/Dockerfile .
COPY utils/bbbc-download-plugin/pyproject.toml ${EXEC_DIR}
COPY utils/bbbc-download-plugin/VERSION ${EXEC_DIR}
COPY utils/bbbc-download-plugin/README.md ${EXEC_DIR}
COPY utils/bbbc-download-plugin/src ${EXEC_DIR}/src

RUN pip3 install ${EXEC_DIR} --no-cache-dir

ENTRYPOINT ["python3", "-m", "polus.plugins.utils.bbbc_download"]
CMD ["--help"]
41 changes: 41 additions & 0 deletions utils/bbbc-download-plugin/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
# BBBC Download (0.1.0-dev1)

This plugin is designed to download the necessary datasets from the Broad Bioimage Benchmark Collection(BBBC) website.

For information on the BBBC dataset, visit
[BBBC dataset information](https://bbbc.broadinstitute.org/image_sets/).
The tables on this webpage classify datasets by their biological application. Each dataset has a webpage that contains links to the data and describes information about the dataset. Almost every dataset has image data and ground truth data. There are a few datasets that have metadata rather than ground truth data.

## Building

To build the Docker image for the download plugin, run
`bash build-docker.sh`.

## Run the Docker image

To execute the built docker image for the download plugin, run
`bash run-plugin.sh`.

## Options

This plugin takes 1 input arguments and
1 output argument:

| Name | Description | I/O | Type |
| --------------- | ------------------------------------------------------------ | ------ | ----------- |
| `--name ` | The name of the datasets to be downloaded | Input | String |
| `--outDir` | Directory to store the downloaded datasets | Output | genericData |

The following are valid names for datasets:
`"All"`- To download all the datasets from the bbbc website
`"IDAndSegmentation"`- To download the datasets from the Identification and segmentation table
`"PhenotypeClassification"`- To download the datasets from the Phenotype classification table
`"ImageBasedProfiling"`- To download the datasets from the Image-based Profiling table

To download specific datasets from the website, give the name of each dataset in the input argument seperated by a comma. example: `--name="BBBC001,BBBC002,BBBC003"`

### NOTE
BBBC046 dataset download is not supported by this plugin.

## Sample docker command:
```docker run -v /home/ec2-user/data/:/home/ec2-user/data/ polusai/bbbc-download-plugin:0.1.0-dev0 --name="BBBC001" --outDir=/home/ec2-user/data/output```
1 change: 1 addition & 0 deletions utils/bbbc-download-plugin/VERSION
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
0.1.1-dev0
4 changes: 4 additions & 0 deletions utils/bbbc-download-plugin/build-docker.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
#!/bin/bash

version=$(<VERSION)
docker build . -t polusai/bbbc-download-plugin:${version}
39 changes: 39 additions & 0 deletions utils/bbbc-download-plugin/plugin.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
{
"name": "BBBC Download",
"version": "0.1.1-dev0",
"title": "BBBC Download",
"description": "Downloads the datasets on the Broad Bioimage Benchmark Collection website",
"author": "Saket Prem(saket.prem@axleinfo.com), Matthew McIntyre(Matthew.McIntyre@axleinfo.com)",
"institution": "National Center for Advancing Translational Sciences, National Institutes of Health",
"repository": "https://github.com/PolusAI/polus-plugins",
"website": "https://ncats.nih.gov/preclinical/core/informatics",
"citation": "",
"containerId": "polusai/bbbc-download-plugin:0.1.1-dev0",
"baseCommand": [
"python3",
"-m",
"polus.plugins.utils.bbbc_download"
],
"inputs": [
{
"name": "name",
"type": "string",
"description": "The name of the datasets to be downloaded(spereate the datasets with a comma. eg: BBBC001,BBBC002,BBBC003 )",
"required": true
}
],
"outputs": [
{
"name": "outDir",
"type": "genericData",
"description": "Output collection"
}
],
"ui": [
{
"key": "inputs.name",
"title": "Input name of datasets as string",
"description": "Input the name of the datasets to be downloaded."
}
]
}
33 changes: 33 additions & 0 deletions utils/bbbc-download-plugin/pyproject.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
[tool.poetry]
name = "polus-plugins-utils-bbbc-download-plugin"
version = "0.1.1-dev0"
description = ""
authors = [
"Saket Prem <saket.prem@axleinfo.com>",
"Matthew McIntyre <Matthew.McIntyre@axleinfo.com>"
]
readme = "README.md"
packages = [{include = "polus", from = "src"}]

[tool.poetry.dependencies]
python = ">=3.12"
typer = ">=0.24.0"
pyarrow = ">=23.0.0"
scikit-image = ">=0.25.0"
bfio = ">=2.5.0"
beautifulsoup4 = ">=4.14.3"
numpy = ">=1.26.0"
pandas = ">=2.2.3"
requests = ">=2.32.5"
pydantic = ">=2.12.5"
bump2version = "1.0.1"
mypy = ">=1.19.1"
tqdm = ">=4.67.0"
pytest = ">=9.0.0"
xmlschema = ">=4.3.1"
lxml = ">=6.0.2"


[build-system]
requires = ["poetry-core"]
build-backend = "poetry.core.masonry.api"
20 changes: 20 additions & 0 deletions utils/bbbc-download-plugin/run-plugin.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
#!/bin/bash

version=$(<VERSION)
datapath=$(readlink --canonicalize data)
mkdir ${datapath}
# Inputs
name="BBBC001"

# # Output paths
outDir=${datapath}

# # Show the help options
# docker run polusai/bbbc-download-plugin:${version}


# # Run the plugin
docker run -v ${datapath}:${datapath} \
polusai/bbbc-download-plugin:${version} \
--name ${name} \
--outDir ${outDir}
Loading