Skip to content

Archive OTU table v6: record frameshift repairs as per-read variants - #326

Merged
wwood merged 4 commits into
devfrom
claude/frame-shift-chunk-processing-icz3u2
Oct 28, 2026
Merged

wwood merged 4 commits into
devfrom
claude/frame-shift-chunk-processing-icz3u2

Conversation

@wwood

@wwood wwood commented Oct 28, 2026

Copy link
Copy Markdown
Owner

Archive OTU tables now store each read after frameshift repair, and a new read_unaligned_sequence_variants field records the repairs as VCF-style [POS, REF, ALT] variants (the stored read being the reference), so the read as sequenced can be recreated. With --context-window, shortening the read to the region around the hit is not recorded. This replaces reads_with_repaired_deletions; version 5 tables are rejected.

Variants are computed once in the DIAMOND prefilter and travel with each window sequence, replacing the scattered repaired-deletion bookkeeping in pipe. This also fixes reverse reads of a pair being given their mate's sequence in the paired DIAMOND-taxonomy path. renew keeps the variants, and summarise --resolve-ambiguous-windows uses them to find repair-inserted Ns. Extended TSV OTU tables gain the column, written as POS:REF>ALT per read, or '.' for an unmodified read.

Claude-Session: https://claude.ai/code/session_019URUjTJM4Se2CmgGzPmPs5

Archive OTU tables now store each read after frameshift repair, and a new
read_unaligned_sequence_variants field records the repairs as VCF-style
[POS, REF, ALT] variants (the stored read being the reference), so the read
as sequenced can be recreated. With --context-window, shortening the read
to the region around the hit is not recorded. This replaces
reads_with_repaired_deletions; version 5 tables are rejected.

Variants are computed once in the DIAMOND prefilter and travel with each
window sequence, replacing the scattered repaired-deletion bookkeeping in
pipe. This also fixes reverse reads of a pair being given their mate's
sequence in the paired DIAMOND-taxonomy path. renew keeps the variants,
and summarise --resolve-ambiguous-windows uses them to find
repair-inserted Ns. Extended TSV OTU tables gain the column, written as
POS:REF>ALT per read, or '.' for an unmodified read.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_019URUjTJM4Se2CmgGzPmPs5
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 28, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-10-28T06:06:05.275543Z e841c41 Manual request
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

wwood and others added 3 commits October 28, 2026 12:51
…-only samples

* pipe: reject --read-chunk-number when weebill would run, since weebill
  would profile the whole of the reads rather than the chunk.
* summarise --resolve-ambiguous-windows: a window resolved to a donor takes
  the donor's taxonomy, equal best hits and assignment method, as the whole
  dataset would have given it.
* condense: profile named weebill samples that have no marker OTUs from
  their weebill coverage, rather than dropping them.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_019URUjTJM4Se2CmgGzPmPs5
polars 2.0 removed the 'columns' argument of DataFrame.pivot (now 'on')
and GroupBy.count (now GroupBy.len), breaking summarise's species-by-site
and taxonomic-level-coverage outputs, and supplement. Both replacements
are available in polars 1.x too.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_019URUjTJM4Se2CmgGzPmPs5
pipe already continues to condense with an empty OTU table when no read
hits a marker, and condense now profiles weebill-only samples, so a run
whose reads hit no marker still gets its weebill species. Test this end to
end with a stand-in weebill.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_019URUjTJM4Se2CmgGzPmPs5
@wwood

wwood commented Oct 28, 2026

Copy link
Copy Markdown
Owner Author

@codex review

@chatgpt-codex-connector chatgpt-codex-connector Bot 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.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: e841c415ac

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread singlem/summariser.py
# No ambiguous base is left to resolve, so the OTU no longer
# needs marking as having one.
repaired[i] = None
donor = donor_rows[(gene, resolved)]

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Handle resolved windows that differ from their donor

When a donor differs at an unambiguous position, resolve_windows() fills only the ambiguous bases and preserves the other positions, so its result need not be a window present in donor_rows. For example, resolving ACGNACGT against donor ACGTTCGT produces ACGTACGT; this lookup then raises KeyError. Such mismatches are allowed by the default divergence limit of 4, so combining valid chunks with --resolve-ambiguous-windows can now abort instead of writing the archive. Track the actual donor separately from the resolved sequence rather than assuming they are identical.

Useful? React with 👍 / 👎.

@wwood
wwood merged commit 8b106a6 into dev Oct 28, 2026
2 checks passed
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.

1 participant