Skip to content

dev: standalone compare_tables.py (ASV-table jaccard/count equivalence)#58

Merged
cjfields merged 1 commit into
mainfrom
dev/compare-tables-script
Jun 21, 2026
Merged

dev: standalone compare_tables.py (ASV-table jaccard/count equivalence)#58
cjfields merged 1 commit into
mainfrom
dev/compare-tables-script

Conversation

@cjfields

Copy link
Copy Markdown
Member

Summary

Pulls the ASV-table equivalence check that bench_pooled.py currently only emits inside its WFA sweep CSV (jaccard_vs_nw / count_frac_vs_nw) into a small standalone script, so any two-or-more seqtab(_nochim).json runs can be compared directly — nw vs wfa arms, k5 vs k7, pool modes — without re-running a sweep.

load_table / table_equiv are kept byte-for-byte identical to bench_pooled.py, so the numbers match that CSV exactly (verified on the PacBio pseudo sweep: e0 jaccard 0.9499 / count_frac 0.7309, e30 0.9989).

Output

baseline: nw = .../nw/seqtab_nochim.json  (1901 ASVs)

label    ASVs  jaccard  count_frac  +only  -only identical
----------------------------------------------------------
  e30    1899   0.9989      0.9747      0      2     False
   e0    1989   0.9499      0.7309     94      6     False
  • count_frac = the CSV's count_frac_vs_nw (fraction of shared ASVs with identical per-sample counts).
  • +only / -only = ASVs the comparison has that the baseline lacks / vice-versa (surfaces the over-call signature — e0 invents 94 ASVs the NW table lacks).
  • --abundance N restricts to ASVs with total count >= N (mirrors MIN_ABUNDANCE).

Complements compare_asvs.py (the richer abundance-stratified churn + nearest-neighbour Hamming characterizer); this is the quick jaccard/count equivalence check.

Test plan

  • Reproduces the sweep CSV jaccard/count_frac exactly on tmp/pb_k7_pseudo.
  • Both --abundance N and --abundance=N forms parse correctly.

🤖 Generated with Claude Code

…lence)

Pulls the table-equivalence check that bench_pooled.py only emits inside its WFA
sweep CSV (jaccard_vs_nw / count_frac_vs_nw) into a standalone script so any two+
seqtab(_nochim).json runs can be compared directly — nw vs wfa arms, k5 vs k7,
pool modes — without re-running a sweep. load_table/table_equiv are byte-for-byte
identical to bench_pooled.py so numbers match that CSV exactly (verified on the
PacBio pseudo sweep: e0 jac 0.9499/count 0.7309, e30 0.9989). Adds +only/-only
ASV deltas and an optional --abundance filter mirroring MIN_ABUNDANCE.

Complements compare_asvs.py (the richer churn/Hamming characterizer); this is the
quick equivalence check.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@cjfields cjfields merged commit 864507a into main Jun 21, 2026
7 checks passed
@cjfields cjfields deleted the dev/compare-tables-script branch June 21, 2026 05:23
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