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

Nyxus fix entrypoint #566

Merged
merged 3 commits into from
Oct 23, 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
8 changes: 6 additions & 2 deletions features/nyxus-tool/.bumpversion.cfg
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
[bumpversion]
current_version = 0.1.8
current_version = 0.1.8-dev0
commit = True
tag = False
parse = (?P<major>\d+)\.(?P<minor>\d+)\.(?P<patch>\d+)(\-(?P<release>[a-z]+)(?P<dev>\d+))?
Expand All @@ -26,4 +26,8 @@ replace = version = "{new_version}"

[bumpversion:file:README.md]

[bumpversion:file:src/polus/images/features/nyxus_plugin/__init__.py]
[bumpversion:file:ict.yaml]

[bumpversion:file:nyxusplugin.cwl]

[bumpversion:file:src/polus/images/features/nyxus_tool/__init__.py]
16 changes: 3 additions & 13 deletions features/nyxus-tool/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,13 +1,3 @@
## Nyxus Plugin(v0.1.5-dev1)
1. This plugin is updated only to the new plugin standards
2. vaex package is included to handle large pandas dataframe and convert to `csv` ouputs by loading dataframe in chunks.
3. Implemented latest updated filepattern package
4. Updated nyxus package
5. Updated preadator package
6. This plugin is now installable with pip.
7. Argparse package is replaced with Typer package for command line arguments.
8. `baseCommand` added in a plugin manifiest.
9. `--preview` flag is added which shows outputs to be generated by this plugin.
10. Use `python -m python -m polus.plugins.features.nyxus_plugin` to run plugin from command line.
11. Replaced `Unittest` with `pytest` package.
12. This plugin now support additional ouput format for example `arrowipc` and `parquet`
## [0.1.8-dev0] - 2024-09-26
- Renamed nyxus-plugin to nyxus-tool.
- updated nyxus package and bfio base-container image.
4 changes: 2 additions & 2 deletions features/nyxus-tool/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM polusai/bfio:2.3.3
FROM polusai/bfio:2.4.3

# environment variables defined in polusai/bfio
ENV EXEC_DIR="/opt/executables"
Expand All @@ -21,5 +21,5 @@ RUN pip3 install "${EXEC_DIR}/image-tools/${TOOL_DIR}" --no-cache-dir

# Set the entrypoint
# TODO: Change the entrypoint to the tool entrypoint
ENTRYPOINT ["python3", "-m", "polus.images.features.nyxus"]
ENTRYPOINT ["python3", "-m", "polus.images.features.nyxus_tool"]
CMD ["--help"]
2 changes: 1 addition & 1 deletion features/nyxus-tool/README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Nyxus-Plugin(v0.1.8)
# Nyxus-Plugin(v0.1.8-dev0)


Nyxus plugin uses parallel processing of [Nyxus python package](https://pypi.org/project/nyxus/) to extract nyxus features from intensity-label image data. Especially useful when processing high throughput screens.
Expand Down
2 changes: 1 addition & 1 deletion features/nyxus-tool/VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
0.1.8
0.1.8-dev0
223 changes: 112 additions & 111 deletions features/nyxus-tool/ict.yaml
Original file line number Diff line number Diff line change
@@ -1,120 +1,121 @@
author:
- Nick Schaub
- Hamdah Shafqat
- Nick Schaub
- Hamdah Shafqat
contact: [email protected]
container: polusai/nyxus-tool:0.1.7-dev0
description: Nyxus plugin allows to make use of parallel pocessing for extracting
container: polusai/nyxus-tool:0.1.8-dev0
description:
Nyxus plugin allows to make use of parallel pocessing for extracting
nyxus features
entrypoint: python3 -m polus.images.features.nyxus_plugin
entrypoint: python3 -m polus.images.features.nyxus_tool
inputs:
- description: Collection containing intensity images
format:
- collection
name: inpDir
required: true
type: path
- description: Collection containing label images, i.e. groundtruth images
format:
- collection
name: segDir
required: true
type: path
- description: Filepattern to parse intensity images
format:
- string
name: intPattern
required: true
type: string
- description: Filepattern to parse label images
format:
- string
name: segPattern
required: true
type: string
- description: Features or feature groups to be extracted by nyxus plugin
format:
- array
name: features
required: false
type: array
- description: Output file format
format:
- enum
name: fileExtension
required: true
type: string
- description: Pixel distance between neighboring cells
format:
- number
name: neighborDist
required: false
type: number
- description: Pixel size in micrometer
format:
- number
name: pixelPerMicron
required: false
type: number
- description: Consider intensity image as single roi and ignoring segmentation mask
format:
- boolean
name: singleRoi
required: false
type: boolean
- description: Collection containing intensity images
format:
- collection
name: inpDir
required: true
type: path
- description: Collection containing label images, i.e. groundtruth images
format:
- collection
name: segDir
required: true
type: path
- description: Filepattern to parse intensity images
format:
- string
name: intPattern
required: true
type: string
- description: Filepattern to parse label images
format:
- string
name: segPattern
required: true
type: string
- description: Features or feature groups to be extracted by nyxus plugin
format:
- array
name: features
required: false
type: array
- description: Output file format
format:
- enum
name: fileExtension
required: true
type: string
- description: Pixel distance between neighboring cells
format:
- number
name: neighborDist
required: false
type: number
- description: Pixel size in micrometer
format:
- number
name: pixelPerMicron
required: false
type: number
- description: Consider intensity image as single roi and ignoring segmentation mask
format:
- boolean
name: singleRoi
required: false
type: boolean
name: polusai/Nyxusplugin
outputs:
- description: Output collection
format:
- collection
name: outDir
required: true
type: path
repository: https://github.com/PolusAI/polus-plugins
- description: Output collection
format:
- collection
name: outDir
required: true
type: path
repository: https://github.com/PolusAI/image-tools
specVersion: 1.0.0
title: Nyxus plugin
ui:
- description: Input image collection
key: inputs.inpDir
title: inpDir
type: path
- description: Label image collection
key: inputs.segDir
title: segDir
type: path
- description: Filepattern to parse intensity images
key: inputs.intPattern
title: intPattern
type: text
- description: Filepattern to parse label images
key: inputs.segPattern
title: segPattern
type: text
- description: Features or feature groups to be extracted by nyxus plugin
key: inputs.features
title: features
type: text
- description: Ouput file format
fields:
- .arrow
- .feather
- .csv
- default
key: inputs.fileExtension
title: fileExtension
type: select
- default: 5
description: Pixel distance between neighboring cells
key: inputs.neighborDist
title: neighborDist
type: number
- default: 1.0
description: Pixel size in micrometer
key: inputs.pixelPerMicron
title: pixelPerMicron
type: number
- default: false
description: Consider intensity image as single roi and ignoring segmentation mask
key: inputs.singleRoi
title: singleRoi
type: checkbox
version: 0.1.7-dev0
- description: Input image collection
key: inputs.inpDir
title: inpDir
type: path
- description: Label image collection
key: inputs.segDir
title: segDir
type: path
- description: Filepattern to parse intensity images
key: inputs.intPattern
title: intPattern
type: text
- description: Filepattern to parse label images
key: inputs.segPattern
title: segPattern
type: text
- description: Features or feature groups to be extracted by nyxus plugin
key: inputs.features
title: features
type: text
- description: Ouput file format
fields:
- .arrow
- .feather
- .csv
- default
key: inputs.fileExtension
title: fileExtension
type: select
- default: 5
description: Pixel distance between neighboring cells
key: inputs.neighborDist
title: neighborDist
type: number
- default: 1.0
description: Pixel size in micrometer
key: inputs.pixelPerMicron
title: pixelPerMicron
type: number
- default: false
description: Consider intensity image as single roi and ignoring segmentation mask
key: inputs.singleRoi
title: singleRoi
type: checkbox
version: 0.1.8-dev0
2 changes: 1 addition & 1 deletion features/nyxus-tool/nyxusplugin.cwl
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ outputs:
type: Directory
requirements:
DockerRequirement:
dockerPull: polusai/nyxus-tool:0.1.7-dev0
dockerPull: polusai/nyxus-tool:0.1.8-dev0
InitialWorkDirRequirement:
listing:
- entry: $(inputs.outDir)
Expand Down
2 changes: 1 addition & 1 deletion features/nyxus-tool/package-release.sh
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ bump2version --config-file bumpversion.cfg --new-version ${version} --allow-dirt
./build-docker.sh

# Push to dockerhub
docker push polusai/nyxus-plugin:${version}
docker push polusai/nyxus-tool:${version}

# Run unittests
python -m unittest
8 changes: 4 additions & 4 deletions features/nyxus-tool/plugin.json
Original file line number Diff line number Diff line change
@@ -1,18 +1,18 @@
{
"name": "Nyxus plugin",
"version": "0.1.8",
"containerId": "polusai/nyxus-tool:0.1.8",
"version": "0.1.8-dev0",
"containerId": "polusai/nyxus-tool:0.1.8-dev0",
"title": "Nyxus plugin",
"description": "Nyxus plugin allows to make use of parallel pocessing for extracting nyxus features",
"author": "Nick Schaub ([email protected]), Hamdah Shafqat Abbasi ([email protected])",
"institution": "National Center for Advancing Translational Sciences, National Institutes of Health",
"repository": "https://github.com/PolusAI/polus-plugins",
"repository": "https://github.com/PolusAI/image-tools",
"website": "https://ncats.nih.gov/preclinical/core/informatics",
"citation": "",
"baseCommand": [
"python3",
"-m",
"polus.images.features.nyxus_plugin"
"polus.images.features.nyxus_tool"
],
"inputs": [
{
Expand Down
11 changes: 5 additions & 6 deletions features/nyxus-tool/pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[tool.poetry]
name = "polus-images-features-nyxus-plugin"
version = "0.1.8"
name = "polus-images-features-nyxus-tool"
version = "0.1.8-dev0"
description = ""
authors = [
"Nick Schaub <[email protected]>",
Expand All @@ -14,14 +14,13 @@ python = ">=3.9,<3.12"
filepattern = "2.0.4"
typer = "^0.7.0"
tqdm = "^4.66.1"
nyxus = "^0.7.3"
fastapi = "^0.92.0"
astropy = "5.2.1"
nyxus = "^0.8.2"
vaex = "^4.17.0"
preadator = "0.4.0.dev2"
pytest-sugar = "^0.9.7"
pytest-xdist = "^3.5.0"
pyarrow = ">=16.0,<17.0"
numpy = "<2.0.0"

[tool.poetry.group.dev.dependencies]
bump2version = "^1.0.1"
Expand All @@ -32,7 +31,7 @@ mypy = "^1.0.0"
pytest = "^7.2.1"
ipykernel = "^6.21.2"
requests = "^2.28.2"
scikit-image = "^0.20.0"
scikit-image = "0.24.0"

[build-system]
requires = ["poetry-core"]
Expand Down
2 changes: 1 addition & 1 deletion features/nyxus-tool/run-plugin.sh
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ out_dir=/data/path_to_output
# docker run polusai/nyxus-plugin:${version}

docker run --mount type=bind,source=${datapath},target=/data/ \
polusai/nyxus-plugin:${version} \
polusai/nyxus-tool:${version} \
--inpDir ${inp_dir} \
--segDir ${seg_dir} \
--outDir ${out_dir} \
Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
"""Nyxus Plugin."""
__version__ = "0.1.8-dev0"
Loading
Loading