Skip to content

wdl 1.1 sep() vs command block ~{sep} return different values #435

@Ben-Habermeyer

Description

@Ben-Habermeyer

Hi DXCompiler team, I recently came across a behavior when trying to convert an array of File into a CLI arg

I have an input Array[File] snp_vcfs

Originally in a command block I had given this to a CLI tool like the following
--sample-snp-vcfs ~{sep=' ' snp_vcfs}

Which resulted in the following resolution when run on DNAnexus --sample-snp-vcfs /home/dnanexus/inputs/input4994899743764944893/s_1_AACATACTGAGTGATCCGGA.final.vcf /home/dnanexus/inputs/input4994899743764944893/s_1_AATCACGGTTCGGATCGGTT.final.vcf

But then I needed to make this optional, so I put the following in my task block for the input Array[File] snp_vcfs = []

And added this arg
String snp_vcfs_args = if length(snp_vcfs) > 0 then "--sample-snp-vcfs " + sep(" ", snp_vcfs) else ""

Which I reference in command block ~{snp_vcfs_args} but this looks resolves as the following
--sample-snp-vcfs dx://file-GQZPx0Q0xKpKqJp3kxZ4XBP8::/s_1_AACATACTGAGTGATCCGGA.final.vcf dx://file-GQZKf9Q0GxY4K65ZPqGYkp4Y::/s_1_AATCACGGTTCGGATCGGTT.final.vcf

Is it possible for the 1.1 builtin sep() to resolve File objects to their path (like the ~{sep} does) i.e. /home/dnanexus/inputs/... rather than just converting them to strings (and rendering these paths potentially unusable)?

1.1 says ~{sep} is deprecated but I feel like they should have the same behavior unless there is something I'm missing? Thanks

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions