-
Notifications
You must be signed in to change notification settings - Fork 14
ENH: add a new action for contig quality control #116
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
There was a problem hiding this 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_qcmodule 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 usesevaluate_contigs. Rename it toevaluate_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
hasClientMetadatawithletorconstwithin 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_qcfunctions. Add tests forevaluate_contigsand related logic to ensure coverage of the core QC computations.
# ----------------------------------------------------------------------------
Codecov Report❌ Patch coverage is
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. 🚀 New features to boost your workflow:
|
There was a problem hiding this 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
VinzentRisch
left a comment
There was a problem hiding this 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!
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:
evaluate-contigsaction was renamed toevaluate-quastfilter-contigsaction to filter samples based on assembly quality