Arrays of optional elements

Post author
Mark Walker

I have a question regarding arrays of optional elements. I have a workflow with inputs of a sample list like this:

Array[String] ids
Array[File?] files

where each element in "files" may or may not be empty in the data table. I was hoping that Terra would fill in the missing entries with none  like this:

ids: ["sample1", "sample2", "sample3"]
files: ["file1.txt", none, "file3.txt"]

but what I'm seeing is the none element just gets dropped like this:

ids: ["sample1", "sample2", "sample3"]
files: ["file1.txt", "file3.txt"]

Is the first behavior is possible? For context, I'm submitting this using a sample set and have inputs like:

ids: this.samples.sample_id
files: this.samples.vcf

Many thanks!

Comments

4 comments

  • Comment author
    Samantha (she/her)

    Hi Mark,

    Thank you for writing in about this issue. Can you share the workspace where you are seeing this issue with Terra Support by clicking the Share button in your workspace? The Share option is in the three-dots menu at the top-right.

    1. Toggle the "Share with support" button to "Yes"
    2. Click Save

     

    Please provide us with

    1. A link to your workspace
    2. The relevant submission ID
    3. The relevant workflow ID

    We’ll be happy to take a closer look as soon as we can!

    Kind regards,

    Samantha

    0
  • Comment author
    Mark Walker

    Hi Samantha,

    Thanks for your quick response. I can't share this particular workspace where I encountered this problem because it contains sensitive data. I've tried to recreate the issue in another workspace here: https://app.terra.bio/#workspaces/broad-firecloud-dsde-methods/gatk-sv-pipeline-hgdp-filtering

    However, now I'm encountering a new problem: all of the array inputs seem to be empty. The workflow ID is 05a86d2f-58ca-411f-908b-3d822dca708d and the submission ID is 55535592-0673-4905-b988-80ba419e902e

     

    0
  • Comment author
    Mark Walker

    Turns out I made a mistake, using "this.sample" instead of "this.samples" to reference sample set entities. I now have a run with the original issue:

    Submission ID: 2bc33c8b-d398-484b-b881-3d4625e97d4a

    Workflow ID: 1b3498e3-b134-47c7-9a43-5c7a67cacc8e

    0
  • Comment author
    Samantha (she/her)

    Hi Mark,

    Thanks for your patience. I looked around and found that we had created a bug ticket for this a few months ago and during investigation, we learned that the behavior you are seeing is actually intended and changing it may affect current workflows that assume this behavior. The ticket is still on our engineering team's backlog for prioritization so I can add your case in support of making this change.

    In the meantime, a suggested workaround is to add "NA" values to the data table. 

    Best,

    Samantha

    0

Please sign in to leave a comment.