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
6 changes: 3 additions & 3 deletions paper/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ three-dimensional nuclear localization (Figure 5); and treatment responses from
three independent blind agents with one grouped treatment-specific correlation
axis and matched raw/detection/overlay views (Figure 6). Full-resolution microscopy
and the detailed scientist-assisted neurite comparison remain linked data.
Supp. Table 6 retains the complete evaluation design: development access,
Supp. Table 5 retains the complete evaluation design: 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)
Expand Down Expand Up @@ -215,7 +215,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 3 separately shows measured OpenHCS-only worker scaling.
Supplementary Figure 2 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 @@ -331,7 +331,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 3 uses the new complete sweep. Worker comparisons retain their own cohorts and revisions; repeated
outputs; current Supplementary Figure 2 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
8 changes: 6 additions & 2 deletions paper/figures/build_slas_bbbc013_fresh23.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
from pathlib import Path
from statistics import mean, stdev

from build_slas_visual_story import BLUE, TEAL, MUTED, ROOT, FigureSheet
from build_slas_visual_story import BLUE, TEAL, MUTED, ROOT, FigureSheet, unit_label


SOURCE = ROOT / "paper/supplementary/task_only_analysis/bbbc013-fresh23-plot-source.json"
Expand Down Expand Up @@ -65,6 +65,10 @@ class AssaySeries:
negative_control: DoseGroup
positive_control: DoseGroup

@property
def unit_label(self) -> str:
return unit_label(self.unit)

@property
def control_zprime(self) -> float:
negative = [well.median_log2 for well in self.negative_control.wells]
Expand Down Expand Up @@ -152,7 +156,7 @@ def draw_series(self, sheet: FigureSheet, series: tuple[AssaySeries, ...], *,
left * 100, panel_y)
axis = sheet.plot_axes((left, bottom, 0.365, height))
self.draw(axis, assay, color)
axis.set_xlabel(f"Concentration ({assay.unit})")
axis.set_xlabel(f"Concentration ({assay.unit_label})")
axis.tick_params(axis="x", labelrotation=45)


Expand Down
10 changes: 10 additions & 0 deletions paper/figures/build_slas_benchmark_reference.py
Original file line number Diff line number Diff line change
Expand Up @@ -208,6 +208,16 @@ def ratios(mode_name, scope):
y = 68.5 - row * 4.1
sheet.axis.plot(4, y, marker='s', color=coverage_colors[i], markersize=8)
sheet.text(6, y, f'{coverage_labels[i]}: {counts[i]}', size=sheet.plot_font_size, va='center')
# Output agreement comes from the retained 30-workflow comparison, not a typed count.
comparison = ROOT / 'benchmark/results/official30_unified_value_comparison_20260916/observations.csv'
sheet.source(comparison)
with comparison.open(newline='') as stream:
observations = tuple(csv.DictReader(stream))
if {row['case_name'] for row in observations} != set(names):
raise ValueError('Output comparison and timing cohort name different workflows')
matched = sum((row['equivalent'] == 'True' and row['difference_count'] == '0' for row in observations))
sheet.text(3.5, 54.6, f'{matched} / {len(observations)}', size=20, weight='bold', va='center')
sheet.text(19.5, 54.6, 'workflows match\nCellProfiler outputs', size=sheet.plot_font_size, va='center', linespacing=1.15)
sheet.panel_letter('B', 35, 91)
single = tuple((ratios('singlewell', scope) for scope in ('execution', 'total')))
amortized = []
Expand Down
7 changes: 4 additions & 3 deletions paper/figures/build_slas_independent_validation.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
import numpy as np

from build_slas_agent import normalize_generated_svg
from build_slas_visual_story import unit_label

ROOT = Path(__file__).resolve().parents[2]
DATA = ROOT / "paper/supplementary/independent_validation"
Expand Down Expand Up @@ -158,7 +159,7 @@ def plot_translocation(
marker="o",
linewidth=1.7,
capsize=2.5,
label="Held-out wells, mean +/- SD",
label="Held-out wells, mean ± SD",
zorder=3,
)
axis.axhline(
Expand All @@ -179,15 +180,15 @@ def plot_translocation(
axis.text(
0.03,
0.94,
f"Z' = {treatment['z_prime']:.3f}",
f"Z′ = {treatment['z_prime']:.3f}",
transform=axis.transAxes,
fontsize=9.5,
va="top",
)
axis.set(
title=f"{panel} BBBC013 {treatment['treatment']}",
xscale="log",
xlabel=f"Dose ({unit})",
xlabel=f"Concentration ({unit_label(unit)})",
ylabel="Mean nuclear / cytoplasmic GFP",
ylim=(0, None),
)
Expand Down
5 changes: 3 additions & 2 deletions paper/figures/build_slas_neurite_effects.py
Original file line number Diff line number Diff line change
Expand Up @@ -349,11 +349,12 @@ def draw_panels(
zorder=1,
)
axis.axhline(1, color=MUTED, linewidth=0.8, linestyle="--", zorder=0)
is_bottom_row = row + metric_columns >= len(metrics)
axis.set(
xlim=(-0.5, 4.5),
ylim=limits[metric],
ylabel=fill(declarations[metric].label, width=label_width) if column == 0 or metric_columns == 1 else "",
xlabel="Concentration (µM)",
ylabel=fill(declarations[metric].label, width=label_width) if column == 0 else "",
xlabel="Concentration (µM)" if is_bottom_row else "",
)
axis.set_xticks(range(5), [item["dose_uM"] for item in selected])
axis.spines[["top", "right"]].set_visible(False)
Expand Down
34 changes: 17 additions & 17 deletions paper/figures/build_slas_processes.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,13 +13,13 @@ def processes(*, stem="process_architecture", with_logos=False):
# the existing type hierarchy readable without enlarging every label by hand.
sheet.figure.set_size_inches(7, 5.1)
for source in (
"openhcs/runtime/zmq_execution_client.py",
"openhcs/runtime/zmq_execution_server.py",
"openhcs/runtime/zmq_worker_execution.py",
"openhcs/runtime/zmq/zmq_execution_client.py",
"openhcs/runtime/zmq/zmq_execution_server.py",
"openhcs/runtime/zmq/zmq_worker_execution.py",
"openhcs/core/orchestrator/worker_execution.py",
"openhcs/core/steps/function_artifact_materialization.py",
"openhcs/runtime/napari_viewer_server.py",
"openhcs/runtime/fiji_viewer_server.py",
"openhcs/runtime/napari/napari_viewer_server.py",
"openhcs/runtime/fiji/fiji_viewer_server.py",
"docs/source/architecture/zmq_execution_service_extracted.rst",
"docs/source/architecture/streaming_boundary_and_wrappers.rst",
):
Expand Down Expand Up @@ -63,22 +63,22 @@ def processes(*, stem="process_architecture", with_logos=False):
# These marks identify the six array libraries used by ArrayBridge;
# the runtime declarations, not the diagram, determine CPU/GPU support.
for name, label, x in (
("numpy.svg", "NumPy", 4),
("cupy.svg", "CuPy", 13.5),
("pytorch.svg", "PyTorch", 23),
("tensorflow.svg", "TensorFlow", 32.5),
("jax.png", "JAX", 42),
("pyclesperanto.png", "pyclesperanto", 49.8),
("numpy.svg", "NumPy", 3.2),
("cupy.svg", "CuPy", 11.8),
("pytorch.svg", "PyTorch", 20.4),
("tensorflow.svg", "TensorFlow", 29.5),
("jax.png", "JAX", 39.0),
("pyclesperanto.png", "pyclesperanto", 48.8),
):
sheet.asset(logos / name, (x, 34.5, 7, 7))
sheet.text(x + 3.5, 32.5, label, size=8.5, ha="center")
sheet.asset(logos / name, (x, 34.5, 6.8, 6.8))
sheet.text(x + 3.4, 32.5, label, size=8.2, ha="center")
# The retained TensorFlow asset is the official white-on-dark variant.
sheet.axis.add_patch(Rectangle((32.5, 34.5), 7, 7,
sheet.axis.add_patch(Rectangle((29.5, 34.5), 6.8, 6.8,
facecolor=INK, edgecolor="none", zorder=2))
sheet.arrow((71, 66), (60, 57), both=True, color=BLUE)
sheet.text(49, 62, "Work / results", size=9, ha="center", color=BLUE)
sheet.text(62.5, 62.3, "Work / results", size=9, ha="right", color=BLUE)

sheet.text(74, 60, "Viewer processes", size=10, weight="bold", color=TEAL)
sheet.text(74, 59.3, "Viewer processes", size=9.5, weight="bold", color=TEAL)
sheet.axis.add_patch(Rectangle((74, 27), 22, 30, linewidth=1.15,
edgecolor=TEAL, facecolor="white", zorder=2))
sheet.text(82, 51.5, "napari", size=12, weight="bold", color=TEAL, va="center")
Expand All @@ -87,7 +87,7 @@ def processes(*, stem="process_architecture", with_logos=False):
if with_logos:
sheet.asset(logos / "napari.svg", (75.5, 49, 4.5, 5.5))
sheet.asset(logos / "fiji.svg", (75.5, 39.5, 4.5, 5.5))
sheet.arrow((94, 66), (94, 57), both=True, color=BLUE)
sheet.arrow((95.5, 66), (95.5, 57), both=True, color=BLUE)
sheet.arrow((60, 44), (74, 44), color=TEAL)
sheet.text(66.5, 48, "Images\nROIs", size=9, ha="center", color=TEAL)
sheet.arrow((58, 14), (80, 27), both=True, color=TEAL)
Expand Down
31 changes: 17 additions & 14 deletions paper/figures/build_slas_supplement.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,10 +36,10 @@ class VolumeResultsFigure(SupplementFigure):
"""Matched retinal and volume repairs, separate from final-only views."""

def draw_panels(self):
self.panel('C', 'Retinal repair', 2, 45.5, title_size=14)
self.panel('C', 'Retinal repair', 2, 44.4, title_size=14)
for column, (heading, left) in enumerate((('Raw', 3), ('First result', 34.96), ('Final result', 66.92))):
x = 2 + column * 32
self.text(x, 42, heading, size=self.plot_font_size, weight='bold')
self.text(x, 40.9, heading, size=self.plot_font_size, weight='bold')
self.artwork('retina_fresh16_repair', (x, 26, 30.7, 14.5), crop=(left, 22.2, left + 30.08, 45.8))
self.panel('D', '3D body separation', 2, 23.5, title_size=14)
self.text(98, 23.5, 'Z = 36 voxels', size=self.plot_font_size, ha='right')
Expand Down Expand Up @@ -71,7 +71,9 @@ def translocation():
score = load_score(SCORE_PATHS[2], "BBBC013")
sheet.source(SCORE_PATHS[2])
sheet.source(Path(plot_translocation.__code__.co_filename))
for column, (letter, treatment) in enumerate(zip(("C", "D"), score["metrics"]["treatments"], strict=True)):
# Same drug order as A–B and main Figure 5C, so columns compare one compound.
treatments = sorted(score["metrics"]["treatments"], key=lambda treatment: treatment["treatment"])
for column, (letter, treatment) in enumerate(zip(("C", "D"), treatments, strict=True)):
left = .105 + column * .49
sheet.panel(letter, treatment["treatment"], left * 100, 45.5)
axis = sheet.plot_axes((left, .08, .365, .30))
Expand Down Expand Up @@ -127,14 +129,14 @@ def morphology_checks(*, input_root=FigureSheet.default_input_root):
sheet.source(layout_path)
layout = json.loads(layout_path.read_text())
artwork = layout["source_artwork"]
sheet.panel("A–C", "Independent volume analysis: centres in XY, XZ and YZ", 3, 99, va="top")
sheet.panel("A–C", "Independent volume analysis: centres in XY, XZ and YZ", 2, 99, va="top")
for column, field in enumerate(layout["upper_full_fields"][:3]):
sheet.artwork(artwork, (2 + column * 33, 68, 30, 27), crop=field["crop_percent"])
sheet.panel("D–F", "Retinal acquisition border: raw, first and final", 3, 65, va="top")
sheet.artwork(artwork, (2 + column * 33, 69, 30, 26), crop=field["crop_percent"])
sheet.panel("D–F", "Retinal acquisition border: raw, first and final", 2, 66.5, va="top")
for column, field in enumerate(layout["upper_full_fields"][3:]):
x = 2 + column * 33
sheet.text(x, 60, field["label"], size=12, weight="bold")
sheet.artwork(artwork, (x, 37, 30, 21), crop=field["crop_percent"])
sheet.text(x, 60.5, field["label"], size=12, weight="bold")
sheet.artwork(artwork, (x, 37, 30, 21.5), crop=field["crop_percent"])
sheet.panel("G–I", "DNA: a faint pair\nremains merged", 2, 33, va="top")
sheet.panel("J–L", "Actin: a seed without\nsupported body growth", 52, 33, va="top")
for column, field in enumerate(layout["lower_full_fields"]):
Expand Down Expand Up @@ -165,11 +167,12 @@ def localisation_diagnostic(sheet, *, bounds=(0.17, 0.23, 0.73, 0.55)):
axis.plot(thresholds, errors, "o-", color=TEAL)
for threshold, error in zip(thresholds, errors, strict=True):
axis.annotate(f"{scores[str(threshold)]['true_positives']} matches", (threshold, error),
xytext=(10, -10), textcoords="offset points", ha="center", va="top",
fontsize=sheet.plot_font_size)
xytext=(0, -10), textcoords="offset points", ha="center", va="top",
fontsize=sheet.plot_font_size,
bbox={"facecolor": "white", "edgecolor": "none", "pad": 1.2})
axis.axvline(evaluation["primary_threshold_voxels"], color=MUTED, linestyle="--", linewidth=0.8)
axis.set(xlabel="Matching distance (voxels)", ylabel="Mean centre\nerror\n(voxels)",
ylim=(0, 6.1), xticks=thresholds)
xlim=(6.0, 44.0), ylim=(0, 6.1), xticks=thresholds)
axis.spines[["top", "right"]].set_visible(False)
axis.grid(axis="y", color="#e7ebef", linewidth=0.6)
axis.set_axisbelow(True)
Expand All @@ -185,14 +188,14 @@ def autonomous_treatment_endpoints():
metrics = tuple(metric for metric in endpoint_declarations()
if metric not in NeuriteEffectFigure.primary_metrics)
NeuriteEffectFigure.draw_panels(
autonomous, tables, metrics=metrics, bounds=(0, 28, 100, 72),
autonomous, tables, metrics=metrics, bounds=(0, 30, 100, 77),
metric_columns=2, label_width=15,
legend_offset=(.25, -.725), legend_rows=2,
legend_offset=(.25, -.74), legend_rows=2,
)
autonomous.panel("O–P", "Correlations with MetaXpress", 3, 28)
counts = NeuriteEffectFigure.draw_correlations(
autonomous, tables, bounds=(.36, .015, .54, .195),
heading_y=28, font_size=13, label_rotation=0, label_alignment="center",
heading_y=28, font_size=11, label_rotation=0, label_alignment="center",
column_label_width=8,
)
if len(counts) != 1:
Expand Down
16 changes: 9 additions & 7 deletions paper/figures/build_slas_task_only.py
Original file line number Diff line number Diff line change
Expand Up @@ -361,7 +361,7 @@ def draw_quantitative(self):
sheet.source(ROOT / 'paper/figures/build_slas_bbbc013_fresh23.py')
for path in sources:
sheet.source(ROOT / path)
axes = [sheet.plot_axes(bounds) for bounds in ((0.33, 0.77, 0.24, 0.195), (0.75, 0.77, 0.22, 0.16))]
axes = [sheet.plot_axes(bounds) for bounds in ((0.30, 0.735, 0.29, 0.225), (0.75, 0.735, 0.22, 0.2))]
sheet.panel('A', 'Nuclear segmentation · official test', 3, 99, title_size=sheet.plot_font_size, va='top')
sheet.panel('B', 'Cell boundaries', 69, 99, title_size=sheet.plot_font_size, va='top')
for axis in axes:
Expand Down Expand Up @@ -398,14 +398,14 @@ def draw_quantitative(self):
axes[1].plot((index - 0.22, index + 0.22), (pooled, pooled), color=TEAL, linewidth=3)
axes[1].text(index, 0.86, f'{pooled:.3f}', ha='center', fontsize=sheet.plot_font_size)
axes[1].set(xticks=(0, 1), xticklabels=('2', '3'), xlabel='Analysis', ylim=(0.55, 0.9), ylabel='Border support\n(2-pixel fraction)')
sheet.panel('C', 'Nuclear-to-cytoplasmic GFP', 3, 68, title_size=sheet.plot_font_size)
sheet.panel('C', 'Nuclear-to-cytoplasmic GFP', 3, 63.5, title_size=sheet.plot_font_size)
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.545, 0.34, 0.09))
axis = sheet.plot_axes((0.12 + column * 0.49, 0.494, 0.34, 0.095))
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, color=color, capsize=2)
axis.set_title(f'{assay.compound} ({assay.unit.replace('uM', 'µM')}) · Z′ = {assay.control_zprime:.3f}', loc='left', fontsize=sheet.plot_font_size, color=color)
axis.set_title(f'{assay.compound} ({assay.unit_label}) · Z′ = {assay.control_zprime:.3f}', loc='left', fontsize=sheet.plot_font_size, color=color)
tick_doses = assay.doses[::2]
axis.set(xticks=range(0, len(assay.doses), 2), xticklabels=[f'{dose.concentration:g}' for dose in tick_doses], ylim=(-0.5, 2.7))
axis.spines[['top', 'right']].set_visible(False)
Expand All @@ -417,8 +417,10 @@ def draw_quantitative(self):
def draw_localization(self):
evaluation_path = ROOT / SOURCE_DIRECTORY / 'h002-fresh15-postfreeze-evaluation.json'
self.source(evaluation_path)
self.panel('D', '3D nuclear localization', 3, 48, title_size=14)
self.artwork('h002_measurement_first', (3, 0.8, 94, 45.5), crop=(1, 7.5, 99, 58))
self.panel('D', '3D nuclear localization', 3, 43.5, title_size=14)
self.text(9.8, 39.3, 'XY', size=11.5, weight='bold', va='bottom')
self.artwork('h002_measurement_first', (9.8, 1.0, 36.2, 37.5), crop=(8.0, 11.8, 45.0, 57.2))
self.artwork('h002_measurement_first', (52.0, 1.0, 45.0, 40.2), crop=(53.0, 9.0, 99.0, 57.2))


class RepairResultsFigure(VolumeResultsFigure):
Expand All @@ -443,7 +445,7 @@ def draw_repairs(self):

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

Expand Down
Loading
Loading