Skip to content

Commit e29541c

Browse files
committed
Merge branch 'experimental' into dev
2 parents e9598ff + 715eeac commit e29541c

File tree

91 files changed

+14247
-724
lines changed

Some content is hidden

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

91 files changed

+14247
-724
lines changed

.gitattributes

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,3 @@
11
# GitHub syntax highlighting
22
pixi.lock linguist-language=YAML
3+
llms.txt linguist-language=markdown linguist-detectable=true

.github/workflows/test.yml

Lines changed: 110 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,110 @@
1+
name: CI Tests
2+
3+
on:
4+
push:
5+
branches: [main, dev, experimental]
6+
pull_request:
7+
branches: [main, dev]
8+
workflow_dispatch:
9+
10+
jobs:
11+
python-tests:
12+
runs-on: ubuntu-latest
13+
strategy:
14+
matrix:
15+
python-version: ['3.10', '3.11', '3.12', '3.13']
16+
17+
steps:
18+
- name: Checkout repository
19+
uses: actions/checkout@v4
20+
21+
- name: Set up Python
22+
uses: actions/setup-python@v5
23+
with:
24+
python-version: ${{ matrix.python-version }}
25+
26+
- name: Install UV
27+
uses: astral-sh/setup-uv@v4
28+
with:
29+
enable-cache: true
30+
cache-dependency-glob: "pyproject.toml"
31+
32+
- name: Install dependencies with UV
33+
run: |
34+
uv sync --dev --frozen
35+
36+
- name: Run Python tests with pytest
37+
run: |
38+
uv run pytest bin/ -v --cov=bin --cov-report=xml --cov-report=term-missing
39+
40+
- name: Upload coverage reports
41+
uses: codecov/codecov-action@v4
42+
with:
43+
files: ./coverage.xml
44+
flags: python-${{ matrix.python-version }}
45+
name: Python ${{ matrix.python-version }}
46+
if: matrix.python-version == '3.12'
47+
48+
python-tests-tox:
49+
runs-on: ubuntu-latest
50+
51+
steps:
52+
- name: Checkout repository
53+
uses: actions/checkout@v4
54+
55+
- name: Set up Python
56+
uses: actions/setup-python@v5
57+
with:
58+
python-version: '3.12'
59+
60+
- name: Install UV
61+
uses: astral-sh/setup-uv@v4
62+
with:
63+
enable-cache: true
64+
cache-dependency-glob: "pyproject.toml"
65+
66+
- name: Install and run tox
67+
run: |
68+
uvx --from tox-uv tox -p auto
69+
70+
- name: Run linting with tox
71+
run: |
72+
uvx --from tox-uv tox -e lint
73+
74+
nextflow-tests:
75+
runs-on: ubuntu-latest
76+
strategy:
77+
matrix:
78+
nextflow_version: ['23.10.0', 'latest']
79+
80+
steps:
81+
- name: Checkout repository
82+
uses: actions/checkout@v4
83+
84+
- name: Set up Nextflow
85+
uses: nf-core/setup-nextflow@v2
86+
with:
87+
version: ${{ matrix.nextflow_version }}
88+
89+
- name: Set up nf-test
90+
uses: nf-core/setup-nf-test@v1
91+
92+
- name: Run nf-test
93+
run: |
94+
nf-test test --verbose --profile test,docker
95+
96+
- name: Upload test results
97+
if: always()
98+
uses: actions/upload-artifact@v4
99+
with:
100+
name: nf-test-results-${{ matrix.nextflow_version }}
101+
path: |
102+
.nf-test/
103+
tests/output/
104+
105+
- name: Clean up
106+
if: always()
107+
run: |
108+
rm -rf work/
109+
rm -rf .nextflow/
110+
rm -rf .nf-test/

.gitignore

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,9 @@
1919
!.gitattributes
2020
!main.nf
2121
!nextflow.config
22+
!nf-test.config
2223
!CLAUDE.md
24+
!llms.txt
2325

2426
# github action workflows
2527
!/.github
@@ -47,6 +49,8 @@
4749
# bin of executable scripts
4850
!/bin/
4951
!/bin/*.py
52+
!/bin/*.rs
53+
!/bin/*.ers
5054
!/bin/*.ts
5155
!/bin/*.js
5256
!/bin/*.R
@@ -55,6 +59,7 @@
5559
!/bin/*.lua
5660
!/bin/*.sh
5761
!/bin/*.awk
62+
!/bin/README.md
5863

5964
# groovy libraries
6065
!/lib
@@ -66,3 +71,26 @@
6671
!/docs/*.md
6772
!/docs/*.pdf
6873
!/docs/*.html.gz
74+
75+
# globus adapter
76+
!/globus
77+
!/globus/.gitignore
78+
!/globus/README.md
79+
!/globus/action_provider
80+
!/globus/action_provider/oneroof_action_provider.py
81+
!/globus/action_provider/requirements.txt
82+
!/globus/config
83+
!/globus/config/.env.template
84+
!/globus/config/*.json
85+
!/globus/flows
86+
!/globus/flows/*.json
87+
!/globus/scripts
88+
!/globus/scripts/*.sh
89+
!/globus/scripts/*.py
90+
91+
# nf-test
92+
!tests/
93+
!tests/**/*
94+
!tests/**/*.nf.test
95+
!tests/data/
96+
!tests/data/**/*

.pre-commit-config.yaml

Lines changed: 13 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,17 @@ repos:
77
- id: check-toml
88
- id: end-of-file-fixer
99
- id: trailing-whitespace
10-
- repo: https://github.com/astral-sh/ruff-pre-commit
11-
rev: "v0.9.6"
10+
# - repo: https://github.com/astral-sh/ruff-pre-commit
11+
# rev: "v0.9.6"
12+
# hooks:
13+
# - id: ruff
14+
# args: ["--fix"]
15+
# - id: ruff-format
16+
- repo: local
1217
hooks:
13-
- id: ruff
14-
args: ["--fix"]
15-
- id: ruff-format
18+
- id: no-env-files
19+
name: Block .env files
20+
entry: .env files must not be committed
21+
language: fail
22+
files: '\.env$'
23+
description: 'Prevents accidental commit of .env files containing sensitive configuration'

CLAUDE.md

Lines changed: 52 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,14 @@ OneRoof is a Nextflow-based bioinformatics pipeline for base-calling, variant-ca
1010

1111
### Development Environment Setup
1212
```bash
13-
# Install pixi and/or set up environment
13+
# For environments with conda dependencies (full pipeline)
1414
pixi install --frozen
1515
pixi shell --frozen
16+
17+
# For PyPI-only environments (Python development)
18+
uv venv
19+
source .venv/bin/activate # or .venv\Scripts\activate on Windows
20+
uv sync
1621
```
1722

1823
### Running the Pipeline
@@ -42,24 +47,33 @@ nextflow run . -profile containerless [options]
4247
ruff check . --exit-zero --fix --unsafe-fixes
4348
ruff format .
4449

50+
# Run Python tests (using uv for speed)
51+
uv run pytest bin/test_*.py
52+
# Or run tests with tox for multiple environments
53+
tox
54+
4555
# Build documentation
46-
just docs # or: quarto render docs/index.qmd
56+
just docs
57+
58+
# IMPORTANT: Modifying README.md
59+
# The README.md in the project root is generated from docs/index.qmd
60+
# NEVER edit README.md directly - it will be overwritten
61+
# Always edit docs/index.qmd and re-render:
62+
just make-readme # or: just docs
4763

4864
# Docker operations
4965
just docker-build
5066
just docker-push
5167
```
5268

53-
Note: A test suite is planned but not yet implemented.
54-
5569
## Architecture
5670

5771
### Directory Structure
5872
- `main.nf` - Main workflow entry point that orchestrates platform-specific workflows
5973
- `workflows/` - Platform-specific workflows (nanopore.nf, illumina.nf)
6074
- `subworkflows/` - Reusable workflow components (alignment, variant_calling, primer_handling, etc.)
6175
- `modules/` - Individual process definitions for tools (dorado, minimap2, ivar, etc.)
62-
- `bin/` - Python utility scripts for data processing and analysis
76+
- `bin/` - Python utility scripts with PEP 723 inline dependencies (fully portable with uv)
6377
- `conf/` - Configuration files for different platforms and tools
6478

6579
### Key Workflow Components
@@ -74,7 +88,7 @@ Note: A test suite is planned but not yet implemented.
7488
### Technology Stack
7589
- **Workflow Engine**: Nextflow DSL2
7690
- **Container Support**: Docker, Singularity/Apptainer
77-
- **Environment Management**: Pixi (combines conda and PyPI dependencies)
91+
- **Environment Management**: Pixi (combines conda and PyPI dependencies), UV (fast Python package management)
7892
- **Languages**: Nextflow (Groovy), Python 3.10+
7993
- **Key Tools**: Dorado (basecalling), minimap2 (alignment), ivar/bcftools (variants), FastQC/MultiQC (QC)
8094

@@ -90,9 +104,40 @@ Note: A test suite is planned but not yet implemented.
90104
- `--downsample_to`: Manages computational resources by limiting coverage depth
91105
- `--model`: Nanopore basecalling model (defaults to sup@latest)
92106

107+
## Dependency Management
108+
109+
### Python Package Management
110+
- **Always use `uv` instead of `pip`** for any Python package installation - it's significantly faster and more reliable
111+
- **Use `uv` for PyPI-only environments**: When working with Python scripts that only need PyPI dependencies
112+
- **Use `pixi` for mixed environments**: When conda dependencies are required (e.g., for the full pipeline)
113+
- **Script execution**: Always use `uv run` instead of `python3` to execute Python scripts
114+
```bash
115+
# Good - uses inline dependencies from PEP 723 headers
116+
uv run bin/some_script.py
117+
118+
# Avoid - doesn't guarantee dependencies
119+
python3 bin/some_script.py
120+
```
121+
- **Portable scripts**: All scripts in `bin/` include PEP 723 inline dependencies, making them fully portable with uv
122+
- **Benefits**: This approach eliminates dependency hell in Python by ensuring consistent, reproducible environments
123+
124+
### Testing Infrastructure
125+
- **Comprehensive test coverage**: Python scripts in `bin/` have extensive test coverage using pytest
126+
- **Test execution**: Tests can be run quickly with UV for PyPI-only environments
127+
```bash
128+
# Run all tests
129+
uv run pytest bin/test_*.py
130+
131+
# Run specific test
132+
uv run pytest bin/test_specific_module.py
133+
```
134+
- **CI/CD**: The continuous integration pipeline uses UV instead of pip for improved speed and reliability
135+
- **Test organization**: Test files follow the pattern `test_*.py` and are colocated with the scripts they test
136+
93137
## Development Notes
94138

95-
1. **Testing Considerations**: The project prioritizes modularity to facilitate future test implementation
139+
1. **Testing**: Python scripts have comprehensive test coverage; Nextflow workflow tests are planned for future implementation
96140
2. **GPU Requirements**: Nanopore basecalling requires CUDA-capable GPUs
97141
3. **Memory Management**: Use `--low_memory` flag for resource-constrained environments
98142
4. **Slack Integration**: Optional alerts can be configured for pipeline completion
143+
5. **Dependency Management**: Always use `uv` for Python operations to ensure fast, reliable dependency resolution

0 commit comments

Comments
 (0)