To celebrate the release of GATK 4.0, we are giving away free credits for running the GATK4 Best Practices pipelines in FireCloud, our secure online analysis portal. It’s first come first serve, so sign up now to claim your free credits worth $250. Sponsored by Google Cloud. Learn more at https://software.broadinstitute.org/firecloud/documentation/freecredits

Checking Executables

Hi,

I am trying to check if the executables used in my wdl code exist but I receive an error when I try to validate my wdl script. The ${BWA} variable holds the path to the BWA executable. May i know if there is a way to do this.

command {

      type ${BWA} >/dev/null 2>&1 || { echo >&2 "BWA not installed.  Aborting."; exit 1; }

      # BWA Mem Tool is used to create aligned SAM file from the input FASTA File
      ${BWA} mem -t 12 -M -k 32 -I 300,30 -R "@RG\tID:lane1\tLB:${sampleName}\tPL:illumina\tPU:lane1\tSM:lane1\tCN:${sampleName}" ${RefFasta} ${Input_Read1} ${Input_Read2} | ${SAMTOOL} view -@ 2 -bSu -> ${sampleName}.aligned.bam

}

The error that I receive is :smile:

Unrecognized token on line 41, column 7:

      ${BWA} mem -t 12 -M -k 32 -I 300,30 -R "@RG\tID:lane1\tLB:${sampleName}\tPL:illumina\tPU:lane1\tSM:lane1\tCN:${sampleName}" ${RefFasta} ${Input_Read1} ${Input_Read2} | ${SAMTOOL} view -@ 2 -bSu -> ${sampleName}.aligned.bam
      ^
Tagged:

Best Answer

Answers

  • RuchiRuchi Member, Broadie, Dev

    Hey @ramshankar1990,

    In WDL, the ${} syntax is reserved for workflow/task variables. In your case, is String BWA a task input? Can you paste the entire task (along with the inputs)? Thanks!

  • task BWA_Mem {
    
       File Input_Read1             # Input Read File                (REQUIRED)
       File Input_Read2             # Input Read File                (Optional)
       String sampleName            # Name of the Sample
       File RefFasta                # Reference FASTA file           (REQUIRED)
    
       File Ref_Amb_File            #
       File Ref_Dict_File           #
       File Ref_Ann_File            #
       File Ref_bwt_File            # These are reference files that are provided as implicit inputs
       File Ref_fai_File            # to the WDL Tool to help perform the alignment
       File Ref_pac_File            #
       File Ref_sa_File             #
    
       String BWA                   # Variable path to BWA MEM Tool
       String SAMTOOL               # variable path to Samtools
       String Exit_Code             # Variable capture exit code
       String FilePath
    
       command {
    
          type ${BWA} >/dev/null 2>&1 || { echo >&2 "BWA not installed.  Aborting."; exit 1; }
    
          # BWA Mem Tool is used to create aligned SAM file from the input FASTA File
          ${BWA} mem -t 12 -M -k 32 -I 300,30 -R "@RG\tID:lane1\tLB:${sampleName}\tPL:illumina\tPU:lane1\tSM:lane1\tCN:${sampleName}" ${RefFasta} ${Input_Read1} ${Input_Read2} | ${SAMTOOL} view -@ 2 -bSu -> ${sampleName}.aligned.bam
    
          # The 'if' check to see if any of the samples have failed this step
          if [ $? -ne 0 ]; then
             echo '${sampleName} has failed at the BWA Mem Step ' >> ${Exit_Code}
          fi
       }
    
       # The output block is where the output of the program is stored.
       # glob function is used to capture the multi sample outputs
       output {
          Array[File] Aligned_Bam = glob("${sampleName}.aligned.bam")
       }
    
       # Runtime block specifies the Cromwell Engine of runtime attributes to customize the environment for the call
       runtime {
          continueOnReturnCode: true
       }
    
    }  # End of task block
    
    
Sign In or Register to comment.