Skip to content

Fix anchor keys, pipeline options, and reporting issues - #11

Merged
cokelaer merged 3 commits into
sequana:mainfrom
cokelaer:main
Aug 22, 2026
Merged

Fix anchor keys, pipeline options, and reporting issues#11
cokelaer merged 3 commits into
sequana:mainfrom
cokelaer:main

Conversation

@cokelaer

Copy link
Copy Markdown
Contributor

No description provided.

The key was written "anchor'" with a stray quote in the three sections,
so they had no anchor and their sidebar entries pointed to nothing. The
adapter section was also a copy of the phix one and reused its anchor;
it now has its own.
Two of the four pipeline options could not even build the workflow:

- --skip-phix-removal used an undefined __data__input variable; the raw
  data is now trimmed directly
- --disable-trimming referenced the cutadapt output, which does not exist
  in that case; the summary rule now follows what was really executed. The
  cutadapt section of the configuration file is kept in sync by the CLI.

The report was showing and linking the wrong files:

- the adapter section displayed the statistics computed after the phix
  removal and linked fastqc_cutadapt.html, a file that is never created.
  A fastq_stat_trimmed rule now provides the statistics of the trimmed data
  and the links point to the fastqc_trimmed report.
- the statistics and plots were computed for R1 only. They are now computed
  for each read, which is what the report module expects.
- a failure of the final summary.html was caught and printed, leaving no
  report behind while the pipeline reported a success.
- the pipeline name is used in an URL, so the space was removed.

Also removed dead code: the unreachable fastp rules, the kraken entries of
the rulegraph mapper, unused imports, and the duplicated statistics block.
The missing sys import made an invalid trimmer name raise a NameError.

The default configuration file no longer ships a hardcoded input directory.

Tests cover the four options with a dry run; they would have caught the
two NameErrors.
@codacy-production

Copy link
Copy Markdown

Not up to standards ⛔

NEW Get contextual insights on your PRs based on Codacy's metrics, along with PR and Jira context, without leaving GitHub. Enable AI reviewer
TIP This summary will be updated as you push new changes.

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 updates the quality_control pipeline to improve option handling and reporting output consistency, and adds tests to validate key CLI flags.

Changes:

  • Refactors FastQ stats generation to support per-read (R1/R2) outputs and reuses shared computation logic.
  • Fixes report generation details (anchors, section content, rulegraph mapping) and removes dead/obsolete rulegraph entries.
  • Adds dry-run tests covering --skip-phix-removal, --disable-trimming, and FastQC skip options; bumps version to 1.2.0.

Reviewed changes

Copilot reviewed 6 out of 6 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
test/test_main.py Adds CLI dry-run tests for key pipeline options and asserts subprocess success.
sequana_pipelines/quality_control/quality_control.rules Refactors FastQ stats outputs, fixes report sections/anchors, adjusts trimming logic, and tightens error handling.
sequana_pipelines/quality_control/main.py Aligns cutadapt.do with trimming enablement to match how trimming rules/reporting are driven.
sequana_pipelines/quality_control/config.yaml Removes a hardcoded local input_directory value from the default config.
README.rst Adds a 1.2.0 changelog entry describing fixes and report improvements.
pyproject.toml Bumps package version to 1.2.0.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment on lines 443 to 445
__summary_pipeline__inputs = manager.getrawdata()
if manager.config['cutadapt'].do:
# todo: handle all adapter removal cases
if manager.config.trimming.do:
__summary_pipeline__outputs = [ __cutadapt__output ]
@cokelaer
cokelaer merged commit 5ff55cf into sequana:main Aug 22, 2026
2 of 3 checks passed
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