still battery: take the deposited model as mmCIF where the RCSB has no PDB-format file

Entries too large or too new for the PDB format exist only as mmCIF, and rugnux and dimple read both;
such a set ran without --model and without the dimple refinement.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_015CeEGgpKdfkCTJb3YNMJcu
This commit is contained in:
leonarski_fandClaude Opus 5.5 committed 2026-10-21 13:31:58 +02:00
1 parent bb7c9c8fa3
commit 69b3390458
1 file changed
+9 -2
+9 -2
View File
@@ -197,11 +197,18 @@ def free_flags(sf_cif, out_mtz, free):
return f"{col}={val}"
def deposited_model(pdb, cache):
"""The deposited coordinates: PDB format where the RCSB serves it, else mmCIF (entries too large or
too new for the PDB format exist only as mmCIF; rugnux and dimple read both)."""
return (model_check.fetch(model_check.RCSB + pdb + ".pdb", os.path.join(cache, pdb + ".pdb"))
or model_check.fetch(model_check.RCSB + pdb + ".cif", os.path.join(cache, pdb + ".cif")))
def refine(wd, e, cache):
"""dimple of the deposited model against our merge, reindexed into the deposition's group, with the
deposition's free set, cut at the deposition's resolution. (R_work, R_free, note)."""
pdb = e["pdb"].lower()
xyz = model_check.fetch(model_check.RCSB + pdb + ".pdb", os.path.join(cache, pdb + ".pdb"))
xyz = deposited_model(pdb, cache)
sf = model_check.fetch(model_check.RCSB + pdb + "-sf.cif", os.path.join(cache, pdb + "-sf.cif"))
if not (xyz and sf) or not os.path.exists(os.path.join(wd, "p.mtz")):
return None, None, "no model, structure factors or merge"
@@ -235,7 +242,7 @@ def run_one(run_dir, binary, e, st, opts):
model = None
if e.get("pdb"):
pdb = e["pdb"].lower()
model = model_check.fetch(model_check.RCSB + pdb + ".pdb", os.path.join(st["pdb_cache"], pdb + ".pdb"))
model = deposited_model(pdb, st["pdb_cache"])
cmd, short = command(binary, e, st["data_root"], opts, model)
io_bytes = sum(os.path.getsize(f) for f in files)
if opts["cold"]: