Repository navigation
Conversation
…lysis (#1016) - CensoredWeibullGaussian emission: Gaussian biosensor readout with a right-censored Weibull lifetime, and a safeguarded Newton-Raphson profile-likelihood M step for the Weibull (weibullFit). - Baum-Welch options for per-condition transition matrices, identical-row (non-heritable) transition matrices, freely estimated root-state distributions, and warm starts. - heritability: persistence and memory half-lives, dose sweep with likelihood-ratio tests for dose dependence and heritability, lineage bootstrap, and exact per-edge commitment posteriors. - early_biomarker: out-of-fold forecasting of daughter escape from the mother's phenotype, against logistic and single-feature baselines. - palbociclib_loader: Spencer-lab MCF10A CDK4/6i live-imaging data (BioStudies S-BSST167); the accessions named in the issue do not hold the described data. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01MTbZnG5sNwnZBR9uQerm2D
…nsitivity check - Parallelize warm starts alongside random restarts in fit_best. - Figure 22: emissions, lifetime fit, per-dose persistence with bootstrap CIs, memory eigenvalue vs the no-memory model, per-dose ROC, and BIC. - Sensitivity refit dropping root lifetimes, which are selected on division, with a calibration check on cells born into drug. - Commit the analysis results so the figure builds without the ~90 min run. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01MTbZnG5sNwnZBR9uQerm2D
…2020) MCF10A DHB lineages with MEKi or ERKi on for 1, 3, 6, 9 h or left on, ~33 h of imaging after drug and up to 3-4 generations below each root. - mitogen_loader: plate map, per-cell table (shipped, 4.6 MB), lineages. - mitogen_analysis: per-drug dose sweep over exposure with truncated roots, lineage bootstrap, division calibration, refits under the other root treatments, and model-free relative correlations. Lineages are subsampled to 2,500 per condition to keep EM tractable. - Figure 23. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01MTbZnG5sNwnZBR9uQerm2D
10 tasks
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.
Implements #1016: a right-censored Weibull + Gaussian biosensor emission, the Weibull M-step solver, and the heritability / dose-sweep / early-biomarker analysis. The analysis runs on two public Spencer-lab lineage datasets, and the findings below include where they fall short of what the issue hoped to answer.
sc-reportersuser/org.I found no public dataset that combines MCF7/T47D, a palbociclib dose series, lineage tracking, and a per-cell CDK2/DHB trace. The issue's wording most resembles Zikry et al. 2024 (Purvis lab; T47D at 0/10/100 nM palbociclib), but that is fixed-cell 4i imaging, with no time axis and no lineages.
Data used instead
A literature search turned up five public Spencer-lab deposits, all EBI BioStudies (S-BSST21, 167, 231, 314, 439). All are MCF10A with 12-min frames and the same
tracedata/genealogyformat. Their multi-day drug-escape movies (Yang 2021 Nat Commun, Hoffman 2023 Sci Signal, 90–96 h on drug) are "available upon request" only.1. Palbociclib: Miller et al. 2018, Cell Reports, Fig. 3A (S-BSST167). DHB-mVenus, 248 frames, drug at frame 135; vehicle vs 1 µM palbociclib.
2. MEK/ERK inhibitor exposure series: Min et al. 2020, Science, Fig. 1 (S-BSST314). DHB, 257 frames at a stated 12 min.
What's added
Emission and fitting
lineage/states/CensoredWeibullGaussian.py:N(x | μ, σ) · f_W(t)^δ · S_W(t)^(1−δ).[x, t, δ]. NaN drops a factor; a negativetis the usual cross-validation mask. It also handles end-of-experiment censoring for simulation.[x, t, δ, t_lo, t_hi]: the Weibull factor is divided byS(t_lo) − S(t_hi), for cells in the data only because their lifetime ended inside a window. NaN means no bound; further columns are ignored.lineage/states/weibullFit.py: the weighted censored Weibull MLE.Baum-Welch options (
BaumWelch.py,Analyze.py; defaults unchanged)shared_T=False: a separate transition matrix per condition.independent_T=True: all rows of T equal, i.e. the no-inheritance null.estimate_pi=True: the exact EM update for the root-state distribution.random_init=False: warm starts;restarts=: number of random restarts.split_phases = Falseso that a six-column observation isn't read as G1/G2 phases.The default (π = stationary distribution of T) is not an EM step and can lower the likelihood. That broke nesting in the likelihood-ratio tests, which is why the analysis uses
estimate_pi=True.Root selection. Every lineage root is in the data because it divided between drug addition and the end of the movie.
build_lineages(..., roots=)handles this in one of three ways:"truncate"(default): truncates the root's lifetime to that window. With free π this is the exact likelihood given selection."keep": takes root lifetimes at face value (the previous behavior)."drop": removes root lifetimes.Analysis modules
lineage/heritability.py:ln ½ / ln T_kk; memory eigenvalue λ₂ and its half-life;dose_sweep: per-dose, shared, and identical-row T fits with parallel, cross-seeded restarts, then LRTs for dose dependence and heritability;lineage/early_biomarker.py: out-of-fold forecasts of daughter escape from the mother's(x_p, t_p).lineage/palbociclib_loader.pyandlineage/mitogen_loader.pyparse the raw.matmovies.lineage/palbociclib_analysis.py→ figure 22 (plussensitivity, which refits under all three root treatments).lineage/mitogen_analysis.py→ figure 23. It fits each drug's exposure series, with a bootstrap (96 resamples), refits under the other two root treatments, and CDK2-rate correlations between relatives as a model-free check.Tests: 128 total, all passing. They cover:
ruff and ty are clean.
Findings
Palbociclib (S-BSST167)
Data: 6,697 control and 1,913 palbociclib lineages (20,709 / 5,761 cells). Two states:
BIC keeps falling up to 4 states, which with ~26k cells is largely extra Gaussians fitting the skewed rate distribution, so I didn't interpret K > 2.
Main fit, roots truncated; 95% CIs from 200 lineage resamples:
Dose-dependence LRT: p = 5×10⁻⁴¹.
How roots are treated decides whether heritability shows up:
Early biomarker (palbociclib, n = 187 mother–daughter pairs). Pooled AUCs are confounded, because escape is 75% in control vs 26% under drug, so these are per dose:
MEK / ERK inhibitor exposure series (S-BSST314)
Emissions separate the same two states as in the palbociclib data: CDK2 rate 0.05 vs 0.29 per hour, and mean lifetime effectively infinite vs 18 h.
T₂₂ bootstrap CIs are ±0.01–0.05 (figure 23c–d).
Not done
🤖 Generated with Claude Code
https://claude.ai/code/session_01MTbZnG5sNwnZBR9uQerm2D