Skip to content

Development - #14

Open
alex-sandercock wants to merge 4 commits into
mainfrom
development
Open

alex-sandercock wants to merge 4 commits into
mainfrom
development

Conversation

@alex-sandercock

Copy link
Copy Markdown
Contributor

This pull request introduces significant improvements to the documentation and CI workflow for MADCATS, focusing on clarity, completeness, and the introduction of the new experimental filter-paralogs feature. The README and user documentation have been thoroughly rewritten for better onboarding, clearer feature descriptions, and to reflect recent changes and new capabilities. The CI workflow is updated to ensure compatibility with newer OS/Python combinations and to support the optional genome aligner dependency.

Documentation improvements and new feature coverage:

  • Major rewrite of README.md and docs/src/README.md for clarity, onboarding, and accuracy, including:

    • Clearer explanations of the tool’s purpose, supported platforms, and workflow.
    • Detailed highlights and feature list, emphasizing platform independence, evidence-based discovery, and the new paralog filtering feature.
    • Improved installation and quick start instructions, with references to new and existing tutorials. [1] [2] [3] [4] [5] [6]
  • Addition and documentation of the new experimental filter-paralogs command:

    • Described in the README and user docs as an optional, genome-based paralog filter for panels with co-amplified paralogs.
    • Marked as experimental, with guidance on installation and caveats about future changes. [1] [2] [3] [4]

Tutorial and navigation enhancements:

  • Updated documentation navigation (docs/src/SUMMARY.md) to include:
    • A new tutorial on filtering paralogs with a reference genome.
    • Command reference for the new madcats filter-paralogs command. [1] [2]

Continuous Integration (CI) workflow updates:

  • Improved .github/workflows/tests.yml to:
    • Exclude Python 3.9 on ubuntu-latest and add Python 3.9 testing on ubuntu-24.04 for compatibility.
    • Add installation steps for the optional mappy aligner on macOS, supporting tests for the new paralog filter. [1] [2]

These changes collectively enhance the user experience, ensure up-to-date and accurate documentation, and prepare the project for new features and broader platform support.

One commit for the 0.14.0 work, which was developed on `development` in
pull requests #3 to #12. The changelog lists each change.

generate
- Tiled markers: a read that fits several tiles of one amplicon counts
  for each of them (`--tile-groups auto|declared|off`, default `auto`).
- Unresolved ends: a row whose last gap has fewer than 12 bases after it
  is read only up to the first disputed base (`unresolved=k`). Bases the
  reads carry after the tag settle such a row where they can (read
  continuation).
- Ref and Alt tag alignments that tie on edits go to the one with fewer
  gaps, and `Variants` comes from the alignment that set the category.
- `--remove-primers on` writes rows without their primers and keeps rows
  of different allele groups apart.
- `--leading-anchor-mismatches {0,1}` (default 0), and `--leading-anchor
  auto` handles inline barcodes of different lengths.
- Cache format 0.8.0.

Other commands
- New optional, experimental `filter-paralogs` (`madcats_paralogs.py`,
  needs `mappy`).
- `infer-design --leading-anchor` cuts raw reads in its fuzzy pass.
- `validate` and `filter-paralogs` warn about signed-byte count overflow
  in a MADC.

Docs and help text are rewritten. The tests grow from 86 in three files
to 247 in nine.
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.
say which rows keep their right primer under --remove-primers
Copilot AI balanced review requested due to automatic review settings December 2, 2026 00:02
@alex-sandercock alex-sandercock self-assigned this Dec 2, 2026
@alex-sandercock alex-sandercock added the enhancement New feature or request label Dec 2, 2026

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

Documentation needs corrections to qualify reconstruction and mismatch-count guarantees and include long-gap scoring penalties.

3 open issues
What changed in this PR

This PR expands MADCATS documentation for experimental genome-based paralog filtering and updated generation behavior, adds regression coverage, and updates packaging and CI.

Changes:

  • Refresh onboarding, tutorials, command references, and output documentation.
  • Add tiled-marker, alignment-tie, and frozen-output regression tests.
  • Package the paralog module and optional aligner dependency; update CI compatibility.
File Description
tests/​test_tiled_markers.py Tests shared-read crediting and tile grouping.
tests/​test_reading_ties.py Tests alignment ties and consistent variant annotations.
tests/​test_example.py Compares generated tables with frozen outputs.
tests/​test_docs.py Adds support for excluding unpublished commands.
tests/​fixtures/​generate_v013/​README.md Documents baseline provenance and reproduction.
tests/​fixtures/​generate_v013/​gapped_on.csv Stores the gapped-rescue baseline.
tests/​fixtures/​generate_v013/​gapped_off.csv Stores the non-rescue baseline.
README.md Streamlines onboarding and introduces paralog filtering.
pyproject.toml Packages the paralog module and genome extra.
docs/​src/​tutorials/​primer-free.md Clarifies primer-free panel inference.
docs/​src/​tutorials/​paralog-filter.md Adds a genome-filtering walkthrough.
docs/​src/​tutorials/​paired-end.md Clarifies merging, pooling, and tiling.
docs/​src/​tutorials/​dartag.md Updates generation and leading-anchor guidance.
docs/​src/​tutorials/​agriseq.md Clarifies normalization and frozen windows.
docs/​src/​SUMMARY.md Adds paralog-filter navigation.
docs/​src/​reference/​validation.md Adds paralog-filter benchmarks and limitations.
docs/​src/​reference/​output-formats.md Documents annotations, trimming, QC, and genome labels.
docs/​src/​reference/​faq.md Updates dependencies, overflow, and caching guidance.
docs/​src/​reference/​evidence-model.md Explains tiling, alignment decisions, and read continuation.
docs/​src/​README.md Refreshes the documentation landing page.
docs/​src/​getting-started/​workflows.md Adds optional genome filtering to workflow guidance.
docs/​src/​getting-started/​quickstart.md Clarifies generation steps and outputs.
docs/​src/​getting-started/​installation.md Documents the optional aligner and macOS installation.
docs/​src/​getting-started/​input-formats.md Explains tile declarations and detection.
docs/​src/​getting-started/​example.md Updates example guidance for version 0.14.0.
docs/​src/​development/​contributing.md Updates testing, dependency, and release guidance.
docs/​src/​development/​changelog.md Records version 0.14.0 changes.
docs/​src/​development/​architecture.md Documents module boundaries and pipeline updates.
docs/​src/​commands/​window-scan.md Clarifies selection metrics and recommendations.
docs/​src/​commands/​validate.md Documents flexible headers and overflow reporting.
docs/​src/​commands/​overview.md Adds the optional filtering workflow.
docs/​src/​commands/​normalize-reads.md Clarifies normalization and window reuse.
docs/​src/​commands/​merge-pairs.md Clarifies paired-read geometry and pooling.
docs/​src/​commands/​infer-design.md Clarifies inference and anchor requirements.
docs/​src/​commands/​generate.md Documents new options and output behavior.
docs/​src/​commands/​filter-paralogs.md Adds the experimental command reference.
docs/​src/​commands/​design.md Clarifies panel reconstruction.
docs/​src/​citation.md Adds minimap2 citations and updates acknowledgment text.
.gitignore Ignores generated minimap2 indexes.
.github/​workflows/​tests.yml Adjusts Python 3.9 runners and installs mappy.

Review effort: Balanced

Comment on lines +58 to +60
Alignment scores follow minimap2's short-read scoring (match +2, mismatch −8, gap open −12, gap
extension −2, ambiguous base −1) and are recomputed directly from each alignment so score ties are
exact.
Comment on lines +156 to +157
A perfect 81-base match scores 162 and each mismatch costs 10, so `TargetScore` and
`OffTargetScore` show how many mismatches separate a haplotype from each copy.
Comment on lines +78 to +79
Because no two tokens overlap on the same Ref base, applying them sequentially reconstructs the
exact printed row sequence from the Ref tag.
The entry was 1,036 words in 16 bullets, about ten times any earlier
release. It is now 8 bullets of two or three sentences each: what
changed and what a user must do differently, with a link to the page
that explains the rest.

Left out, and still in the command pages or the development record: how
`filter-paralogs` places markers and labels rows, the lettuce and
overflow figures, and most QC JSON key names. Kept because they change
what a user runs or parses: the `unresolved=k` token, the indel written
without an anchor base, `--tile-groups off` for 0.13.0 read assignment,
and that caches rebuild once.
Copilot AI balanced review requested due to automatic review settings December 2, 2026 00:15

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.

🔵 Needs a closer look

Unresolved documentation inaccuracies cover IUPAC sequence reconstruction, ambiguous-row retention, signed-byte overflow recovery, and annotation behavior when gapped rescue is disabled.

3 open issues
3 previously missed issues

In code that hasn't changed since last review

Low severity Document paralog and unmapped precedence for ambiguous markers

docs/​src/​commands/​filter-paralogs.md:40

An unresolved multi-copy marker can still have rows labeled paralog when an off-target hit scores higher, or unmapped when no alignment exists, so --ambiguous keep does not retain every row at that marker. Document this precedence here and qualify the same claim at line 199.

Low severity Clarify signed-byte overflow and count recovery limits

docs/​src/​reference/​faq.md:30

Signed-byte overflow repeats modulo 256: for example, 384 becomes −128, not a small positive value. Adding 256 therefore recovers an unsigned byte value, not necessarily an original count in the 128–255 band. Please clarify that larger counts can wrap to negative values too and cannot be recovered from the stored byte alone.

Low severity Qualify annotation behavior when gapped rescue is disabled

docs/​src/​reference/​output-formats.md:97

With --gapped-rescue off, the writer receives gap_band=0, and _describe compares unequal-length trimmed rows base by base, emitting clip or overhang rather than aligning them. Qualify the gapped and end-to-end annotation behavior on enabled rescue so this supported option combination is documented accurately.

Review effort: Balanced

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants