diff --git a/tools/battery/still_battery.py b/tools/battery/still_battery.py index fd2fa6c68..67276774b 100644 --- a/tools/battery/still_battery.py +++ b/tools/battery/still_battery.py @@ -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"]: