Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
34 changes: 21 additions & 13 deletions paper/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ The remaining author questions are factual, not unfinished prose:
labels describe the acquisition correctly. Methods now reports the recorded
Axio Observer.Z1 / 7 stand, LSM 800 system and Plan-Apochromat 20×/0.8 M27 air
objective. One detector is labelled LSM 900; the immutable acquisition record
in Supp. Data 8 preserves both fields. Mouse species is not inferred.
in Supp. Data 5 preserves both fields. Mouse species is not inferred.
- Supply the authorized Zenodo account/deposit route and confirm creators and
rights for the selected archive. The existing procedure is in
`supplementary/archive_publication.rst`; no issued OpenHCS DOI is yet verified.
Expand Down Expand Up @@ -92,9 +92,16 @@ with a fixed serial estimate compared with measured workers (Figure 3); the
agent analysis procedure beside bright-object, nuclear, retinal and
three-dimensional body repairs (Figure 4); quantitative endpoints and final
three-dimensional nuclear localization (Figure 5); and treatment responses from
three independent blind agents with matched microscopy views (Figure 6).
Table 1 distinguishes development access, comparison populations, references and metrics for the main agent results. Supp. Table 5 retains the timing boundaries moved out of the main text. Supp. Table 4 retains the complete 27-row task/model/protocol mapping; principal assay findings remain in their Results subsections and figures.
Full trial results and reference types are retained in Supplementary Data 8, including all three original final BBBC039 pipelines. Analysis 4's byte-identical source recovery is bound to its native readback and closing SHA256 record; it is not a new experiment. Figure 4C places the matched retinal triptych in one full-width row, with the separate body comparison beneath it.
three independent blind agents with compact treatment-specific correlation bars
(Figure 6). Matched microscopy and the detailed scientist-assisted neurite
comparison remain linked data rather than repeated reading-copy panels.
Table 1 distinguishes development access, comparison populations, references and
metrics for the main agent results. Supp. Table 3 defines timing boundaries.
The complete [27-row task/model/protocol mapping](supplementary/analysis_protocols.md)
and [seven-row software-check table](supplementary/software_check_coverage.md)
are downloadable data linked from the supplement; every row and source link is
retained. Principal assay findings remain in their Results subsections and figures.
Full trial results and reference types are retained in Supplementary Data 5, including all three original final BBBC039 pipelines. Analysis 4's byte-identical source recovery is bound to its native readback and closing SHA256 record; it is not a new experiment. Figure 4C places the matched retinal triptych in one full-width row, with the separate body comparison beneath it.
Six supplementary figures group wider views by assay and retain
runtime explanations, measured worker scaling and prospective held-out results.
Measurement definitions precede the neurite plots; nuclear-error observations
Expand Down Expand Up @@ -135,7 +142,7 @@ Generators, editable artwork, native captures and provenance receipts are in
`figures/`. Scientific examples in this revision use public CellProfiler workflows
and the retained public NeuronCyto II demonstration. Figure receipts distinguish
historical analysis from later authoring and viewer checks. The initial public
NeuronCyto comparison is retained in [Supplementary Data 4](supplementary/analysis_records.md#supplementary-data-4-public-neuroncyto-demonstration-and-references),
NeuronCyto comparison is retained in [Supplementary Data 7](supplementary/analysis_records.md#supplementary-data-7-public-neuroncyto-demonstration-and-references),
not in the main drug-response figure. Regenerate only those two relocated
composites with `submission_neurite_results` and `public_neurite_initial_comparison`
in `build_slas_visual_story.py`, using the same hash-verified archived input root.
Expand Down Expand Up @@ -206,7 +213,7 @@ through `RepeatedSourceNativeBatchReport.projected_fresh_batch`; the painter
contains no timing model. Its CSV distinguishes estimated serial CellProfiler
seconds, measured OpenHCS seconds and their ratio. The CellProfiler estimate
stays identical across worker counts; workers are not matched core allocations.
Supplementary Figure 6 separately shows measured OpenHCS-only worker scaling.
Supplementary Figure 3 separately shows measured OpenHCS-only worker scaling.

The per-module CSV names the credited behavior and test. Shared-path coverage
does not claim validation of all module-specific algorithms or settings.
Expand Down Expand Up @@ -255,15 +262,16 @@ retinal/volume panels reuse their hash-checked retained artwork through
`SupplementFigure.artwork`, cropping headings/white margins without changing
raw windows, image regions or scientific pixels. Volume bars use voxel
indices because physical spacing is unverified; retinal bars use the original
CZI calibration. Laboratory neurite bars retain their 200-pixel geometry and
show 271 µm, derived from the hash-checked acquisition declaration; the public
CZI calibration. Nine-field laboratory neurite bars retain their 200-pixel geometry and
show 271 µm, derived from the hash-checked acquisition declaration; the separate
blind-cohort view uses the same calibration owner for its 200 µm bar; the public
NeuronCyto view retains pixel units because its physical calibration is unverified.
`RepairResultsFigure` in `build_slas_task_only.py` draws Figure 4: a compact
procedure strip and the four matched repair examples, inheriting retinal/body
`RepairResultsFigure` in `build_slas_task_only.py` draws Figure 4: the six-stage
procedure and the four matched repair examples, inheriting retinal/body
drawing from `VolumeResultsFigure`. `AnalysisResultsFigure` draws Figure 5:
quantitative endpoints A–C and the final localization views in D. Those views
reuse the retained `MeasurementFirstVolumeFigure` artwork, also preserved in
Supp. Figure 6M–O, and are separate from the body-separation repair. FigureSheet's
reuse the retained `MeasurementFirstVolumeFigure` artwork, also preserved as
full-resolution linked data in Supp. Data 5, and are separate from the body-separation repair. FigureSheet's
vertical canvas crop removes unused space without shrinking the retained axes
or type. Editorial colours and marker styles do not change detections.

Expand Down Expand Up @@ -321,7 +329,7 @@ PYTHONPATH=. python paper/figures/build_slas_benchmark.py \
This historical command reads saved measurements. That checkpoint uses
the logarithmic thirty-workflow view. Its linear counterpart, individual runtime
panels, sample-count trends and selected worker comparisons remain historical
outputs; current Supplementary Figure 6 uses the new complete sweep. Worker comparisons retain their own cohorts and revisions; repeated
outputs; current Supplementary Figure 3 uses the new complete sweep. Worker comparisons retain their own cohorts and revisions; repeated
source assignments are not independent biological wells.

The generic measured-median input mode below supports earlier records with that
Expand Down
76 changes: 57 additions & 19 deletions paper/figures/build_slas_neurite_effects.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,9 @@ class NeuriteEffectFigure(FigureSheet):
"""Retained well tables supply every plotted method and author."""

publication_cohort = ROOT / "paper/supplementary/personal_neurite_reanalysis_20261116"
primary_metrics = ("mean_outgrowth", "branches_per_cell")
analysis_colours = (TEAL, ORANGE, PURPLE)
analysis_markers = ("s", "^", "D")

@classmethod
def cohort_tables(cls, sheet: FigureSheet):
Expand Down Expand Up @@ -112,31 +115,37 @@ def read_datasets(sheet, tables, metrics):
def condition_title(condition):
return "Y27632" if condition == "Y27" else condition

@staticmethod
def draw_correlations(sheet, tables, *, bounds=(0.40, 0.17, 0.48, 0.60)):
@classmethod
def read_correlations(cls, sheet, tables, metrics):
"""One calculation supplies both the summary bars and complete heatmap."""
datasets = cls.read_datasets(sheet, tables, metrics)
values, counts = {}, set()
for condition in sorted({row["condition"] for row in datasets[0][1]}):
selected = [[row for row in wells if row["condition"] == condition]
for _, wells, _, _ in datasets]
counts.update(len(wells) for wells in selected)
values[condition] = [
[correlation([float(row[metric]) for row in wells],
[float(row["openhcs_" + metric]) for row in wells])
for wells in selected]
for metric in metrics
]
return tuple(label for label, _, _, _ in datasets), values, counts

@classmethod
def draw_correlations(cls, sheet, tables, *, bounds=(0.40, 0.17, 0.48, 0.60)):
"""Compare every run and endpoint within each treatment, never pooled."""
declarations = endpoint_declarations()
metrics = tuple(declarations)
datasets = NeuriteEffectFigure.read_datasets(sheet, tables, metrics)
conditions = tuple(sorted({row["condition"] for row in datasets[0][1]}))
labels, panels, counts = cls.read_correlations(sheet, tables, metrics)
x, y, width, height = bounds
gap = .04
panel_width = (width - gap * (len(conditions) - 1)) / len(conditions)
counts = set()
for column, condition in enumerate(conditions):
selected = [(label, [row for row in wells if row["condition"] == condition])
for label, wells, _, _ in datasets]
counts.update(len(wells) for _, wells in selected)
values = [
[correlation([float(row[metric]) for row in wells],
[float(row["openhcs_" + metric]) for row in wells])
for _, wells in selected]
for metric in metrics
]
panel_width = (width - gap * (len(panels) - 1)) / len(panels)
for column, (condition, values) in enumerate(panels.items()):
left = x + column * (panel_width + gap)
axis = sheet.plot_axes((left, y, panel_width, height))
image = axis.imshow(values, vmin=-1, vmax=1, cmap="RdBu", aspect="auto")
axis.set_xticks(range(len(selected)), [label for label, _ in selected],
axis.set_xticks(range(len(labels)), labels,
rotation=45, ha="left", rotation_mode="anchor", fontsize=10)
axis.set_yticks(range(len(metrics)), [declarations[metric].absolute_label for metric in metrics])
axis.xaxis.tick_top()
Expand All @@ -154,6 +163,35 @@ def draw_correlations(sheet, tables, *, bounds=(0.40, 0.17, 0.48, 0.60)):
bar.ax.tick_params(labelsize=10)
return counts

@classmethod
def draw_correlation_bars(cls, sheet, tables, *, metrics,
bounds=(.16, .045, .80, .19), start_letter="E"):
"""Compact primary-endpoint correlations; the heatmap retains all nine."""
labels, panels, counts = cls.read_correlations(sheet, tables, metrics)
declarations = endpoint_declarations()
x, y, width, height = bounds
gap = .14
panel_width = (width - gap * (len(panels) - 1)) / len(panels)
for column, (condition, values) in enumerate(panels.items()):
axis = sheet.plot_axes((x + column * (panel_width + gap), y, panel_width, height))
for run, (label, colour) in enumerate(zip(labels, cls.analysis_colours, strict=True)):
positions = [index * (len(labels) + 1) + run for index in range(len(metrics))]
bars = axis.barh(positions, [row[run] for row in values], height=.8,
color=colour, label=label, zorder=3)
axis.bar_label(bars, fmt="%.3f", padding=3, fontsize=10.5)
axis.set(xlim=(0, 1.20), xticks=(0, .5, 1),
ylim=(len(metrics) * (len(labels) + 1) - 1.4, -.6),
yticks=[index * (len(labels) + 1) + (len(labels) - 1) / 2
for index in range(len(metrics))],
yticklabels=[fill(declarations[metric].absolute_label, 14) for metric in metrics])
axis.tick_params(labelsize=11)
axis.set_title(f"{chr(ord(start_letter) + column)} {cls.condition_title(condition)} · Pearson r",
loc="left", fontsize=sheet.plot_font_size, fontweight="bold", color=BLUE)
axis.spines[["top", "right"]].set_visible(False)
axis.grid(axis="x", color="#e7ebef", linewidth=.6)
axis.set_axisbelow(True)
return counts

@staticmethod
def draw_panels(
sheet: FigureSheet,
Expand All @@ -167,8 +205,8 @@ def draw_panels(
datasets = NeuriteEffectFigure.read_datasets(sheet, tables, metrics)
_, wells, effects, evidence = datasets[0]
series = [("MetaXpress", wells, effects, "metaxpress", "", BLUE, "o")]
colours = (TEAL, ORANGE, PURPLE)
markers = ("s", "^", "D")
colours = NeuriteEffectFigure.analysis_colours
markers = NeuriteEffectFigure.analysis_markers
for index, (label, author_wells, author_effects, _) in enumerate(datasets):
series.append(
(
Expand Down
8 changes: 4 additions & 4 deletions paper/figures/build_slas_supplement.py
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,7 @@ def localisation_diagnostic():
scores = evaluation["scores"]
thresholds = sorted(map(int, scores))
errors = [scores[str(threshold)]["mean_localisation_error_voxels"] for threshold in thresholds]
sheet.heading("P Nuclear localization: a partial-reference diagnostic", 98)
sheet.heading("M Nuclear localization: a partial-reference diagnostic", 98)
axis = sheet.plot_axes((0.17, 0.23, 0.73, 0.55))
axis.plot(thresholds, errors, "o-", color=TEAL)
for threshold, error in zip(thresholds, errors, strict=True):
Expand All @@ -166,11 +166,11 @@ def autonomous_treatment_endpoints():

for stem, first_letter, metrics in (
("supp_neurite_autonomous_endpoints", "A", ("cell_count", "total_outgrowth",
"branches_per_cell", "mean_process_length")),
("supp_neurite_autonomous_endpoints_continued", "I", ("median_process_length", "total_branches",
"mean_process_length")),
("supp_neurite_autonomous_endpoints_continued", "G", ("median_process_length", "total_branches",
"total_processes", "branches_per_process")),
):
autonomous = SupplementFigure(stem, 10.4)
autonomous = SupplementFigure(stem, 2.0 * len(metrics) + 2.4)
autonomous.heading("Fixed-code re-evaluation of three frozen analyses", 99)
NeuriteEffectFigure.draw_panels(
autonomous, NeuriteEffectFigure.cohort_tables(autonomous),
Expand Down
35 changes: 13 additions & 22 deletions paper/figures/build_slas_task_only.py
Original file line number Diff line number Diff line change
Expand Up @@ -363,7 +363,7 @@ def draw_quantitative(self):
for path in sources:
sheet.source(ROOT / path)
axes = [sheet.plot_axes(bounds) for bounds in (
(0.33, 0.80, 0.30, 0.17), (0.79, 0.80, 0.18, 0.145),
(0.33, 0.77, 0.30, 0.195), (0.79, 0.77, 0.18, 0.16),
)]
sheet.text(3, 99, "A Nuclear segmentation · official test", size=sheet.plot_font_size, weight="bold", va="top")
sheet.text(69, 99, "B Cell boundaries", size=sheet.plot_font_size, weight="bold", va="top")
Expand Down Expand Up @@ -409,10 +409,10 @@ def draw_quantitative(self):
axes[1].set(xticks=(0, 1), xticklabels=("2", "3"), xlabel="Analysis", ylim=(0.55, 0.90),
ylabel="Border support\n(2-pixel fraction)")

sheet.text(3, 75.5, "C Nuclear-to-cytoplasmic GFP", size=sheet.plot_font_size, weight="bold")
sheet.text(3, 68, "C Nuclear-to-cytoplasmic GFP", size=sheet.plot_font_size, weight="bold")
series = AssaySeries.load(SOURCE)
for column, (assay, color) in enumerate(zip(series, (BLUE, TEAL), strict=True)):
axis = sheet.plot_axes((0.12 + column * 0.49, 0.625, 0.34, 0.08))
axis = sheet.plot_axes((0.12 + column * 0.49, 0.545, 0.34, 0.09))
means = [np.mean([MedianLog2Ratio().value(well) for well in dose.wells]) for dose in assay.doses]
deviations = [np.std([MedianLog2Ratio().value(well) for well in dose.wells], ddof=1) for dose in assay.doses]
axis.errorbar(range(9), means, yerr=deviations, marker="o", markersize=4,
Expand All @@ -431,51 +431,42 @@ def draw_quantitative(self):
def draw_localization(self):
evaluation_path = ROOT / SOURCE_DIRECTORY / "h002-fresh15-postfreeze-evaluation.json"
self.source(evaluation_path)
evaluation = json.loads(evaluation_path.read_text())
threshold = evaluation["primary_threshold_voxels"]
result = evaluation["scores"][str(threshold)]
self.text(3, 52, "D 3D nuclear localization", size=14, weight="bold")
self.artwork("h002_measurement_first", (3, 8, 94, 39), crop=(1, 7.5, 99, 58))
self.text(50, 5,
f"{result['true_positives']}/{result['reference_points']} reference centres matched within "
f"{threshold} voxels; {result['false_positives']} unmatched predictions",
size=12, ha="center", weight="bold", color=TEAL)
self.text(50, 1.5, "Partial reference annotations; physical voxel spacing unverified",
size=11, ha="center")
self.text(3, 41.5, "D 3D nuclear localization", size=14, weight="bold")
self.artwork("h002_measurement_first", (3, 0.8, 94, 39), crop=(1, 7.5, 99, 58))


class RepairResultsFigure(VolumeResultsFigure):
"""Four separate recorded repairs, retaining their original image regions."""

def draw_panels(self):
self.artwork("submission_autonomous_loop", (2, 70, 96, 29))
self.artwork("submission_autonomous_loop", (2, 67, 96, 32))
self.draw_repairs()
super().draw_panels()

def draw_repairs(self):
self.source(Path(__file__))
self.source(ROOT / H001_SOURCE)
self.text(2, 67.5, "A Bright-object repair", size=14, weight="bold")
self.text(2, 65.2, "A Bright-object repair", size=14, weight="bold")
evaluation = load_bright_object_evaluation(ROOT)
first_f1, final_f1 = (attempt["derived_f1"] for attempt in evaluation["attempts"])
self.text(48, 67.5, f"F1 {first_f1:.3f} → {final_f1:.3f}",
self.text(48, 65.2, f"F1 {first_f1:.3f} → {final_f1:.3f}",
size=10, color=TEAL, weight="bold", ha="right")
CroppedComparison.read(self, BRIGHT_OBJECT_SOURCE).draw_row((2, 51.3, 46, 10.2), 64)
self.text(52, 67.5, "B Nuclear separation", size=14, weight="bold")
CroppedComparison.read(self, NUCLEAR_SOURCE).draw_row((52, 48, 46, 13.5), 64)
CroppedComparison.read(self, BRIGHT_OBJECT_SOURCE).draw_row((2, 51.3, 46, 10.2), 62.5)
self.text(52, 65.2, "B Nuclear separation", size=14, weight="bold")
CroppedComparison.read(self, NUCLEAR_SOURCE).draw_row((52, 48, 46, 13.5), 62.5)


def submission_summary() -> None:
"""Render Figure 5 without rerunning an analysis or changing its scores."""
sheet = AnalysisResultsFigure("submission_analysis_summary", 8.6)
sheet = AnalysisResultsFigure("submission_analysis_summary", 7.6)
sheet.draw_panels()
sheet.save(dpi=400)


def submission_repairs(*, input_root: Path = FigureSheet.default_input_root) -> None:
"""Render Figure 4 from the same frozen first/final image regions."""
submission_autonomous_loop()
sheet = RepairResultsFigure("submission_analysis_repairs", 9.8, input_root=input_root)
sheet = RepairResultsFigure("submission_analysis_repairs", 10.5, input_root=input_root)
sheet.draw_panels()
sheet.save(dpi=400)

Expand Down
Loading
Loading