ENH: update extract-annotations to generate per-contig feature table#328
Conversation
efaba3f to
cbc5237
Compare
There was a problem hiding this comment.
Pull request overview
Enhances the EggNOG extract_annotations action to generate per-contig annotation counts and a function→contigs feature map in addition to the existing per-genome annotation counts.
Changes:
- Updated
extract_annotationsto return three outputs: per-genome counts table, function→contigs map, and per-contig counts table. - Updated QIIME 2 plugin registration to expose the new outputs/types.
- Expanded unit tests and adjusted EggNOG test annotation fixture data to reflect per-contig behavior.
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
| q2_annotate/plugin_setup.py | Registers new outputs for extract_annotations, including FeatureMap[FunctionToContigs] and a per-contig FeatureTable[Frequency]. |
| q2_annotate/eggnog/annotation.py | Refactors extraction to compute per-contig counts and build/merge function→contigs maps. |
| q2_annotate/eggnog/tests/test_annotation.py | Updates tests for new return signature and adds coverage for map merging. |
| q2_annotate/eggnog/tests/data/annotations/1e9ffc02-0847-4f2c-b1e2-3965a4a78b15.emapper.annotations | Adjusts fixture data to include a second contig for validating per-contig aggregation. |
Comments suppressed due to low confidence (1)
q2_annotate/plugin_setup.py:1827
- The registered method description/name still says it "calculates its frequencies across all MAGs", but the method now also returns a per-contig feature table and a function→contigs feature map. Update the
name/description(and/or output descriptions) to reflect the new behavior so users understand what the extra outputs represent.
name="Extract annotation frequencies from all annotations.",
description=(
"This method extract a specific annotation from the table "
"generated by EggNOG and calculates its frequencies across "
"all MAGs."
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #328 +/- ##
==========================================
- Coverage 94.53% 94.50% -0.03%
==========================================
Files 38 38
Lines 2854 2875 +21
Branches 435 437 +2
==========================================
+ Hits 2698 2717 +19
- Misses 78 79 +1
- Partials 78 79 +1 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
VinzentRisch
left a comment
There was a problem hiding this comment.
Hello
I ran the code with some test data and it all looks good. I have some minor suggestions below:
|
Thanks @VinzentRisch! 🙏 |
Description
Closes #311.
AI Disclosure
AI Usage Details
Codex was used during some early stage ideating. All the code was reviewed and tested before PR submission.