Skip to content

Commit

Permalink
Merge pull request #20 from agerardin/feat/v0.5
Browse files Browse the repository at this point in the history
Feat/v0.5
  • Loading branch information
Nicholas-Schaub authored Jan 28, 2025
2 parents 3284ce3 + 4de6d55 commit beb8b70
Show file tree
Hide file tree
Showing 62 changed files with 7,867 additions and 0 deletions.
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: [email protected]
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 ([email protected]), Antoine Gerardin ([email protected]), Najib Ishaq ([email protected])",
"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 <[email protected]>",
"Antoine Gerardin <[email protected]>",
"Najib Ishaq <[email protected]>",
]
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

0 comments on commit beb8b70

Please sign in to comment.