Skip to content

fix: subtyping_report.py edge cases#135

Open
peterk87 wants to merge 3 commits into
devfrom
fix/134-subtyping-report-edge-cases
Open

fix: subtyping_report.py edge cases#135
peterk87 wants to merge 3 commits into
devfrom
fix/134-subtyping-report-edge-cases

Conversation

@peterk87

@peterk87 peterk87 commented Jun 3, 2026

Copy link
Copy Markdown

This PR fixes #134

Peter Kruczkiewicz and others added 3 commits June 3, 2026 12:55
Test data under tests/data/ was blocked by the top-level data/ gitignore,
so nf-test could not find flu_metadata.csv on CI. Pin setup-uv to v8.1.0
since @v8 is no longer a valid immutable tag.

Co-authored-by: Cursor <cursoragent@cursor.com>
setup-uv v8 requires an explicit virtual environment before uv pip install
when the repo has no pyproject.toml.

Co-authored-by: Cursor <cursoragent@cursor.com>

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Pull request overview

This PR addresses reported edge cases in bin/subtyping_report.py around missing HA/NA segments and improves robustness against IAV contamination skewing genus detection, while adding automated coverage via nf-test and pytest and wiring those tests into CI.

Changes:

  • Update subtyping_report.py to (a) always populate H/N result columns even when segments are missing and (b) determine genus via segment-level voting to reduce contamination bias.
  • Add nf-test coverage for missing HA/NA segments and IBV-with-IAV-contamination scenarios; add pytest unit tests for key helper logic.
  • Add a pytest job to CI (via uv) and expand .gitignore to cover common Nextflow, nf-test, and Python artifacts.

Reviewed changes

Copilot reviewed 10 out of 14 changed files in this pull request and generated no comments.

Show a summary per file
File Description
bin/subtyping_report.py Implements genus voting changes and missing-segment handling; refactors typing annotations and result table column handling.
tests/bin/test_subtyping_report.py Adds unit tests for genus voting, missing-segment behavior, and result column reindexing.
tests/modules/local/subtyping_report.nf.test Adds nf-test coverage for HA/NA missing inputs and contamination scenario.
tests/modules/local/subtyping_report.nf.test.snap Stores nf-test snapshots for the added module tests.
tests/nextflow.config Ensures bin/ is on PATH for SUBTYPING_REPORT during nf-test runs.
tests/requirements.txt Adds a dedicated dependency set for running pytest against bin scripts.
tests/data/subtyping_report/flu_metadata.csv Provides metadata fixtures for nf-test scenarios.
tests/data/subtyping_report/blastn_results/* Provides BLAST fixtures for missing-segment and contamination scenarios.
tests/data/subtyping_report/vadr_outdirs/.gitkeep Placeholder to stage an empty VADR directory in tests.
.github/workflows/ci.yml Adds a pytest job and updates caches/artifact actions; updates Nextflow matrix latest version.
.github/workflows/linting.yml Updates GitHub Actions versions used by markdown linting.
.gitignore Expands ignores for Nextflow/nf-test/Python/IDE outputs while keeping tests/data/ tracked.
CHANGELOG.md Adds an Unreleased entry describing the bugfixes and new tests/CI updates.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@peterk87 peterk87 requested review from jrudar and nhhaidee June 3, 2026 22:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants