Skip to content

Commit 3dd58bd

Browse files
authored
Merge pull request #187 from HelikarLab/purge_r
Purge R code
2 parents b144598 + f808a55 commit 3dd58bd

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

59 files changed

+190657
-187395
lines changed

.dockerignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,3 +5,4 @@ main/src/tests
55
**/.ipynb_checkpoints/
66
README.md
77
LICENSE
8+
/.venv
Lines changed: 84 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,84 @@
1+
name: Continuous Integration
2+
on:
3+
push:
4+
branches:
5+
- main
6+
pull_request:
7+
workflow_dispatch:
8+
9+
jobs:
10+
format:
11+
runs-on: ubuntu-latest
12+
steps:
13+
- name: Checkout
14+
uses: actions/checkout@v4
15+
16+
- name: Install uv
17+
uses: astral-sh/setup-uv@v3
18+
19+
- name: Create Virtual Environment
20+
run: uv venv
21+
22+
- name: Install Jupyter
23+
run: uv pip install jupyter nbconvert
24+
25+
- name: Strip Notebook Output
26+
run: uv run jupyter nbconvert --clear-output --inplace "main/COMO.ipynb"
27+
28+
- name: Format Python Imports
29+
uses: astral-sh/ruff-action@v1
30+
with:
31+
args: "check --fix --select I"
32+
33+
- name: Format code
34+
uses: astral-sh/ruff-action@v1
35+
with:
36+
args: "format"
37+
38+
- name: Format Notebook
39+
uses: astral-sh/ruff-action@v1
40+
with:
41+
args: "format main/COMO.ipynb"
42+
43+
- name: Commit Changes
44+
uses: stefanzweifel/git-auto-commit-action@v5
45+
with:
46+
commit_message: "style: format code, Jupyter Notebook(s), and Python imports with `ruff`"
47+
file_pattern: "main/como/*.py"
48+
49+
50+
lint:
51+
runs-on: ubuntu-latest
52+
steps:
53+
- name: Checkout
54+
uses: actions/checkout@v4
55+
56+
- name: Check Lint
57+
uses: astral-sh/ruff-action@v1
58+
with:
59+
args: "check --no-fix --verbose"
60+
61+
test:
62+
runs-on: ubuntu-latest
63+
strategy:
64+
matrix:
65+
python-version: [ "3.10" ]
66+
steps:
67+
- name: Checkout
68+
uses: actions/checkout@v4
69+
70+
- name: Install uv
71+
uses: astral-sh/setup-uv@v4
72+
with:
73+
enable-cache: "true"
74+
cache-suffix: "${{ matrix.python-version }}"
75+
cache-dependency-glob: 'uv.lock'
76+
77+
- name: Install Dependencies
78+
run: uv sync --python "${{ matrix.python-version }}" --all-extras --dev
79+
80+
- name: Run tests
81+
run: uv run --python "${{ matrix.python-version }}" pytest --cov --junitxml=junit.xml -o junit_family=legacy
82+
83+
- name: Cache Clear
84+
run: uv cache prune --ci

.github/workflows/unit_tests.yml

Lines changed: 0 additions & 40 deletions
This file was deleted.

.gitignore

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -12,14 +12,13 @@ docs/_site
1212
docs/Gemfile.lock
1313

