Skip to content

Inline join/expand syntax to support args into multiple command line arguments #672

@nh13

Description

@nh13

I'd love for this syntax to be supported (many GATK/Picard tools require --input in front of every argument.

rule all:
    input:
        'out.txt'

rule:
    input:
        args = ['1', '2', '3']
    output:
        'out.txt'
    shell:
        '''echo {' '.join('--input ' + v for v in params.args)} > {output}'''

Otherwise, I have to write:

rule all:
    input:
        'out.txt'

rule:
    input:
        args = ['1', '2', '3']
    params:
        cl_args = ' '.join('--input ' + v for v in ['1', '2', '3'])
    output:
        'out.txt'
    shell:
        '''echo {params.cl_args} > {output}'''

This s redundant and gets complicated when ['1', '2', '3'] is a checkpoint function or something complicated

Metadata

Metadata

Assignees

Labels

enhancementNew feature or request

Type

No type
No fields configured for issues without a type.

Projects

Status
Done

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions