Repository navigation
Archive OTU table v6: record frameshift repairs as per-read variants - #326
Conversation
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
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
…-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
|
@codex review |
There was a problem hiding this comment.
💡 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".
| # 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)] |
There was a problem hiding this comment.
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 👍 / 👎.
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