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

Feat/v0.5 #20

Merged
merged 40 commits into from
Jan 28, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
40 commits
Select commit Hold shift + click to select a range
f2b73f0
feat: added tool
nishaq503 May 6, 2024
3d900ad
chore: added ict.yml file
nishaq503 May 6, 2024
069e05d
fix: moltenprot tool.
agerardin May 13, 2024
e536e88
feat: containerized and cwl-able
agerardin May 14, 2024
b193a60
feat: add rt_cetsa analysis.
agerardin May 14, 2024
2008d7a
feat: rt_Cetsa analysis tool, containerized.
agerardin May 14, 2024
bfaaab8
feat: update for running tools in rt_cetsa dashboard.
agerardin May 21, 2024
ca622cb
feat: update analysis tool before PR.
agerardin May 21, 2024
de86e0d
chore: refactor moltenprot
agerardin May 21, 2024
2c89f43
feat: review api. Removed filepattern.
agerardin May 21, 2024
aaea32b
Bump version: 0.1.0 → 0.2.0-dev0
agerardin May 21, 2024
4597165
fix: add version in __init__.py
agerardin May 21, 2024
010ec80
Bump version: 0.1.0 → 0.2.0-dev0
agerardin May 21, 2024
fa821f2
chore: refactor code for dashboard integration.
agerardin May 22, 2024
50c21d8
dev: add tests to satisfy git actions
agerardin May 22, 2024
b88128c
fix: values and params and not required.
agerardin May 22, 2024
acd386a
fix: values and params and not required.
agerardin May 22, 2024
b24ac0b
fix cwl.
agerardin May 22, 2024
723342a
feat: added plugin that process metadata files.
agerardin Jun 3, 2024
dde6897
Bump version: 0.2.0-dev0 → 0.3.0-dev0
agerardin Jun 3, 2024
2c0f4ce
feat: rt-cetsa-metadata - add temperature to filename.
agerardin Jun 4, 2024
7a8adf2
feat: add cli options for moltenprot params
agerardin Jun 4, 2024
4407a87
Bump version: 0.2.0-dev0 → 0.3.0-dev0
agerardin Jun 4, 2024
1f4acdc
feat: add platemap preprocessing to accomodate new dataset.
agerardin Jun 4, 2024
eabdb23
Bump version: 0.2.0-dev0 → 0.3.0-dev0
agerardin Jun 4, 2024
2c653d7
feat: port R preprocessing to python.
agerardin Jun 5, 2024
779c989
chore: remove R preprocessing code ported to python.
agerardin Jun 5, 2024
35e287b
dev: add edge cases and tests.
agerardin Jul 12, 2024
0cc85b3
Bump version: 0.3.0-dev0 → 0.4.0-dev0
agerardin Jul 12, 2024
a1c8d11
dev: add automatic numerical sort for image names as integer
agerardin Jul 12, 2024
b64dd1e
chore: remove local path from test.
agerardin Jul 16, 2024
f4fe551
Bump version: 0.3.0-dev0 → 0.4.0-dev0
agerardin Jul 16, 2024
ecd6ab3
Bump version: 0.3.0-dev0 → 0.4.0-dev0
agerardin Jul 16, 2024
0b3b33c
Bump version: 0.4.0-dev0 → 0.5.0-dev0
agerardin Jan 28, 2025
39e130f
fix: test and readme to pass gitactions.
agerardin Jan 28, 2025
ee8e936
fix: hooks.
agerardin Jan 28, 2025
9512826
Bump version: 0.4.0-dev0 → 0.5.0-dev0
agerardin Jan 28, 2025
abe9410
fix: update readme
agerardin Jan 28, 2025
d87f15d
fix: dockerfile.
agerardin Jan 28, 2025
4de6d55
Bump version: 0.4.0-dev0 → 0.5.0-dev0
agerardin Jan 28, 2025
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
33 changes: 33 additions & 0 deletions regression/rt-cetsa-analysis-tool/.bumpversion.cfg
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
[bumpversion]
current_version = 0.5.0-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:VERSION]

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

[bumpversion:file:README.md]

[bumpversion:file:src/polus/tabular/regression/rt_cetsa_analysis/__init__.py]

[bumpversion:file:plugin.json]

[bumpversion:file:ict.yml]

[bumpversion:file:rt_cetsa_analysis.cwl]
1 change: 1 addition & 0 deletions regression/rt-cetsa-analysis-tool/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
tests/out
14 changes: 14 additions & 0 deletions regression/rt-cetsa-analysis-tool/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
FROM polusai/bfio:2.1.9

# environment variables defined in polusai/bfio
ENV EXEC_DIR="/opt/executables"
ENV POLUS_LOG="INFO"

COPY env-linux.yml ${EXEC_DIR}/env-linux.yml
# Work directory defined in the base container
WORKDIR ${EXEC_DIR}

RUN apt-get update && apt-get install -y wget
RUN mkdir -p miniconda3 && wget https://repo.anaconda.com/miniconda/Miniconda3-latest-Linux-x86_64.sh -O miniconda3/miniconda.sh && \
bash miniconda3/miniconda.sh -b -u -p miniconda3 && rm miniconda3/miniconda.sh
RUN /opt/executables/miniconda3/bin/conda env update -f env-linux.yml
55 changes: 55 additions & 0 deletions regression/rt-cetsa-analysis-tool/Dockerfile-original
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
FROM r-base:4.4.0


ARG EXEC_DIR="/opt/executables"

RUN apt-get update && apt-get install -y python3

#Create folders
RUN mkdir -p ${EXEC_DIR}

# Install R packages external dependencies
RUN apt-get install -y libssl-dev \
&& apt-get install -y libcurl4-openssl-dev libfontconfig1-dev \
&& apt-get install -y libharfbuzz-dev libfribidi-dev \
&& apt-get install -y libxml2-dev \
&& apt-get install -y libfreetype6-dev libpng-dev libtiff5-dev libjpeg-dev \
&& apt-get install -y cmake

# Install required R packages
ADD requirements/Requirements_1.R ${EXEC_DIR}/Requirements_1.R
RUN Rscript ${EXEC_DIR}/Requirements_1.R

ADD requirements/Requirements_2.R ${EXEC_DIR}/Requirements_2.R
RUN Rscript ${EXEC_DIR}/Requirements_2.R

ADD requirements/Requirements_3.R ${EXEC_DIR}/Requirements_3.R
RUN Rscript ${EXEC_DIR}/Requirements_3.R

RUN apt-get install -y --allow-downgrades libxcb-render0=1.15-1 libxcb-shm0=1.15-1 libxcb1=1.15-1
RUN apt-get install -y libcairo2-dev

ADD requirements/Requirements_4.R ${EXEC_DIR}/Requirements_4.R
RUN Rscript ${EXEC_DIR}/Requirements_4.R

RUN apt-get install -y libgit2-dev

ADD requirements/Requirements_6.R ${EXEC_DIR}/Requirements_6.R
RUN Rscript ${EXEC_DIR}/Requirements_6.R

ADD requirements/Requirements_5.R ${EXEC_DIR}/Requirements_5.R
RUN Rscript ${EXEC_DIR}/Requirements_5.R

COPY pyproject.toml ${EXEC_DIR}
COPY README.md ${EXEC_DIR}
RUN apt-get update && apt-get install -y python3
RUN apt-get -y install python3-pip python3-venv
COPY src/ ${EXEC_DIR}/src
RUN pip3 install ${EXEC_DIR} --no-cache-dir --break-system-packages

WORKDIR ${EXEC_DIR}

# CMD ["Rscript", "main.R"]
CMD ["python3", "-m", "polus.tabular.regression.rt_cetsa_analysis"]
# CMD ["--help"]
# CMD ["bash"]
31 changes: 31 additions & 0 deletions regression/rt-cetsa-analysis-tool/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
# RT_CETSA Analysis Tool (v0.5.0-dev0)

This WIPP plugin runs statistical analysis for the RT-CETSA pipeline.

## Building

To build the Docker image for the conversion plugin, run
`./build-docker.sh`.

## Install WIPP Plugin

If WIPP is running, navigate to the plugins page and add a new plugin. Paste the contents of `plugin.json` into the pop-up window and submit.

## Options

This plugin takes eight input argument and one output argument:

| Name | Description | I/O | Type |
|-----------------|----------------------------------------------------|--------|-------------|
| `--inpDir` | Input directory containing the all data files | Input | genericData |
| `--params` | name of the moltenprot fit params csv file in the input directory | Input | string |
| `--values` | name of the moltenprot baseline corrected values csv file in the input directory
| `--platemap` | Path to the platemap file | Input | genericData |
| `--outDir` | Output file | Output | genericData |
| `--preview` | Generate JSON file with outputs | Output | JSON |

## Build options

By default `./build-docker` will build the image using `Dockerfile`, which install R with conda.
In regression are noticed, this file can be swapped with `Dockerfile-original` which is the original version
of the dockerfile that is using apt to install all dependencies and is known to work correctly.
1 change: 1 addition & 0 deletions regression/rt-cetsa-analysis-tool/VERSION
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
0.5.0-dev0
4 changes: 4 additions & 0 deletions regression/rt-cetsa-analysis-tool/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/rt-cetsa-analysis-tool:"${version}"
17 changes: 17 additions & 0 deletions regression/rt-cetsa-analysis-tool/env-linux.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
name: base
channels:
- conda-forge
- defaults
dependencies:
- r-base
- r-tidyverse
- r-drc
- r-stringr
- r-readxl
- r-stringr
- r-ggthemes
- r-cowplot
- r-hrbrthemes
- r-ggpubr
- r-MESS
- r-devtools
62 changes: 62 additions & 0 deletions regression/rt-cetsa-analysis-tool/ict.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
author:
- Nick Schaub
- Antoine Gerardin
- Najib Ishaq
contact: nick.schaub@nih.gov
container: polusai/rt-cetsa-analysis-simple-tool:0.5.0-dev0
description: Run statisical analysis for the RT-CETSA pipeline.
entrypoint: python3 -m polus.tabular.regression.rt_cetsa_analysis
inputs:
- description: Fit params csv file
format:
- params
name: params
required: false
type: string
- description: Baseline corrected csv files
format:
- values
name: values
required: false
type: string
- description: platemap excel file
format:
- platemap
name: platemap
required: true
type: path
- description: Generate an output preview.
format:
- preview
name: preview
required: false
type: boolean
name: polusai/RTCETSAAnalysis
outputs:
- description: Output collection
format:
- outDir
name: outDir
required: true
type: path
repository: https://github.com/PolusAI/tabular-tools
specVersion: 1.0.0
title: RT-CETSA Analysis
ui:
- description: Fit params csv file
key: inputs.params
title: Fit params csv file
type: string
- description: baseline corrected csv file
key: inputs.values
title: baseline corrected csv file
type: string
- description: platemap excel file
key: inputs.platemap
title: platemap excel file
type: path
- description: Generate an output preview.
key: inputs.preview
title: Preview example output of this plugin
type: checkbox
version: 0.5.0-dev0
64 changes: 64 additions & 0 deletions regression/rt-cetsa-analysis-tool/plugin.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
{
"name": "RT-CETSA Analysis",
"version": "0.5.0-dev0",
"title": "RT-CETSA Analysis",
"description": "Run statistical analysis for the RT-CETSA pipeline.",
"author": "Nicholas Schaub (nick.schaub@nih.gov), Antoine Gerardin (antoine.gerardin@nih.gov), Najib Ishaq (najib.ishaq@nih.gov)",
"institution": "National Center for Advancing Translational Sciences, National Institutes of Health",
"repository": "https://github.com/PolusAI/tabular-tools",
"website": "https://ncats.nih.gov/preclinical/core/informatics",
"citation": "",
"containerId": "polusai/rt-cetsa-analysis-simple-tool:0.5.0-dev0",
"baseCommand": [
"python3",
"-m",
"polus.tabular.regression.rt_cetsa_analysis"
],
"inputs": [
{
"name": "params",
"type": "genericData",
"description": "Fit params csv file"
},
{
"name": "values",
"type": "genericData",
"description": "Baseline corrected csv files"
},
{
"name": "platemap",
"type": "genericData",
"description": "platemap excel file",
"required": true
}
],
"outputs": [
{
"name": "outDir",
"type": "genericData",
"description": "Output data collection"
}
],
"ui": [
{
"key": "inputs.inpDir",
"title": "Input collection",
"description": "Input data collection to be processed by this plugin"
},
{
"key": "inputs.params",
"title": "Params",
"description": "Params"
},
{
"key": "inputs.values",
"title": "Values",
"description": "Values"
},
{
"key": "inputs.platemap",
"title": "Plate Map",
"description": "Plate Map"
}
]
}
76 changes: 76 additions & 0 deletions regression/rt-cetsa-analysis-tool/pyproject.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,76 @@
[tool.poetry]
name = "polus_tabular_regression_rt_cetsa_analysis"
version = "0.5.0-dev0"
description = "Run statiscal analysis for the RT-CETSA pipeline."
authors = [
"Nick Schaub <nick.schaub@nih.gov>",
"Antoine Gerardin <antoine.gerardin@nih.gov>",
"Najib Ishaq <najib.ishaq@nih.gov>",
]
readme = "README.md"
packages = [{include = "polus", from = "src"}]

[tool.poetry.dependencies]
python = ">=3.9,<3.12"
typer = "^0.7"
openpyxl = "^3.1.3"
pandas = "^2.2.2"
numpy = "^1.26.4"

[tool.poetry.group.dev.dependencies]
bump2version = "^1.0.1"
pre-commit = "^3.1.0"
pytest = "^7.2.1"

[build-system]
requires = ["poetry-core"]
build-backend = "poetry.core.masonry.api"

[tool.ruff]
extend = "../../ruff.toml"
extend-ignore = [
"RET505", # Unnecessary `else` after `return` statement
"E501", # Line too long
"ANN001", # Missing type annotation
"D102", # Missing docstring in public method
"ANN201", # Missing return type annotation
"N806", # Variable in function should be lowercase
"D205", # 1 blank line required between summary line and description
"N803", # Argument name should be lowercase
"PLR0913", # Too many arguments
"D415", # First line should end with a period, question mark, or exclamation point
"PLR2004", # Magic value used in comparison
"B006", # Do not use mutable default arguments
"D107", # Missing docstring
"D101", # Missing docstring
"E731", # Do not assign a lambda expression, use a def
"E402", # Module level import not at top of file
"PTH123", # `open()` should be replaced with `Path.open()`
"PTH118", # `os.path.join()` should be replaced with `/` operator
"PTH100", # `os.path.abspath()` should be replaced with `Path.resolve()`
"PLR0915", # Too many statements
"PLR0912", # Too many branches
"C901", # Function is too complex
"T201", # `print` used
"E722", # Do not use bare 'except'
"B904", # Within an `except` clause, raise exceptions with `raise ... from err` or `raise ... from None` to distinguish them from errors in exception handling
"ANN202", # Missing return type annotation for private function
"ARG002", # Unused method argument
"N802", # Function name should be lowercase
"PTH103", # `os.makedirs()` should be replaced with `Path.mkdir(parents=True)`
"ANN003", # Missing type annotation for `**kwargs`
"B007", # Loop control variable not used within the loop body
"ANN204", # Missing return type annotation for magic method
"D417", # Missing argument descriptions in the docstring
"ANN205", # Missing return type annotation for static method
"PLR5501", # Use `elif` instead of `else` following `if` condition to avoid unnecessary indentation
"EM102", # Exception must not use an f-string literal
"D414", # Section has no content
"RUF012", # Mutable class attributes should be annotated with `typing.ClassVar`
"A001", # Variable `input` is shadowing a Python builtin
"A002", # Argument `input` is shadowing a Python builtin
"E741", # Ambiguous variable name: `l`
"PTH120", # `os.path.dirname()` should be replaced by `Path.parent`
"N816", # Variable `cfFilename` in global scope should not be mixedCase
"PTH109", # `os.getcwd()` should be replaced by `Path.cwd()`
]
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
install.packages('argparse')
install.packages('logging')
install.packages('tidyverse')
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
install.packages('drc')
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
install.packages('readxl')
install.packages('stringr')
install.packages('ggthemes')
install.packages('cowplot')
install.packages('ggpubr')
install.packages('MESS')
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
install.packages('hrbrthemes')
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
install.packages('devtools')
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
install.packages('gert')
Loading
Loading