@@ -369,20 +369,27 @@ def update_xchem_database(
369369 `updatable` is the CrystalName set this run is allowed to write, captured
370370 before any RefinementOutcome is set."""
371371
372- # Build list of dicts for batch updating rows in SQLite
372+ # Build list of dicts for batch updating rows in SQLite.
373373 db_dicts = []
374+ outcomes = {
375+ "not updatable" : [],
376+ "no ligand cif" : [],
377+ "Pipedream model" : [],
378+ "PanDDA model" : [],
379+ "no model" : [],
380+ }
374381 for dataset_dir in model_dir .iterdir ():
375382 if not dataset_dir .is_dir ():
376383 continue
377384 dtag = dataset_dir .name
378385 if dtag not in updatable :
379- logger . info ( f" { dtag } not in set of updatable CrystalNames" )
386+ outcomes [ " not updatable" ]. append ( dtag )
380387 continue
381388 compound_dir = dataset_dir / "compound"
382389 cif_files = list (compound_dir .glob ("*.cif" ))
383390
384391 if not cif_files :
385- logger . info ( f"No .cif file in { compound_dir } , skipping { dtag } " )
392+ outcomes [ "no ligand cif" ]. append ( dtag )
386393 continue
387394 if len (cif_files ) > 1 :
388395 logger .error (f"Multiple .cif files in { compound_dir } " )
@@ -400,6 +407,7 @@ def update_xchem_database(
400407
401408 # Export
402409 if pipedream_model :
410+ outcomes ["Pipedream model" ].append (dtag )
403411 # Determine ligand confidence based on overall ligandcc value
404412 if rscc >= 0.8 :
405413 RefinementLigandConfidence = "4 - High Confidence"
@@ -440,6 +448,7 @@ def update_xchem_database(
440448 )
441449
442450 elif pandda_model :
451+ outcomes ["PanDDA model" ].append (dtag )
443452 db_dicts .append (
444453 {
445454 "CrystalName" : dtag ,
@@ -455,7 +464,7 @@ def update_xchem_database(
455464 }
456465 )
457466 else :
458- logger . info ( f"No model selected for { dtag } " )
467+ outcomes [ "no model" ]. append ( dtag )
459468 db_dicts .append (
460469 {
461470 "CrystalName" : dtag ,
@@ -466,6 +475,11 @@ def update_xchem_database(
466475 }
467476 )
468477
478+ logger .info (
479+ "Model selection: "
480+ + ", " .join (f"{ len (dtags )} { label } " for label , dtags in outcomes .items ())
481+ )
482+
469483 # Now update the database with the formed dicts
470484 try :
471485 update_data_source_bulk (db_dicts , db_copy )
0 commit comments