Repository navigation
say which rows keep their right primer under --remove-primers - #13
Merged
Merged
Conversation
With `--remove-primers on` a row keeps its right primer when the cut would remove the base its category was read from, would leave fewer than 10 bases, or would make it the sequence of a row of another allele group. The table does not mark such a row, and until now only three counts in the QC JSON said it had happened. - The line `generate` prints at the end now gives the number of rows that kept their right primer, by reason, and the number of markers that kept it on every row. A table whose rows all lost their primers prints the line as before. - The QC JSON lists each such row under `primer_removal.rows_right_primer_kept`, with its marker, AlleleID, sequence as written and reason (`target`, `short` or `collision`). The table and the variants sidecar are unchanged: on 12 pecan samples both are byte for byte those of the commit before, and the list holds the 11 rows the count names.
There was a problem hiding this comment.
🟡 Changes recommended
A moderate active issue remains because the canonical-row fallback can omit retained rows from the QC list and notice, contrary to the documented each-row reporting.
1 open issue
What changed in this PR
Enhances generate --remove-primers reporting by exposing rows that retain their right primer in QC output and the completion notice, with accompanying tests and documentation updates.
Changes:
- Tracks retained-primer rows and their retention reasons during trimming.
- Adds retained-row details to the QC JSON and summarizes them in the generate notice.
- Updates tests, command documentation, changelog, and documented test counts.
| File | Description |
|---|---|
| tests/test_remove_primers.py | Adds tests verifying retained-primer rows in QC data and completion notices. |
| madcats.py | Collects retained-primer rows, emits them in QC metadata, and formats the generate notice. |
| docs/src/development/changelog.md | Documents the new retained-primer reporting behavior. |
| docs/src/commands/generate.md | Documents retained-primer reporting and the corresponding QC field. |
| docs/DEVELOPMENT.md | Updates the documented test count and breakdown. |
Review effort: Lite
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.

This pull request enhances the
--remove-primersfunctionality in thegeneratecommand by tracking and reporting rows that retain their right primer, improving both the output table and the QC JSON. It also updates documentation and tests to reflect these changes. The main improvements are the detailed reporting of rows that keep their right primer, the reasons for retention, and clearer communication to users.Enhancements to primer removal reporting:
generatecommand now prints how many rows kept their right primer and the reasons (target, short, collision) after processing, with a new helper functionprimer_removal_noticefor clear messaging.rows_right_primer_keptfield listing each row that retained its right primer, along with marker, allele ID, sequence, and reason. [1] [2]trim_locus_rowsand related primer trimming code was updated to collect and pass information about kept primers. [1] [2] [3] [4]Documentation updates:
generatecommand and the changelog were updated to describe the new reporting and JSON output for rows that keep their right primer. [1] [2]Test improvements:
Other minor updates: