@@ -245,7 +245,7 @@ class AlphaFoldParameters(pydantic.BaseModel):
245245
246246class ShelxtParameters (pydantic .BaseModel ):
247247 dcid : int = pydantic .Field (gt = 0 )
248- ins_file_location : pathlib .Path
248+ ins_file_location : Optional [ pathlib .Path ] = None
249249 prefix : Optional [str ] = None
250250 automatic : Optional [bool ] = False
251251 scaling_id : int = pydantic .Field (gt = 0 )
@@ -2560,6 +2560,45 @@ def trigger_shelxt(
25602560 """Trigger a shelxt job for a given data collection."""
25612561
25622562 dcid = parameters .dcid
2563+ if not parameters .ins_file_location :
2564+ query = (
2565+ session .query (
2566+ AutoProcScaling .autoProcScalingId ,
2567+ AutoProcProgramAttachment .filePath ,
2568+ AutoProcProgramAttachment .fileName ,
2569+ )
2570+ .join (
2571+ AutoProcScalingHasInt ,
2572+ AutoProcScalingHasInt .autoProcScalingId
2573+ == AutoProcScaling .autoProcScalingId ,
2574+ )
2575+ .join (
2576+ AutoProcIntegration ,
2577+ AutoProcIntegration .autoProcIntegrationId
2578+ == AutoProcScalingHasInt .autoProcIntegrationId ,
2579+ )
2580+ .join (
2581+ AutoProcProgram ,
2582+ AutoProcProgram .autoProcProgramId
2583+ == AutoProcIntegration .autoProcProgramId ,
2584+ )
2585+ .join (
2586+ AutoProcProgramAttachment ,
2587+ AutoProcProgramAttachment .autoProcProgramId
2588+ == AutoProcProgram .autoProcProgramId ,
2589+ )
2590+ .filter (AutoProcScaling .autoProcScalingId == parameters .scaling_id )
2591+ .filter (AutoProcProgramAttachment .fileName == "shelxt.ins" )
2592+ )
2593+ ins_file_attachment = query .one ()
2594+ if ins_file_attachment :
2595+ parameters .ins_file_location = ins_file_attachment .filePath
2596+ else :
2597+ self .log .error (
2598+ "Skipping shelxt trigger: shelxt.ins input data file not found for ScalingId %s" ,
2599+ parameters .scaling_id ,
2600+ )
2601+ return {"success" : True }
25632602
25642603 shelx_parameters : dict [str , list [Any ]] = {
25652604 "ins_file_location" : [os .fspath (parameters .ins_file_location )],
0 commit comments