1414
# COMO-specific files
15+
.hypothesis
1516
**/*.Rout
1617
main/logs/
17-
main/data/results/
18-
main/data/config_sheets/*_data_inputs_auto.xlsx
1918
main/data/gene_info.csv
2019
main/data/Repurposing_Hub_Preproc.tsv
21-
main/microarray.db
22-
main/data/config_sheets/*
23-
main/data/GSE*_RAW
24-
main/data/gpl*entrez.csv
25-
main/src/microarray.db
20+
main/data/results/
21+
main/data/config_sheets
22+
23+
# COMO data
24+
main/data/data_matrices

.pre-commit-config.yaml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
# See https://pre-commit.com for more information
2+
# See https://pre-commit.com/hooks.html for more hooks
3+
repos:
4+
- repo: https://github.com/opensource-nepal/commitlint
5+
rev: v1.2.0
6+
hooks:
7+
- id: commitlint
8+
name: Commit Lint

Dockerfile

Lines changed: 9 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -1,27 +1,12 @@
1-
FROM jupyter/r-notebook:latest as builder
1+
FROM python:3.10 AS app
22

3-
COPY environment.yaml "${HOME}/environment.yaml"
4-
COPY --chown=1000:100 main "${HOME}/main"
5-
6-
# Install python-related items
7-
# Remove "python" from the pinned file so we can install our own version
8-
RUN sed -i '/^python/d' /opt/conda/conda-meta/pinned && \
9-
echo "auto_activate_base: true" >> "${HOME}/.condarc" && \
10-
jupyter trust "${HOME}/main/COMO.ipynb" && \
11-
echo "c.ServerApp.ip = '0.0.0.0'" >> "${HOME}/.jupyter/jupyter_notebook_config.py" && \
12-
echo "c.ServerApp.root_dir = '${HOME}/main'" >> "${HOME}/.jupyter/jupyter_notebook_config.py" && \
13-
echo "c.ServerApp.token = ''" >> "${HOME}/.jupyter/jupyter_notebook_config.py" && \
14-
echo "c.ServerApp.password = ''" >> "${HOME}/.jupyter/jupyter_notebook_config.py" && \
15-
mamba config --quiet --add channels conda-forge && \
16-
mamba config --quiet --add channels bioconda && \
17-
mamba config --quiet --add channels r && \
18-
rm -rf "${HOME}/main/tests" # Tests not required for running COMO
19-
20-
# Update base environment
21-
RUN mamba env update --name=base --file="${HOME}/environment.yaml" && \
22-
R -e "devtools::install_github('babessell1/zFPKM')" && \
23-
pip cache purge && \
24-
mamba clean --all --yes
3+
WORKDIR /app
4+
ENV PATH="/app/.venv/bin:$PATH"
5+
COPY --from=ghcr.io/astral-sh/uv:latest /uv /uvx /bin/
6+
COPY --chown=1000:100 main /app/main/
7+
COPY --chown=1000:100 pyproject.toml /app/pyproject.toml
258

9+
RUN uv sync && uv pip install jupyterlab
2610
EXPOSE 8888
27-
VOLUME /home/joyvan/main/data/local_files
11+
VOLUME "/app/main/data/local_files"
12+
CMD ["jupyter", "lab", "--allow-root", "--no-browser", "--ip=0.0.0.0", "--port=8888", "--notebook-dir=/app/main", "--NotebookApp.token=''", "--NotebookApp.password=''"]

README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,8 @@
33
![GitHub release (with filter)](https://img.shields.io/github/v/release/HelikarLab/COMO?filter=v*-master&style=for-the-badge&color=blue)
44
![GitHub Workflow Status (with event)](https://img.shields.io/github/actions/workflow/status/HelikarLab/COMO/unit_tests.yml?style=for-the-badge&logo=pytest&logoColor=white&label=Tests)
55
![GitHub Workflow Status (with event)](https://img.shields.io/github/actions/workflow/status/HelikarLab/COMO/container_build.yml?style=for-the-badge&logo=docker&logoColor=white&label=Docker%20Build)
6+
[![pre-commit](https://img.shields.io/badge/pre--commit-enabled-brightgreen?logo=pre-commit)](https://github.com/pre-commit/pre-commit)
7+
68

79
# Setting up COMO
810

docker-compose.yml

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
services:
2+
como:
3+
image: ghcr.io/helikarlab/como:latest
4+
container_name: como
5+
ports:
6+
- "8888:8888"
7+
volumes:
8+
# Map "[LOCAL_DIRECTORY]/local_files to /app/main/data/local_files
9+
- "$(pwd)/local_files:/app/main/data/local_files"

0 commit comments

Comments
 (0)