Hi GATK Users,

Happy Thanksgiving!
Our staff will be observing the holiday and will be unavailable from 22nd to 25th November. This will cause a delay in reaching out to you and answering your questions immediately. Rest assured we will get back to it on Monday November 26th. We are grateful for your support and patience.
Have a great holiday everyone!!!

Regards
GATK Staff

Can I grab single outputs from a scatter block by index?

LeeTL1220LeeTL1220 Arlington, MAMember, Broadie, Dev ✭✭✭
edited December 2017 in Ask the Cromwell + WDL Team

I have a scatter block. I need to grab the outputs from two iterations of the scatter block and run only those in their own task. However, I cannot figure out what is the correct way to do this.

The following gives me a validation error:

workflow foo {
    Array[Int] reproducibility_indexes = [5, 10]
    ....snip...
    scatter (i in range(length(tumor_bam_files))) {
        call cnv_validation.CNVValidation as cnvValidation {
            input:
            ....snip....
        }
    } 
    # end of scatter loop
        call ReproducibilityValidation {
            input:
                called_segs_hcc1143t_1 = cnvValidation[reproducibility_indexes[0]].combined_seg_cr_calls_file,
                called_segs_hcc1143t_2 = cnvValidation[reproducibility_indexes[1]].combined_seg_cr_calls_file,
                ....snip....

}
ERROR: Unexpected symbol (line 107, col 79) when parsing 'e'.

Expected rsquare, got [.

                called_segs_hcc1143t_1 = cnvValidation[reproducibility_indexes[0]].combined_seg_cr_calls_file,
                                                                              ^

$e = :identifier <=> :lparen $_gen18 :rparen -> FunctionCall( name=$0, params=$2 )

Even if I change to

                called_segs_hcc1143t_1 = cnvValidation.combined_seg_cr_calls_file[reproducibility_indexes[0]],
                called_segs_hcc1143t_2 = cnvValidation.combined_seg_cr_calls_file[reproducibility_indexes[1]],

I get a similar validation error:

ERROR: Unexpected symbol (line 107, col 106) when parsing 'e'.

Expected rsquare, got [.

                called_segs_hcc1143t_1 = cnvValidation.combined_seg_cr_calls_file[reproducibility_indexes[0]],
                                                                                                         ^

$e = :identifier <=> :lparen $_gen18 :rparen -> FunctionCall( name=$0, params=$2 )

Is there a way to do this? Apologies if there is something obvious that I am missing.

Answers

  • ChrisLChrisL Cambridge, MAMember, Broadie, Moderator, Dev ✭✭
    edited December 2017

    Unfortunately putting expressions in an array accesser is a known bug in Cromwell's WDL parser.

    As a workaround until that issue gets fixed, you should be able to determine the index outside of the array index and then pass in the result, like:

    Int index1 = reproducibility_indexes[0]
    Int index2 = reproducibility_indexes[1]
    call ReproducibilityValidation {
      input:
        called_segs_hcc1143t_1 = cnvValidation.combined_seg_cr_calls_file[index1],
        called_segs_hcc1143t_2 = cnvValidation.combined_seg_cr_calls_file[index2]
    
  • LeeTL1220LeeTL1220 Arlington, MAMember, Broadie, Dev ✭✭✭
Sign In or Register to comment.