issue with optional file input in cromwell/WDL?

esalinasesalinas BroadMember, Broadie ✭✭✭

I have a WDL situation where I have an optional file in a workflow, but in the case where I pass it to a task (which has it as a non-optional input file) and I have NO input line at all for it in the input file, then cromwell complains that it can't localize the file.

The main goal is to have a single input at the workflow level where if it is NOT given then when tasks get it they are given the empty string. Is this goal consistent with WDL/cromwell design?

to try to address the situation, I set the task to have the input also as optional. After doing this I get another error "Could not resolve normalPanel as a scatter variable, namespace, call, or declaration". In this case there is still no line in the input file to specify anything.

workflow CallingGroupWorkflow {

    File tumorBam
    File tumorBamIdx
    File normalBam
    File normalBamIdx
    File refFastaIdx
    File mutectIntervals
    File mutectForcecallLintervals
    File refFasta
    File refFastaDict
    String fracContam
    File dbSNPVCF
    File cosmicVCF
    String downsampleToCoverage
    File readGroupBlackList
    File? normalPanel 
    File oncoDBTarBall
    File VEP_File




    call MutectFCTask {
        input:
            tumorBam=tumorBam,
            normalBam=normalBam,
            mutectIntervals=mutectForcecallLintervals,
            refFasta=refFasta,
            refFastaIdx=refFastaIdx,
            refFastaDict=refFastaDict,
            fracContam=fracContam,
            dbSNPVCF=dbSNPVCF,
            cosmicVCF=cosmicVCF,
            downsampleToCoverage=downsampleToCoverage,
            readGroupBlackList=readGroupBlackList,
                    normalPanel=normalPanel 
            }








task MutectFCTask {

    File tumorBam
    File normalBam
    File mutectIntervals
    File refFasta
    File refFastaIdx
    File refFastaDict
    String fracContam
    File dbSNPVCF
    File cosmicVCF
    String downsampleToCoverage
    File readGroupBlackList
    File? normalPanel

    command <<<
    #increase verbosity
    set -x

    #index the bams first
    samtools index ${tumorBam}
    samtools index ${normalBam}

    #variable for normal panel
    NORMAL_PANEL_FLAG_AND_VAL=""
    if [ -s "${normalPanel}" ] ; then
        NORMAL_PANEL_FLAG_AND_VAL="--normal_panel ${normalPanel}" ;
    fi ;

Post edited by esalinas on

Answers

  • KateNKateN Cambridge, MAMember, Broadie, Moderator admin

    To accomplish what you are looking to achieve, you can tell Cromwell to use a default value when an optional parameter is not specified, as detailed in my response here. You will need to use the optional declaration for both the workflow-level and task level parameter. Let me know if you still are getting errors after trying that.

Sign In or Register to comment.