Skip to content

Conversation

@misialq
Copy link
Contributor

@misialq misialq commented May 23, 2025

This PR adds a new action to calculate basic contig assembly QC metrics like Nx/Lx values, contig length stats and GC content etc. Here's a summary:

  • the evaluate-contigs action was renamed to evaluate-quast
  • the new action is parsl-compatible and supports mutliprocessing
  • the action outputs a per-sample results table and an interactive visualizaiton
  • it can accept optional metadata: in this case an additional tab is added in the visualization with some metadata-based summary stats (otherwise only two tabs are present)
  • the results table can subsequently be used as an input to filter-contigs action to filter samples based on assembly quality

@misialq misialq requested a review from Copilot May 23, 2025 10:11
Copy link

Copilot AI left a comment

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 introduces a new contig_qc action to compute basic contig assembly QC metrics (e.g., Nx/Lx, length stats, GC content) and provides an interactive dashboard for visualization, with optional metadata support.

  • Added the contig_qc module and registered its API in the package.
  • Included test data fixtures for contig metrics.
  • Provided front-end assets (Vega-Lite templates, HTML, JS, CSS) for an interactive QC dashboard.

Reviewed Changes

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

Show a summary per file
File Description
q2_assembly/contig_qc/tests/data/*.tsv, *.csv, *.fa New test fixtures for metadata, length, GC, cumulative, and contig sequences
q2_assembly/contig_qc/tests/init.py Initialized test package
q2_assembly/contig_qc/init.py Registered evaluate_contigs functions
q2_assembly/assets/contig_qc/vega/*.json.j2 Vega-Lite JSON templates for QC plots
q2_assembly/assets/contig_qc/table.html, index.html, grouped.html HTML templates for the dashboard
q2_assembly/assets/contig_qc/js/index.js, bootstrapMagic.js JavaScript for interactivity and Bootstrap adjustments
q2_assembly/assets/contig_qc/css/styles.css Styles for dashboard components
q2_assembly/init.py Exported qc module in package
conda-recipe/meta.yaml Added pyarrow dependency
Comments suppressed due to low confidence (3)

q2_assembly/contig_qc/init.py:9

  • The PR description indicates the action was renamed to evaluate-quast, but this import still uses evaluate_contigs. Rename it to evaluate_quast (and update __all__) to keep names consistent.
from .qc import evaluate_contigs, _evaluate_contigs, _visualize_contig_qc

q2_assembly/assets/contig_qc/js/index.js:5

  • This assignment writes to an undeclared variable, implicitly polluting the global scope. Declare hasClientMetadata with let or const within the script to avoid globals.
hasClientMetadata = Boolean(hasClientMetadata)

q2_assembly/contig_qc/tests/init.py:1

  • Test data fixtures are present but there are no unit test scripts for the new contig_qc functions. Add tests for evaluate_contigs and related logic to ensure coverage of the core QC computations.
# ----------------------------------------------------------------------------

@codecov
Copy link

codecov bot commented May 23, 2025

Codecov Report

❌ Patch coverage is 99.23858% with 3 lines in your changes missing coverage. Please review.
✅ Project coverage is 96.96%. Comparing base (43b373d) to head (809cf97).

Files with missing lines Patch % Lines
q2_assembly/contig_qc/qc.py 98.40% 1 Missing and 2 partials ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #116      +/-   ##
==========================================
+ Coverage   96.66%   96.96%   +0.30%     
==========================================
  Files          34       36       +2     
  Lines        2935     3328     +393     
  Branches      242      274      +32     
==========================================
+ Hits         2837     3227     +390     
- Misses         46       47       +1     
- Partials       52       54       +2     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@misialq misialq requested review from VinzentRisch and Copilot May 23, 2025 15:07
Copy link

Copilot AI left a comment

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 introduces a new contig quality control action that calculates assembly QC metrics (e.g., Nx/Lx values, contig statistics, and GC content) and provides an interactive visualization dashboard. Key changes include updating test data files (TSV/CSV/FA) for contig and GC metrics, new Vega-Lite specification assets and dashboard HTML/JS code, and updating init files and conda recipe dependencies for the new action.

Reviewed Changes

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

Show a summary per file
File Description
q2_assembly/contig_qc/tests/data/metadata.tsv Adds metadata test file for dashboard filters.
q2_assembly/contig_qc/tests/data/length.csv, gc.csv, cumulative.csv Introduces test files to verify contig metrics.
q2_assembly/contig_qc/tests/data/contigs/*.fa Provides sample FASTA entries for contig QC testing.
q2_assembly/contig_qc/init.py Exports QC functions; may require name alignment with the new action.
q2_assembly/assets/contig_qc/vega/*.json Supplies Vega-Lite specs for various visualizations.
q2_assembly/assets/contig_qc/{table.html,index.html,grouped.html} Implements and styles the interactive dashboard.
q2_assembly/assets/contig_qc/js/* Contains JS code for dashboard behavior, including legend and Vega view updates.
conda-recipe/meta.yaml Adds dependency on pyarrow to support processing of arrow data formats.
q2_assembly/init.py Registers the new qc module in the package.
Comments suppressed due to low confidence (1)

q2_assembly/contig_qc/init.py:9

  • The export name 'evaluate_contigs' does not match the new action name 'evaluate-quast' mentioned in the PR title and description. Consider renaming the function for consistency.
from .qc import evaluate_contigs, _evaluate_contigs, _visualize_contig_qc

Copy link
Contributor

@VinzentRisch VinzentRisch left a comment

Choose a reason for hiding this comment

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

Hey @misialq
I ran it with and without metadata and it worked great.
I looked over the python code and don't have any notes. Looks all neat and tidy.
I also skimmed the html css and js code but I just dont have enough experience with it to give any pointers on that.
But yes, really great work!

@misialq misialq linked an issue Nov 19, 2025 that may be closed by this pull request
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

ENH: add a new simplified action for contig QC

2 participants