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
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.2.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
55 changes: 55 additions & 0 deletions regression/rt-cetsa-analysis-tool/Dockerfile
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"]
23 changes: 23 additions & 0 deletions regression/rt-cetsa-analysis-tool/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
# RT_CETSA Analysis Tool (v0.2.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 data collection to be processed by this tool | Input | genericData |
| `--filePattern` | File Pattern to parse input files | Input | string |
| `--outDir` | Output file | Output | genericData |
| `--preview` | Generate JSON file with outputs | Output | JSON |
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.2.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}"
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.2.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.2.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.2.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.2.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"
}
]
}
74 changes: 74 additions & 0 deletions regression/rt-cetsa-analysis-tool/pyproject.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,74 @@
[tool.poetry]
name = "polus_tabular_regression_rt_cetsa_analysis"
version = "0.2.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"
# filepattern = "2.0.4"
typer = "^0.7"

[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()`
]
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do the R requirements need to be installed in this specific order or can these six files be consolidated somehow?

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')
44 changes: 44 additions & 0 deletions regression/rt-cetsa-analysis-tool/rt_cetsa_analysis.cwl
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
class: CommandLineTool
cwlVersion: v1.2
baseCommand: ["python3", "-m", "polus.tabular.regression.rt_cetsa_analysis"]
inputs:
inpDir:
inputBinding:
prefix: --inpDir
type: Directory
params:
inputBinding:
prefix: --params
type: string?
values:
inputBinding:
prefix: --values
type: string?
platemap:
inputBinding:
prefix: --platemap
type: File
preview:
inputBinding:
prefix: --preview
type: boolean?
outDir:
inputBinding:
prefix: --outDir
type: Directory
outputs:
outDir:
outputBinding:
glob: $(inputs.outDir.basename)
type: Directory
requirements:
EnvVarRequirement:
envDef:
WORKDIR: /opt/executables/
DockerRequirement:
dockerPull: polusai/rt-cetsa-analysis-tool:0.2.0-dev0
InitialWorkDirRequirement:
listing:
- entry: $(inputs.outDir)
writable: true
InlineJavascriptRequirement: {}
Loading