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
14 changes: 8 additions & 6 deletions paper/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -92,11 +92,11 @@ 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 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.
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,
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
Expand All @@ -112,6 +112,8 @@ resource tables beside their condensed version in `supplementary/task_only_analy

`PYTHONPATH=paper/figures python paper/figures/build_slas_task_only.py --submission-summary`
regenerates Figure 5 from the retained score tables and final localization artwork.
Its nuclear-score axis is explicitly truncated; concentration units sit above
horizontal dose ticks so the unchanged localization images can be displayed larger.
`--submission-repairs` regenerates Figure 4 from the frozen first/final detections;
`--input-root` selects an existing hash-checked archived input root. Neither reruns
scientific analysis. `--publish-briefs` exports the original
Expand Down Expand Up @@ -143,7 +145,7 @@ Generators, editable artwork, native captures and provenance receipts are in
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 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
not in the main drug-response figure. Regenerate these two retained-image
composites with `submission_neurite_results` and `public_neurite_initial_comparison`
in `build_slas_visual_story.py`, using the same hash-verified archived input root.
This changes presentation, not any scientific analysis.
Expand Down
48 changes: 25 additions & 23 deletions paper/figures/build_slas_neurite_effects.py
Original file line number Diff line number Diff line change
Expand Up @@ -165,31 +165,33 @@ def draw_correlations(cls, sheet, tables, *, bounds=(0.40, 0.17, 0.48, 0.60)):

@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."""
bounds=(.14, .345, .80, .13), start_letter="E"):
"""Group treatments and primary endpoints on one correlation axis."""
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)
groups = [(condition, metric, values)
for condition, rows in panels.items()
for metric, values in zip(metrics, rows, strict=True)]
axis = sheet.plot_axes(bounds)
bar_width = .8 / len(labels)
for run, (label, colour) in enumerate(zip(labels, cls.analysis_colours, strict=True)):
positions = [index + (run - (len(labels) - 1) / 2) * bar_width
for index in range(len(groups))]
bars = axis.bar(positions, [values[run] for _, _, values in groups],
width=bar_width * .9, color=colour, label=label, zorder=3)
axis.bar_label(bars, fmt="%.3f", label_type="center", rotation=90,
fontsize=12, fontweight="bold", color="white")
axis.set(ylim=(min(0, *(value for _, _, values in groups for value in values)), 1.20),
yticks=(0, .5, 1), xticks=range(len(groups)),
xticklabels=[f"{cls.condition_title(condition)}\n"
f"{fill(declarations[metric].absolute_label, 16)}"
for condition, metric, _ in groups])
axis.tick_params(labelsize=11.5)
axis.set_title(f"{start_letter} Pearson r against MetaXpress", loc="left",
fontsize=sheet.plot_font_size, fontweight="bold", color=BLUE)
axis.spines[["top", "right"]].set_visible(False)
axis.grid(axis="y", color="#e7ebef", linewidth=.6)
axis.set_axisbelow(True)
return counts

@staticmethod
Expand Down
23 changes: 14 additions & 9 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.77, 0.30, 0.195), (0.79, 0.77, 0.18, 0.16),
(0.33, 0.77, 0.24, 0.195), (0.75, 0.77, 0.22, 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 All @@ -384,8 +384,12 @@ def draw_quantitative(self):
axes[0].annotate(f"{score:.3f}", (score, index), xytext=(5, 0),
textcoords="offset points", va="center", fontsize=sheet.plot_font_size)
axes[0].set(yticks=range(len(points)), yticklabels=[point[0] for point in points],
ylim=(len(points) - 0.5, -0.5), xlim=(0, 1), xticks=(0, 0.5, 1),
xlabel="Caicedo F1")
ylim=(len(points) - 0.5, -0.5), xlim=(0.77, 0.94), xticks=(0.8, 0.85, 0.9),
xlabel="Caicedo F1 · truncated axis")
for left in (0, 0.035):
axes[0].plot((left - 0.012, left + 0.012), (-0.014, 0.014),
transform=axes[0].transAxes, color="black", linewidth=1,
clip_on=False, zorder=4)
axes[0].grid(axis="x", color="#e7ebef", linewidth=0.6)
axes[1].grid(axis="y", color="#e7ebef", linewidth=0.6)
# Decode the two existing publication tables; their units and populations differ
Expand Down Expand Up @@ -417,11 +421,12 @@ def draw_quantitative(self):
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} · Z′ = {assay.control_zprime:.3f}",
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(xticks=range(9), xticklabels=[f"{dose.concentration:g}" for dose in assay.doses],
xlabel=f"Concentration ({assay.unit.replace('uM', 'µM')})", ylim=(-0.5, 2.7))
axis.tick_params(axis="x", labelrotation=45)
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)
axis.grid(axis="y", color="#e7ebef", linewidth=0.6)
axis.set_axisbelow(True)
Expand All @@ -431,8 +436,8 @@ def draw_quantitative(self):
def draw_localization(self):
evaluation_path = ROOT / SOURCE_DIRECTORY / "h002-fresh15-postfreeze-evaluation.json"
self.source(evaluation_path)
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))
self.text(3, 48, "D 3D nuclear localization", size=14, weight="bold")
self.artwork("h002_measurement_first", (3, 0.8, 94, 45.5), crop=(1, 7.5, 99, 58))


class RepairResultsFigure(VolumeResultsFigure):
Expand Down
22 changes: 12 additions & 10 deletions paper/figures/build_slas_visual_story.py
Original file line number Diff line number Diff line change
Expand Up @@ -779,24 +779,26 @@ def personal_stitched_development():


def submission_neurite_results(*, input_root: Path = FigureSheet.default_input_root):
"""Summarize primary drug responses and their method correlations."""
"""Pair primary responses and grouped correlations with retained microscopy."""
from build_slas_neurite_effects import NeuriteEffectFigure

sheet = FigureSheet("submission_neurite_results", "", 6.8, input_root=input_root)
blind_neurite_example(input_root=input_root)
sheet = FigureSheet("submission_neurite_results", "", 10.3, input_root=input_root)
tables = NeuriteEffectFigure.cohort_tables(sheet)
NeuriteEffectFigure.draw_panels(
sheet, tables, metrics=NeuriteEffectFigure.primary_metrics,
bounds=(3, 29, 94, 70), start_letter="A",
bounds=(3, 50, 94, 49), start_letter="A",
)
NeuriteEffectFigure.draw_correlation_bars(
sheet, tables, metrics=NeuriteEffectFigure.primary_metrics,
)
sheet.source(OUTPUT / "blind_neurite_example_provenance.json")
sheet.source_image(OUTPUT / "blind_neurite_example.png", (3, 1, 94, 26.5))
sheet.save(dpi=600)
blind_neurite_example(input_root=input_root)


def blind_neurite_example(*, input_root: Path = FigureSheet.default_input_root):
"""Keep the original field available as linked data without another main panel."""
"""Render the original field once for main Figure 6 and full-resolution data."""
from build_slas_neurite_views import AcquisitionNeuriteView

sheet = FigureSheet("blind_neurite_example", "", 3.2, input_root=input_root)
Expand All @@ -806,9 +808,9 @@ def blind_neurite_example(*, input_root: Path = FigureSheet.default_input_root):
sheet.source(views_path)
laboratory_view = AcquisitionNeuriteView(sheet, json.loads(views_path.read_text())["blind_cohort"])
laboratory_view.draw_columns((3, 1, 94, 85), 94, (
("A Raw", laboratory_view.draw_raw),
("B Labels and paths", laboratory_view.draw_result),
("C Overlay", laboratory_view.draw_overlay),
("F Raw", laboratory_view.draw_raw),
("G Labels and paths", laboratory_view.draw_result),
("H Overlay", laboratory_view.draw_overlay),
))
# Preserve the 1024-pixel field in the manuscript's raster embedding too.
sheet.save(dpi=600)
Expand Down Expand Up @@ -897,8 +899,8 @@ def submission_autonomous_loop():
((82.5,64),(82.5,60)), ((68,53.5),(64,53.5)),
((35,53.5),(31,53.5))):
sheet.arrow(start, end)
sheet.route(((49.5,60),(49.5,61),(66,61),(66,80),(82.5,80),(82.5,77)), color=ORANGE, dashed=True)
sheet.text(49.5, 61.5, "Return to 3: build and run", size=9, ha="center", color=ORANGE,
sheet.route(((49.5,60),(49.5,62),(70,62),(70,64)), color=ORANGE, dashed=True)
sheet.text(48, 61.0, "Return to 3: build and run", size=9, ha="right", color=ORANGE,
bbox={"facecolor": "white", "edgecolor": "none", "pad": 0})
sheet.crop_vertical(.45, .815)
sheet.save()
Expand Down
Binary file modified paper/figures/slas/blind_neurite_example.pdf
Binary file not shown.
Binary file modified paper/figures/slas/blind_neurite_example.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Loading