Restructure as Python package with Docker/CI support#20
Conversation
- Convert standalone scripts to installable Python package with src/ layout
- Create single CLI entry point `qprimer` with 7 subcommands:
- generate, pick-representatives, prepare-input, evaluate,
filter, build-output, select-multiplex
- Reduce environment.yml from 165 to ~15 packages (top-level only)
- Move ML models to package data (src/qprimer_designer/data/)
- Add external tool wrappers (ViennaRNA, bowtie2, MAFFT) using PATH
- Fix hardcoded paths in training/ to use environment variables
- Move Snakefiles to workflows/ and update to use new CLI syntax
- Delete 37MB ViennaRNA tarball (use bioconda instead)
- Add Dockerfile with mambaorg/micromamba base
- Add GitHub Actions workflows:
- test.yml: pytest runner
- docker.yml: multi-arch Docker builds
- snakemake.yml: workflow dry-run validation
- Add placeholder tests for sequences and params modules
- Add CLAUDE.md development guide and update README.md
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- Use mambaorg/micromamba:2.5.0-debian12-slim (2.0.0-ubuntu24.04 doesn't exist) - Add --cores 1 to snakemake dry-run (required by workflow) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- Add merge_group trigger to Docker workflow for future merge queue support - Only push images on push events (not PRs or merge_group) - Add CMD ["/bin/bash"] as default entrypoint in Dockerfile - Remove tarball exclusions from .gitignore (keep HUMAN.tar.bz2) - Fix Docker image path in README (broadinstitute, not kbryanhsu) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
There was a problem hiding this comment.
Pull request overview
This PR restructures the repository into an installable Python package with modern packaging, Docker support, and CI/CD workflows. The main goal is to improve maintainability and deployment by transitioning from standalone scripts to a unified CLI with subcommands, reducing dependency bloat, and adding automated testing infrastructure.
Changes:
- Converted standalone scripts to installable package with
qprimerCLI entry point and 7 subcommands - Streamlined dependencies from ~165 to ~15 top-level packages in
environment.yml - Added Docker support with multi-arch builds and GitHub Actions workflows for tests, Docker builds, and Snakemake validation
Reviewed changes
Copilot reviewed 40 out of 45 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
workflows/params.txt.template |
New parameter template file for workflow configuration |
workflows/Snakefile.template |
Updated to use new qprimer CLI commands instead of direct script calls |
workflows/Snakefile.example |
Updated to use new qprimer CLI commands instead of direct script calls |
training/adapt_pcr_external_tools.py |
Refactored to use environment variables and PATH-based tool discovery |
training/__init__.py |
Updated matplotlib configuration to use environment variables for font paths |
tests/test_sequences.py |
Added tests for sequence utility functions |
tests/test_params.py |
Added tests for parameter parsing |
tests/conftest.py |
Added pytest fixtures for testing |
tests/__init__.py |
Added test suite initialization |
src/qprimer_designer/utils/sequences.py |
New sequence manipulation utilities module |
src/qprimer_designer/utils/params.py |
New parameter parsing utilities module |
src/qprimer_designer/utils/encoding.py |
New sequence encoding utilities for ML models |
src/qprimer_designer/utils/__init__.py |
Utility module exports |
src/qprimer_designer/models/inference.py |
New model loading and inference utilities |
src/qprimer_designer/models/architectures.py |
ML model architectures for primer evaluation |
src/qprimer_designer/models/__init__.py |
Model module exports |
src/qprimer_designer/external/vienna.py |
ViennaRNA RNAduplex wrapper |
src/qprimer_designer/external/mafft.py |
MAFFT wrapper for sequence alignment |
src/qprimer_designer/external/bowtie.py |
Bowtie2 wrapper for sequence alignment |
src/qprimer_designer/external/__init__.py |
External tool wrapper exports |
src/qprimer_designer/commands/select_multiplex.py |
CLI command for selecting multiplex primer sets |
src/qprimer_designer/commands/prepare_input.py |
CLI command for preparing ML evaluation input |
src/qprimer_designer/commands/pick_representatives.py |
CLI command for selecting representative sequences |
src/qprimer_designer/commands/generate.py |
CLI command for generating primer candidates |
src/qprimer_designer/commands/filter_primers.py |
CLI command for filtering primers based on scores |
src/qprimer_designer/commands/evaluate.py |
CLI command for ML-based primer evaluation |
src/qprimer_designer/commands/build_output.py |
CLI command for building final primer design output |
src/qprimer_designer/commands/__init__.py |
CLI command module exports |
src/qprimer_designer/cli.py |
Main CLI entry point with subcommand registration |
src/qprimer_designer/__init__.py |
Package initialization with version |
setup.sh |
Removed legacy setup script |
pyproject.toml |
New Python package configuration |
environment.yml |
Streamlined conda environment with top-level dependencies only |
README.md |
Updated documentation for new package structure |
Dockerfile |
New Docker image configuration |
CLAUDE.md |
New development guide |
.github/workflows/test.yml |
New GitHub Actions workflow for testing |
.github/workflows/snakemake.yml |
New GitHub Actions workflow for Snakemake validation |
.github/workflows/docker.yml |
New GitHub Actions workflow for Docker builds |
.dockerignore |
Docker build exclusions |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Welcome to Codecov 🎉Once you merge this PR into your default branch, you're all set! Codecov will compare coverage reports and display results in all future pull requests. Thanks for integrating Codecov - We've got you covered ☂️ |
- Use --list-rules for Snakemake syntax validation (py_compile does not understand Snakemake syntax) - Add badges for Tests, Docker Build, and CodeCov Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Summary
src/layoutqprimerwith 7 subcommands (generate, pick-representatives, prepare-input, evaluate, filter, build-output, select-multiplex)environment.ymlfrom 165 to ~15 packages (top-level dependencies only)src/qprimer_designer/data/)training/to use environment variablesworkflows/directory and update to use new CLI syntaxviennarnapackage instead)mambaorg/micromambabase for multi-arch builds (linux/amd64, linux/arm64)--list-rulesTest plan
pip install .works in conda environment (CI tests pass)qprimer --helpandqprimer generate --helpto verify CLI (Docker build verifies this)pytest tests/ -vto verify tests pass (CI tests pass)docker build -t qprimer:test .to verify Docker build (CI build passes)snakemake -s workflows/Snakefile.example --dry-runto validate Snakefile syntax (CI)🤖 Generated with Claude Code