Skip to content

say which rows keep their right primer under --remove-primers - #13

Merged
alex-sandercock merged 1 commit into
developmentfrom
primer-kept-notice
Dec 1, 2026
Merged

alex-sandercock merged 1 commit into
developmentfrom
primer-kept-notice

Conversation

@alex-sandercock

Copy link
Copy Markdown
Contributor

This pull request enhances the --remove-primers functionality in the generate command 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:

  • The generate command now prints how many rows kept their right primer and the reasons (target, short, collision) after processing, with a new helper function primer_removal_notice for clear messaging.
  • The QC JSON output now includes a rows_right_primer_kept field listing each row that retained its right primer, along with marker, allele ID, sequence, and reason. [1] [2]
  • The internal logic of trim_locus_rows and related primer trimming code was updated to collect and pass information about kept primers. [1] [2] [3] [4]

Documentation updates:

  • The documentation for the generate command and the changelog were updated to describe the new reporting and JSON output for rows that keep their right primer. [1] [2]

Test improvements:

  • Unit tests were added and updated to verify that rows retaining their right primer are correctly listed in the QC JSON and reported in the notice, ensuring robust coverage of the new behavior. [1] [2]

Other minor updates:

  • The test count in the development documentation was incremented to reflect the new test.

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.
@alex-sandercock alex-sandercock self-assigned this Dec 1, 2026
Copilot AI lite review requested due to automatic review settings December 1, 2026 23:06

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🟡 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

Comment thread madcats.py Resolved
@alex-sandercock alex-sandercock changed the title generate: say which rows keep their right primer under --remove-primers say which rows keep their right primer under --remove-primers Dec 1, 2026
@alex-sandercock
alex-sandercock merged commit 8244dc3 into development Dec 1, 2026
17 checks passed
@alex-sandercock
alex-sandercock deleted the primer-kept-notice branch December 1, 2026 23:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants