Skip to content

docs(cladistics): issue 303 experiments on exact Phred arithmetic and lazy tree views - #345

Merged
hyperpolymath merged 1 commit into
mainfrom
claude/focused-meitner-uf53td
Nov 17, 2026
Merged

hyperpolymath merged 1 commit into
mainfrom
claude/focused-meitner-uf53td

Conversation

@hyperpolymath

Copy link
Copy Markdown
Owner

Change and reason

Adds docs/cladistics/issue-303/: seven Julia scripts and a results page recording the measurements that issue #303 asks for before any algorithm change. Fork only. Nothing here is proposed upstream, and no application code, test or configuration changes.

The results page is docs/cladistics/issue-303/README.md. In short:

  • Exact Phred arithmetic. Expected-error sums are exact in ℚ(10^(-1/10)), so the rationals do not need replacing by the reals. On 152,360 real MiSeq_SOP reads the exact filter and double precision agree on every read; the closest read to the threshold is 2.2e-6 away.
  • Distances on demand. On exactly tree-like input the tree is recovered from about n log n distances (0.2% of the matrix at 16,384 leaves). That is the known lower bound for distance queries, not O(n).
  • Lazy views on real reads. At 240 bases the neighbour-joining tree is not stable: a tree built on 768 of 1,024 sequences reproduces 78% of the supported branches of the 1,024-sequence tree. No thumbnail summary tested exceeds 56%. Zoomed-in views reproduce over 90% of supported branches at 384 to 512 sequences but 66% at 1,024, so the smaller figure must not be quoted alone.

This is an adverse result for de novo lazy trees on amplicon reads and is recorded as such.

Validation

Julia 1.12.7, four threads.

  • julia scripts/check-julia-syntax.jl: Julia parser accepted 171 tracked source files.
  • Every script was run and its output is the source of the numbers in the README.
  • zoom_real_1024.jl was re-run from the committed location and reproduced its figures exactly (fixed seeds).
  • Not run: the repository's Julia, R and frontend test suites locally (this change adds documentation and standalone scripts only; CI covers them). No proof was attempted. No comparison with RapidNJ, SwiftNJ or FastTree was made.

Scope

  • The MiSeq_SOP archive is not committed; the README gives its URL and SHA-256.
  • The scripts use only Julia's standard library and are not wired into the application, the test suite or CI.
  • New files carry the fork's usual headers (MPL-2.0 for the scripts, CC-BY-SA-4.0 for the page). Owner to confirm that licence choice; no existing licence text is touched.
  • The folder sits under docs/cladistics/ because .gitignore keeps other docs/ paths local.

Contribution checks

  • I followed CONTRIBUTING.md.
  • This branch starts at current main (b2fe050) and contains no merges.
  • CI has run and passes.
  • Existing licensing, citation and acknowledgement text is unchanged.

Generated by Claude Code

… lazy tree views

Seven Julia scripts and a results page under docs/cladistics/issue-303/.
Fork only; nothing is proposed upstream and the application is unchanged.

Findings, with their limits stated in the README:
- Phred expected errors are exact in Q(10^(-1/10)); on 152,360 real
  MiSeq_SOP reads the exact filter and double precision agree on every read.
- On exactly tree-like input, distances on demand recover the tree from
  about n log n distances; this is the lower bound, not O(n).
- On real 240-base reads the neighbour-joining tree is not stable: a tree
  on 768 of 1,024 sequences reproduces 78% of the supported branches of
  the 1,024-sequence tree. No thumbnail summary tested exceeds 56%, and
  zoomed-in views fall from over 90% at 384-512 sequences to 66% at 1,024.

The dataset is not committed; the README gives its URL and SHA-256.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01J4QvDiW8qD4f2JDQJ4buGo
Copilot AI balanced review requested due to automatic review settings November 17, 2026 00:28
@linear-code
linear-code Bot marked this pull request as ready for review November 17, 2026 00:28

This comment was marked as low quality.

@sonarqubecloud

Copy link
Copy Markdown

Repository owner deleted a comment from coderabbitai Bot Nov 17, 2026
@hyperpolymath
hyperpolymath merged commit 628eeed into main Nov 17, 2026
22 checks passed
@hyperpolymath
hyperpolymath deleted the claude/focused-meitner-uf53td branch November 17, 2026 01:55
hyperpolymath added a commit that referenced this pull request Nov 17, 2026
…ents (#346)

## Change and reason

Follow-up to #345 (merged), for issue #303. Adds
`docs/cladistics/issue-303/placement_evidence.jl` and its results to the
page there. Fork only; nothing is proposed upstream and no application
code changes.

#345 recorded that a stable tree overview cannot be built from 240-base
amplicon reads alone. This tests the alternative with a ground truth:

- 400 real full-length 16S sequences (mothur SILVA bacterial reference
alignment) give a reference tree.
- Each of 150 sequences is pruned in turn; where it hung is the truth.
- Its 240-base fragment is placed back by weighted least squares, with
100 bootstrap replicates giving a placement mass for every clade.
- Verdict for "this sequence belongs to this clade": entailed at mass 1,
refuted at mass 0, unresolved between.

| | Amplicon fragment | Whole sequence (positive control) | A different
sequence placed (negative control) |
| --- | --- | --- | --- |
| Entailed verdicts that are right | 1,105 of 1,106 | 1,411 of 1,412 |
219 of 1,155 |
| Refuted verdicts that are right | 57,116 of 57,128 | 57,731 of 57,735
| 55,604 of 56,974 |
| Smallest entailed clade, median size of 399 | 18 | 7 | 26 |
| Placed on exactly the true edge | 48.0% | 77.3% | 0.0% |

Counted per query, the smallest entailed clade was wrong for 1 of 130
queries; 20 further queries had no entailed clade.

## Validation

Julia 1.12.7, four threads.

- `julia scripts/check-julia-syntax.jl`: `Julia parser accepted 172
tracked source files.`
- The script was run and its output is the source of every number above
and in the README.
- Not run: the repository's Julia, R and frontend suites locally
(documentation and one standalone script only; CI covers them).
- Not tested: the application's own placement step (EPA), real reads
with sequencing error, more than one marker.

## Scope

- The reference alignment is not committed; the README gives its URL and
SHA-256.
- Limits are stated in the README: the truth is defined by a
neighbour-joining tree built from full-length distances; queries are
fragments of reference-quality sequences; placement is least squares,
not EPA; "entailed" is a measured rate, not a proof.
- The counting rule that turns per-read verdicts into a per-sample
verdict is a separate piece of work in
`metadatastician/MetaManifold-Evidence` and is not part of this PR.
- New file carries the fork's usual MPL-2.0 header, as confirmed by the
owner for #345.

## Contribution checks

- [x] I followed CONTRIBUTING.md.
- [x] This branch starts at current main (628eeed) and contains no
merges.
- [ ] CI has run and passes.
- [x] Existing licensing, citation and acknowledgement text is
unchanged.

---
_Generated by [Claude
Code](https://claude.ai/code/session_01J4QvDiW8qD4f2JDQJ4buGo)_

Co-authored-by: Claude <noreply@anthropic.com>
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.

4 participants