Repository navigation
Conversation
…1014) Extend the tHMM to reconstructed phylogenies: - Per-edge transition matrices exp(Q t_e) in the E-step (shared T still supported) and an exact endpoint-conditioned EM update for Q (lineage/ctmc.py). - Edge-wise joint posteriors and switch-count summaries. - Multivariate Gaussian emission with NaN-as-unobserved handling. - Log-space emission likelihoods and a log-space upward pass, needed for high-dimensional embeddings and for polytomies with thousands of children. - Newick / networkx / CassiopeiaTree loader with pruning, unifurcation collapse, leaf alignment and mutation-count branch lengths. - PhyloHMM model class, simulator, and parsimony / PATH-style baselines. Add analysis/kptracer with a simulation study, scalability benchmark, KP-Tracer model selection, cluster-anchored and unsupervised fits, tumor bootstrap, comparisons with Fitch parsimony, PATH-style auto-correlation and the published plasticity scores, and REPORT.md. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01A7EXGcBoM1ESZnrruqPQff
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01A7EXGcBoM1ESZnrruqPQff
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01A7EXGcBoM1ESZnrruqPQff
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR works through #1014, apart from the spatial stretch goals (skipped as requested) and the baseMEMOIR stretch goal (it needs 290 GB of raw images). The full write-up, with figures, is in
analysis/kptracer/REPORT.md.Model changes (
lineage/)ctmc.py.StateDistributionGaussian): diagonal plus ridge covariance; NaN rows are unobserved, with log-likelihood 0.np.prod.tree_io.py) for Newick, networkx orCassiopeiaTree. It prunes, collapses unifurcations, aligns leaves to AnnData, and computes LCA alleles and mutation-count branch lengths.PhyloHMM(phyloHMM.py) runs EM and reports BIC, held-out likelihood and the lineage-information gain.phylo_sim.pyis the simulator.phylo_stats.pyholds the Fitch/Sankoff and PATH-style baselines.Findings (details in the report)
Notes for review
results/*.pkl) are git-ignored. The data come from Zenodo 5847462; the steps are inanalysis/kptracer/README.md.prepare_data.pyneedsanndata(uv run --with anndata), so it has a ty ignore on that import. No new dependencies were added.uv.lockchange is not part of this PR.🤖 Generated with Claude Code
https://claude.ai/code/session_01A7EXGcBoM1ESZnrruqPQff