
    5i                     <    d dl Z d dlZd dlZd dlmZmZ dZd Zd Z	y)    N)ImageRefFactoryImageRefFactoryErrorzcontainers.jsonc                 P   | D cg c]  }t        |       }}|D cg c]  }|j                          }}t               }g }|D ]U  }|j                  |v r|j	                  |j
                  j                                |j                  |j                         W |S c c}w c c}w )a   
    :param image_refs: Image references extracted from run_nextaur_collect().
    :type image_refs: Dict
    :returns: Array of dicts for bundledDepends attribute of the applet resources. Also saves images on the platform
    if not done that before.
    )r   	get_imageset
identifierappendbundled_dependscopyadd)
image_refsximage_factoriesimagesseen_imagesr
   images          ~/home/marpiech/ifpan-abm-pgxpred/analysis/marpiech-gwas-test/venv/lib/python3.12/site-packages/dxpy/nextflow/collect_images.pybundle_docker_imagesr      s     4>>aq)>O>%45akkm5F5%KO .{*""5#8#8#=#=#?@OOE,,-.  ?5s
   BB#c                    dj                  |       }|rdj                  |      nd}|rdj                  |      nd}dj                  |||g      }t        j                  |ddd      }t        j
                  j                  t              st        |j                        t        t        d      5 }t        j                  |      j                  d	d
      }	|	st        d      	 d
d
d
       |	S # 1 sw Y   	S xY w)ab  
        :param resources_dir: URL to the local(ized) NF pipeline in the app(let) resources.
        :type resources_dir: String
        :param profile: Custom Nextflow profile. More profiles can be provided by using comma separated string (without whitespaces).
        :type profile: str
        :param nextflow_pipeline_params: Custom Nextflow pipeline parameters
        :type nextflow_pipeline_params: string
        :returns: Dict. Image references in the form of
            "process": String. Name of the process/task
            "repository": String. Repository (host) prefix
            "image_name": String. Image base name
            "tag": String. Version tag
            "digest": String. Image digest
            "file_id": String. File ID if found on the platform
            "engine": String. Container engine.
        Runs nextaur:collect
        z)nextflow plugin nextaur:collect docker {}zpipelineParams={} z
profile={} T)shellcapture_outputtextr	processesNz0Could not extract processes from nextaur:collect)formatjoin
subprocessrunospathexistsCONTAINERS_JSONr   stdoutopenjsonloadget)
resources_dirprofilenextflow_pipeline_paramsbase_cmdpipeline_params_argprofile_argnextaur_cmdprocess	json_filer   s
             r   run_nextaur_collectr3   0   s    $ ;AA-PHRj-445MNpr29,%%g.rK((H&9;GHKnn[TPTUG77>>/*"7>>22	os	# [yYYy)--k4@
&'YZZ [ 	[ s   13C//C9)
r'   os.pathr!   r   dxpy.nextflow.ImageRefFactoryr   r   r$   r   r3        r   <module>r8      s"   (    O#(r7   