Repository navigation
Fix/circular contig closure edge - #415
Open
JeanMainguy wants to merge 2 commits into
Open
JeanMainguy wants to merge 2 commits into
JeanMainguy wants to merge 2 commits into
Conversation
Contributor
There was a problem hiding this comment.
🟢 Approval recommended
No active review issues are recorded for the circular-contig edge-filtering changes.
No open issues 🎉
What changed in this PR
This PR makes circular-contig closure follow the same filtering rules as other consecutive gene pairs in the neighbors graph.
Changes:
- Extracts per-contig edge construction into
add_contig_edges()with a shared fragment-link check. - Closes circular contigs using the first kept gene and skips closure when fewer than two genes remain.
- Adds unit tests for linear and circular contigs, fragments, tandem copies, removed families, and small contigs.
| File | Description |
|---|---|
tests/unit_tests/graph/test_make_graph.py |
Adds regression tests for edge construction and circular-contig boundaries. |
ppanggolin/graph/makeGraph.py |
Extracts edge-building logic and fixes circular closure filtering and self-links. |
Review effort: Balanced
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
In
compute_neighbors_graph, the edge between the last and first genes of a circularcontig skips the rules applied to every other pair of consecutive genes:
contig[0]is used even when its family was removed with--remove_high_copy_number.Fix
add_contig_edges().Impact
Graph recomputed with
ppanggolin graph --force:No edge is added; every other gene pair is unchanged.
Tests
New unit tests in
tests/unit_tests/graph/test_make_graph.pycover linear and circularcontigs, fragments, tandem copies, removed families and one- and two-gene circular
contigs. All unit tests pass.
Implemented with help from Claude Code.