Hi Guys,
I’m trying to demonstrate a proof of concept for AWS.
Imagine we have a samplesheet input, within this samplesheet we will have multiple sampletypes with differing pipeline configs.
I would have AWS batch configured and in my .config pointing processes with labels like “WGS” to a certain compute environment
Is it possible to dynamically assign labels to processes based on inputs? Am I going about this the wrong way? Everything else works except this Label part. It seems through googling and gpt-ing that sample_row is not available to label as labels get evaluated before inputs?
process PROCESS_SAMPLE {
tag "${sample_row.ID} - ${sample_row.PIPELINE}"
// Dynamically assign labels based on the PIPELINE value
label sample_row.PIPELINE ?: 'default'
input:
val sample_row
output:
stdout
script:
// Dynamically select inputs based on the PIPELINE value
def pipeline_config = params.pipeline_configs[sample_row.PIPELINE] ?: params.pipeline_configs.default
"""
echo 'hello ${sample_row.ID}, you want pipeline ${sample_row.PIPELINE} with BEDFILE ${pipeline_config.bedfile} and REFERENCE ${pipeline_config.reference}'
"""
}
workflow {
// Read the samplesheet.csv file
Channel.fromPath('samplesheet.csv')
.splitCsv(header: true, sep: ',')
.set { sample_rows }
sample_rows.view()
// Invoke the process with each row individually
PROCESS_SAMPLE(sample_rows)
}