Attention:
The frontline support team will be unavailable to answer questions on April 15th and 17th 2019. We will be back soon after. Thank you for your patience and we apologize for any inconvenience!

"No coercion defined". Optional array to non-optional array

bshifawbshifaw moonMember, Broadie, Moderator admin

i'm overlooking something but not sure what, I get the following error
[2018-08-04 02:44:35,01] [error] WorkflowManagerActor Workflow 69af1ab4-be06-421e-8030-cd9a6bcc5796 failed (during ExecutingWorkflowState): cromwell.engine.workflow.lifecycle.execution.job.preparation.JobPreparationActor$$anonfun$1$$anon$1: Call input and runtime attributes evaluation failed for MergeVCFs: No coercion defined from wom value(s) '[null, null, null]' of type 'Array[File?]' to 'Array[File]'. No coercion defined from wom value(s) '[null, null, null]' of type 'Array[File?]' to 'Array[File]'.

    scatter (i in range(ScatterIntervalList.interval_count)) {
                if (!use_gatk4_haplotype_caller){
                call HaplotypeCaller {
                        input:
                                input_bam = ApplyBQSR.output_bam,
                }
                }
                if (use_gatk4_haplotype_caller){

                      call HaplotypeCaller_GATK4 as HaplotypeCaller4 {
                        input:
                                input_bam = ApplyBQSR.output_bam,
                }
                }
        }
                call MergeVCFs {
                        input:
                                input_vcfs = if defined(HaplotypeCaller4.output_vcf) then HaplotypeCaller4.output_vcf else HaplotypeCaller.output_vcf,
                }
        }

The original wdl i'm editing found here https://github.com/gatk-workflows/gatk3-4-rnaseq-germline-snps-indels

Best Answer

Answers

  • You can use select_first to pick the array that is defined. Note the square brackets, they are needed because select_first works on arrays.

        scatter (i in range(ScatterIntervalList.interval_count)) {
                    if (!use_gatk4_haplotype_caller){
                    call HaplotypeCaller {
                            input:
                                    input_bam = ApplyBQSR.output_bam,
                        }
                    }
                    if (use_gatk4_haplotype_caller){
    
                          call HaplotypeCaller_GATK4 as HaplotypeCaller4 {
                            input:
                                    input_bam = ApplyBQSR.output_bam,
                        }
                    }
            }
                    call MergeVCFs {
                            input:
                                    input_vcfs = select_first([HaplotypeCaller4.output_vcf, HaplotypeCaller.output_vcf])                
                    }
            }
    
  • bshifawbshifaw moonMember, Broadie, Moderator admin

    Thanks for the suggestion, using select_first leads to the following error
    Unable to build WOM node for WdlTaskCall 'MergeVCFs': Cannot build expression for 'RNAseq.MergeVCFs.input_vcfs = select_first([HaplotypeCaller4.output_vcf, HaplotypeCaller.output_vcf])': select_first failed. It expects an array of optional values but got Array[Array[File?]].

Sign In or Register to comment.