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
32 changes: 28 additions & 4 deletions paper/figure2_alphafold_start/analysis/aggregate_figure_metrics.py
Original file line number Diff line number Diff line change
Expand Up @@ -196,8 +196,19 @@ def percycle_refmac(engine: str, code: str):
return out


_RE_PHENIX_FINAL = re.compile(
r"^\s*Final R-work\s*=\s*([0-9.]+)\s*,\s*R-free\s*=\s*([0-9.]+)", re.M
)


def _phenix_final_r(lines):
"""``(r_work, r_free)`` from the log's ``Final R-work = ..., R-free = ...`` summary."""
m = _RE_PHENIX_FINAL.search("\n".join(lines))
return (float(m.group(1)), float(m.group(2))) if m else None


def percycle_phenix(engine: str, code: str):
"""Phenix per-macrocycle R-FACTORS (work/free in %) from the 'bonds angl' blocks.
"""Phenix per-macrocycle R-factors (work/free, already fractions) from the 'bonds angl' blocks.

Each block's *first* row is the state at the start of that macrocycle and the
*last* row is the post-(geometry-)refinement state. Per Phenix's own legend,
Expand All @@ -220,7 +231,11 @@ def percycle_phenix(engine: str, code: str):
row = None
if len(toks) >= 5:
try:
row = (float(toks[0]) / 100.0, float(toks[1]) / 100.0)
# The log prints fractions, not percent: "work free delta bonds angl"
# / " 0.3234 0.3388 0.0154 0.014 1.3", against that run's own
# "Final R-work = 0.2212". A /100 here made every phenix trajectory
# ~0.003, so Panel D's guard dropped the curve and the legend read n=0.
row = (float(toks[0]), float(toks[1]))
except ValueError:
row = None
if row is not None:
Expand All @@ -235,8 +250,17 @@ def percycle_phenix(engine: str, code: str):
blocks.append((first, last))
if not blocks:
return []
# cycle 0 = pre-refinement start, then end-of-each-macrocycle
series = [blocks[0][0]] + [b[1] for b in blocks]
# One row per block, so each block IS a cycle: its row is the state at the START of
# that macrocycle, i.e. the END of the previous one. Block 0 is therefore cycle 0, the
# post-scaling starting state and the analogue of Refmac's Ncyc row 0 (the log's
# "Start R-work" is pre-bulk-solvent and not comparable). Emitting blocks[0] a second
# time as cycle 1, as this did, gave phenix a flat first macrocycle in Panel D -- the
# engine appeared to achieve nothing in the cycle where it in fact moves most.
series = [b[0] for b in blocks]
final = _phenix_final_r(lines)
if final is not None:
# End of the LAST macrocycle is reported only in the summary, never in a block.
series.append(final)
return [(i, w, f) for i, (w, f) in enumerate(series)]


Expand Down
Binary file modified paper/figure2_alphafold_start/figures/figure_af_benchmark.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
22 changes: 11 additions & 11 deletions paper/source_data/figure2_panelD_convergence.csv
Original file line number Diff line number Diff line change
Expand Up @@ -10,17 +10,17 @@ refmac,7,0.962204,0.925669,0.991284,676,0.02
refmac,8,0.977281,0.955939,0.998412,676,0.02
refmac,9,0.991132,0.979833,1.001607,676,0.02
refmac,10,1.0,1.0,1.0,676,0.02
phenix,0,,,,0,0.02
phenix,1,,,,0,0.02
phenix,2,,,,0,0.02
phenix,3,,,,0,0.02
phenix,4,,,,0,0.02
phenix,5,,,,0,0.02
phenix,6,,,,0,0.02
phenix,7,,,,0,0.02
phenix,8,,,,0,0.02
phenix,9,,,,0,0.02
phenix,10,,,,0,0.02
phenix,0,0.0,0.0,0.0,663,0.02
phenix,1,0.545641,0.399955,0.67179,663,0.02
phenix,2,0.765903,0.637974,0.882886,663,0.02
phenix,3,0.882767,0.782041,0.97248,663,0.02
phenix,4,0.930514,0.845441,0.993625,663,0.02
phenix,5,0.955414,0.900394,1.007436,663,0.02
phenix,6,0.976996,0.933246,1.014828,663,0.02
phenix,7,0.985549,0.95886,1.013476,663,0.02
phenix,8,0.994553,0.977442,1.014196,663,0.02
phenix,9,1.0,0.992588,1.007167,663,0.02
phenix,10,1.0,1.0,1.0,663,0.02
torchref,0,0.0,0.0,0.0,666,0.02
torchref,1,0.520538,0.355014,0.676154,666,0.02
torchref,2,0.814105,0.646379,0.927256,666,0.02
Expand Down
Loading