Update: July 26, 2019
This section of the forum is now closed; we are working on a new support model for WDL that we will share here shortly. For Cromwell-specific issues, see the Cromwell docs and post questions on Github.

What does "Input evaluation for Call failed.\nNo coercion defined from " Mean

amr@broadinstitute.orge[email protected] Member, Broadie
edited January 2017 in Ask the Cromwell + WDL Team

Hi,

I am running Cromwell with WDL pasted below. It begins to execute just fine, but eventually fails with this error:

  "submission": "2017-01-19T09:37:44.686-05:00",
  "status": "Failed",
  "failures": [
    {
      "message": "Input evaluation for Call smrtseq.SampleDone2 failed.\nNo coercion defined from '[\"True\", \"True\", \"True\", \"True\", ...

For brevity I'v only posted the beginning of the failure message, but it's referring to an array of Booleans (as strings) that I'm using to indicate that previous steps in the pipeline have completed. The issue I'm trying to solve is that I need certain tasks to only run after a set of other ones have run. Any help is appreciated. WDL is below:

# Smartseq Test WDL
# Version 1.0

task EntryCreator {
  String apps_path
  String analysis_name
  String outputDir
  String input_samples_files
  String done

  command {
  java -jar ${apps_path}/EntryCreator/bin/EntryCreator-1.0.jar -i ${analysis_name} -o ${outputDir}/${analysis_name}.EntryCreator.json -t true
  }
  output {
  String entry_file = "${outputDir}/${analysis_name}.EntryCreator.json"
  String sample_files = input_samples_files
  }
}

task createPicardMetricsDir {
  String outputDir

  command {
  mkdir -p ${outputDir}/picard_metrics/
  mkdir -p ${outputDir}/ERCC/
  }
  output {
  String done = "Done"
  }
}

task SampleDone {
  String metric1
  String metric2
  String metric3
  String metric4
  String metric5
  String metric6
  String metric7

  command {
    echo "Sample Done"
  }
  output {
   String out = "Done"
  }
}
task SampleDone3 {
  String metric1

  command {
    echo "Sample Done"
  }
  output {
   String out = "Done"
  }
}

task SampleDone2 {
  String metric1
  String metric2
  String metric3
  String metric4
  String metric5
  String metric6
  String metric7

  command {
    echo "Sample Done"
  }
  output {
   String out = "Done"
  }
}

task GrantGroupPermission {
 Array[String] array
 String outputDir

 command {
   chmod -R 0755 ${outputDir}
 }
}

task GenerateMDReport {
  Array[String] array
  String entryFile
  String outputDir
  String apps_path

  command {
    java -jar ${apps_path}/MdReport/MdReport.jar -e ${entryFile} -o ${outputDir} -r SmartSeqReporter -t true
  }
}

task AggregateFastq {
  String FastqDir
  String BarCode1
  String BarCode2
  String SampleName
  String SequenceDataPath
  String pipeline_path
  String Specie
  String OutputDir

  command {
    sh ${pipeline_path}/RunAggregateFastq.sh ${FastqDir} ${SampleName} ${BarCode1} ${BarCode2} ${SequenceDataPath} ${Specie} ${OutputDir}
  }
  output {
   String genome_dir = "${FastqDir}/${SampleName}_genomedir"
  }
}

task RunSTARAlignment {
  String fastq1
  String fastq2
  String sample_name
  String genome_dir
  String output_dir
  String pipeline_path
  command {
    sh ${pipeline_path}/RunSTARAlignment.sh ${fastq1} ${fastq2} ${sample_name} ${genome_dir} ${output_dir}
  }
  output {
   String unprocessed_genome_alignment = "${output_dir}/alignments/${sample_name}.Aligned.sortedByCoord.out.bam"
   String transcriptome_alignment = "${output_dir}/alignments/${sample_name}.Aligned.toTranscriptome.out.bam"
   String fastq1Out = "${fastq1}"
   String fastq2Out = "${fastq2}"
  }
  runtime {
    memory: 50
  }
}

task CleanUpFastq {
  String fastq1
  String fastq2
  String done
  command {
    rm -f ${fastq1} && rm -f ${fastq2}
  }
}

task ProcessGenomeAlignment {
  String unprocessed_genome_alignment
  String sample_name
  String genome_dir
  String output_dir
  String pipeline_path
  String cancel_cache

  command {
    sh ${pipeline_path}/ProcessGenomeAlignment.sh ${unprocessed_genome_alignment} ${sample_name} ${genome_dir} ${output_dir}
  }
  output {
    String genome_alignment = "${output_dir}/alignments/${sample_name}.duplicates_marked.bam"
    String unprocessed_bam = "${unprocessed_genome_alignment}"
    String reordered_bam = "${output_dir}/alignments/${sample_name}.reordered.bam"
    String readgroups_bam = "${output_dir}/alignments/${sample_name}.readgroups.bam"
  }
  runtime {
    memory: 43
  }
}

task CleanUpGenomeAlignment {
  String unprocessed_bam
  String reodered_bam
  String readgroups_bam
  command {
    rm -f ${unprocessed_bam} && rm -f ${reodered_bam} && rm -f ${readgroups_bam}
  }
}

task PicardAlignmentSummaryMetrics {
  String picard_path
  String genome_alignment
  String output_dir
  String sample_name
  String reference_file

  command {
    sh ${picard_path}/picard.sh CollectAlignmentSummaryMetrics I=${genome_alignment} O=${output_dir}/picard_metrics/${sample_name}.AlignmentSummaryMetrics.out R=${reference_file}
  } output {
    String alignment_summary_metrics = "${output_dir}/picard_metrics/${sample_name}.AlignmentSummaryMetrics.out"
  }
  runtime {
    memory:25
  }
}

task InsertAlignmentSummaryMetrics {
  String alignment_summary_metrics
  String apps_path
  String sample_id
  String analysis_name
  String entry_file

  command {
    sh ${apps_path}/Parsomatic/parsomatic.sh -V false -t true -e ${entry_file} --sampleId ${sample_id} --setId ${analysis_name} --inputFile ${alignment_summary_metrics} --preset PicardAlignmentMetrics --mdType PicardAlignmentMetrics
    }
   output {
      String done = "True"
    }
}

task PicardEstimateLibraryComplexity {
  String picard_path
  String genome_alignment
  String output_dir
  String sample_name

  command {
    sh ${picard_path}/picard.sh EstimateLibraryComplexity VALIDATION_STRINGENCY=SILENT I=${genome_alignment} O=${output_dir}/picard_metrics/${sample_name}.EstimateLibraryComplexity.out
  } output {
    String elc_metrics = "${output_dir}/picard_metrics/${sample_name}.EstimateLibraryComplexity.out"
  }
}

task InsertEstimateLibraryComplexity {
  String elc_metrics
  String entry_file
  String apps_path
  String sample_id

    command {
        sh ${apps_path}/Parsomatic/parsomatic.sh -V false -t true -i ${sample_id} -e ${entry_file} -p PicardEstimateLibraryComplexity -f ${elc_metrics}
    } output {
    String done = "True"
    }
}

task PicardQualityScoreDistribution {
  String picard_path
  String genome_alignment
  String output_dir
  String sample_name
  command {
    sh ${picard_path}/picard.sh QualityScoreDistribution I=${genome_alignment} O=${output_dir}/picard_metrics/${sample_name}.QualityScoreDistribution.out CHART=${output_dir}/picard_metrics/${sample_name}.QualityScoreDistribution.pdf
  } output {
    String qs_distribution_metrics = "${output_dir}/picard_metrics/${sample_name}.QualityScoreDistribution.out"
  }
  runtime {
    memory:25
  }
}

task PicardCollectReadGCMetrics {
  String picard_path
  String genome_alignment
  String output_dir
  String sample_name
  String alignment_summary_metrics

  command {
    sh ${picard_path}/CollectReadGCMetrics.sh I=${genome_alignment} O=${output_dir}/picard_metrics/${sample_name}.ReadGCMetrics.out CHART=${output_dir}/picard_metrics/${sample_name}.ReadGCMetrics.pdf
  } output {
    String read_gc_metrics = "${output_dir}/picard_metrics/${sample_name}.ReadGCMetrics.out"
  }
  runtime {
    memory: 43
  }
}

task InsertReadGCMetrics {
  String read_gc_metrics
  String apps_path
  String sample_id
  String analysis_name
  String entry_file
  command {
    sh ${apps_path}/Parsomatic/parsomatic.sh -V false -t true -e ${entry_file} --sampleId ${sample_id} --setId ${analysis_name} --inputFile ${read_gc_metrics} --preset PicardMeanGc --mdType PicardMeanGc
    }
   output {
      String done = "True"
    }
}

task PicardMeanQualityByCycle {
  String picard_path
  String genome_alignment
  String output_dir
  String sample_name
  command {
    sh ${picard_path}/picard.sh MeanQualityByCycle I=${genome_alignment} O=${output_dir}/picard_metrics/${sample_name}.MeanQualityByCycle.out CHART=${output_dir}/picard_metrics/${sample_name}.MeanQualityByCycle.pdf
  } output {
    String mean_qual_by_cycle ="${output_dir}/picard_metrics/${sample_name}.MeanQualityByCycle.out"
  }
  runtime {
    memory: 43
  }
}

task InsertPicardMeanQualByCycle {
  String mean_qual_by_cycle
  String apps_path
  String sample_id
  String analysis_name
  String entry_file
  command {
    sh ${apps_path}/Parsomatic/parsomatic.sh -t true -e ${entry_file} --sampleId ${sample_id} --setId ${analysis_name} --inputFile ${mean_qual_by_cycle} --preset PicardMeanQualByCycle --mdType PicardMeanQualByCycle
    }
   output {
      String done = "True"
    }
}
task PicardCollectInsertSizeMetrics {
  String picard_path
  String genome_alignment
  String output_dir
  String sample_name
  command {
    sh ${picard_path}/picard.sh CollectInsertSizeMetrics I=${genome_alignment} O=${output_dir}/picard_metrics/${sample_name}.InsertSizeMetrics.out H=${output_dir}/picard_metrics/${sample_name}.InsertSizeMetrics.png
  } output {
    String insert_size_metrics ="${output_dir}/picard_metrics/${sample_name}.InsertSizeMetrics.out"
  }
  runtime {
    memory:40
  }
}

task InsertInsertSizeMetrics {
  String insert_size_metrics
  String apps_path
  String sample_id
  String analysis_name
  String entry_file
  command {
    sh ${apps_path}/Parsomatic/parsomatic.sh -V false -t true -e ${entry_file} --sampleId ${sample_id} --setId ${analysis_name} --inputFile ${insert_size_metrics} --preset PicardInsertSizeMetrics --mdType PicardInsertSizeMetrics
    }
   output {
      String done = "True"
    }
}

task TranscriptQuantification {
  String transcriptome_alignment
  String sample_name
  String genome_dir
  String output_dir
  String pipeline_path

  command {
    sh ${pipeline_path}/RunRSEM2.sh ${transcriptome_alignment} ${sample_name} ${genome_dir} ${output_dir}
  }
  runtime {
    memory:25
  }
}

task ERCCQuantification {
  String genome_alignment
  String genome_dir
  String sample_name
  String output_dir
  String pipeline_path

  command {
    sh ${pipeline_path}/RunERCCQuants.sh ${genome_alignment} ${genome_dir} ${sample_name} ${output_dir}
 }
  runtime {
    memory:25
  }
}

task GetErccStats {
  String output_dir
  String apps_path
  String genome_alignment
  String sample_name

  command {
    sh ${apps_path}/get_ercc_stats/get_ercc_stats.sh ${genome_alignment} ${output_dir}
  } output {
    String ercc_stats = "${output_dir}/${sample_name}.ErccMetrics.out"
  }
}

task FixErccFile {
  String ercc_metrics
  command {
    sed -i '2s/.*/0/' ${ercc_metrics}
  } output {
    String ercc_stats = "${ercc_metrics}"
  }
}

task InsertErccStats {
  String ercc_metrics
  String apps_path
  String sample_id
  String analysis_name
  String entry_file
  command {
    sh ${apps_path}/Parsomatic/parsomatic.sh -t true -e ${entry_file} --sampleId ${sample_id} --setId ${analysis_name} --inputFile ${ercc_metrics} --preset ErccStats --mdType ErccStats
    }
   output {
      String done = "True"
    }
}
task QualityAssessment {
  String genome_alignment
  String sample_name
  String genome_dir
  String output_dir
  String pipeline_path

  command {
    sh ${pipeline_path}/IndexBAM.sh ${genome_alignment} && sh ${pipeline_path}/RunRNASeQC.sh ${genome_alignment} ${sample_name} ${genome_dir} ${output_dir}
 } output {
   String rnaseqqc_metrics = "${output_dir}/RNASeqQC/metrics.tsv"
   String done = "Done"
 }
  runtime {
    memory:25
    cpu: 4
  }
}
task RNACounts {
  String sample_name
  String genome_dir
  String output_dir
  String pipeline_path
  String fastq1
  String fastq2
  String done

  command {
    sh ${pipeline_path}/RunRNACounts.sh ${output_dir}/RNASeqQC/${sample_name}/${sample_name}.rRNA_counts.txt ${fastq1} ${fastq2} ${genome_dir}/rRNA/rRNA.fasta ${output_dir} ${sample_name} ${output_dir}/RNASeqQC/${sample_name}/${sample_name}.metrics.txt
  }
  output{
    String complete = "True"
    String rnaseqqc_metrics = "${output_dir}/RNASeqQC/metrics.tsv"
  }
}

task InsertRnaSeqQcMetrics {
  String rnaseqqc_metrics
  String apps_path
  String sample_id
  String analysis_name
  String entry_file
  command {
    sh ${apps_path}/Parsomatic/parsomatic.sh -t true -e ${entry_file} --sampleId ${sample_id} --setId ${analysis_name} --inputFile ${rnaseqqc_metrics} --preset RnaSeqQcStats --mdType RnaSeqQcStats
    }
   output {
      String done = "True"
    }
    }
task InsertDemultiplexedStats {
  Array[String] array
  String apps_path
  String entry_file
  String sample_id
  command {
      sh ${apps_path}/Parsomatic/parsomatic.sh -t true --sampleId ${sample_id} -e ${entry_file} --preset DemultiplexedStats
      } output {
          String done = "True"
      }
    }

workflow smrtseq {
  File input_samples_files
  String fastq_dir
  String analysis_name
  String output_dir
  String pipeline_path
  String apps_path
  String picard_path

  call createPicardMetricsDir {
    input:outputDir = output_dir
  } 
  call EntryCreator {
        input: analysis_name = analysis_name,
        outputDir = output_dir,
        apps_path = apps_path,
        input_samples_files= input_samples_files,
    done = createPicardMetricsDir.done
  }
  scatter (sample in read_tsv(EntryCreator.sample_files)) {
    call AggregateFastq {
     input: FastqDir=fastq_dir,
                SampleName = sample[0],
        BarCode1=sample[1],
        BarCode2=sample[2],
            SequenceDataPath = sample[4],
        pipeline_path = pipeline_path,
        Specie = sample[3],
        OutputDir = output_dir
    }
    call RunSTARAlignment {
     input: fastq1=fastq_dir + "/" + sample[0] + ".1.fastq",
        fastq2=fastq_dir + "/" + sample[0] + ".2.fastq",
        sample_name = sample[0],
        genome_dir = AggregateFastq.genome_dir,
        output_dir = output_dir + "/" + sample[0],
        pipeline_path=pipeline_path
    }
    call ProcessGenomeAlignment {
     input: unprocessed_genome_alignment=RunSTARAlignment.unprocessed_genome_alignment,
        sample_name=sample[0],
        genome_dir= AggregateFastq.genome_dir,
        output_dir=output_dir + "/" + sample[0],
        pipeline_path=pipeline_path,
        cancel_cache="True"
    }
        call CleanUpGenomeAlignment {
     input: unprocessed_bam = ProcessGenomeAlignment.unprocessed_bam,
                reodered_bam = ProcessGenomeAlignment.reordered_bam,
        readgroups_bam = ProcessGenomeAlignment.readgroups_bam
    }
    call PicardAlignmentSummaryMetrics {
    input: genome_alignment=ProcessGenomeAlignment.genome_alignment,
        sample_name=sample[0],
        output_dir=output_dir,
        picard_path=picard_path,
        reference_file=AggregateFastq.genome_dir + "/genome.fasta"
    }
    call InsertAlignmentSummaryMetrics {
        input: alignment_summary_metrics=PicardAlignmentSummaryMetrics.alignment_summary_metrics,
        sample_id=sample[0],
        apps_path=apps_path,
        analysis_name=analysis_name,
        entry_file=EntryCreator.entry_file
    }
    call PicardEstimateLibraryComplexity {
        input:genome_alignment=ProcessGenomeAlignment.genome_alignment,
        sample_name=sample[0],
        output_dir=output_dir,
        picard_path=picard_path
    }
    call InsertEstimateLibraryComplexity {
          input:elc_metrics = PicardEstimateLibraryComplexity.elc_metrics,
          entry_file = EntryCreator.entry_file,
          apps_path = apps_path,
          sample_id = sample[0]
    }
    call PicardQualityScoreDistribution {
    input: genome_alignment=ProcessGenomeAlignment.genome_alignment,
        sample_name=sample[0],
        output_dir=output_dir,
        picard_path=picard_path
    }
    call PicardCollectReadGCMetrics {
    input: genome_alignment=ProcessGenomeAlignment.genome_alignment,
        sample_name=sample[0],
        output_dir=output_dir,
        picard_path=picard_path,
        alignment_summary_metrics=PicardAlignmentSummaryMetrics.alignment_summary_metrics,
    }
    call InsertReadGCMetrics {
    input: read_gc_metrics=PicardCollectReadGCMetrics.read_gc_metrics,
        sample_id=sample[0],
        apps_path=apps_path,
        analysis_name=analysis_name,
        entry_file=EntryCreator.entry_file
    }
    call PicardMeanQualityByCycle {
    input: genome_alignment=ProcessGenomeAlignment.genome_alignment,
        sample_name=sample[0],
        output_dir=output_dir,
        picard_path=picard_path
    }
    call InsertPicardMeanQualByCycle {
    input: mean_qual_by_cycle = PicardMeanQualityByCycle.mean_qual_by_cycle,
        sample_id=sample[0],
        apps_path=apps_path,
        analysis_name=analysis_name,
        entry_file=EntryCreator.entry_file
    }
    call PicardCollectInsertSizeMetrics {
    input: genome_alignment=ProcessGenomeAlignment.genome_alignment,
        sample_name=sample[0],
        output_dir=output_dir,
        picard_path=picard_path
    }
    call InsertInsertSizeMetrics {
    input: insert_size_metrics = PicardCollectInsertSizeMetrics.insert_size_metrics,
        sample_id=sample[0],
        apps_path=apps_path,
        analysis_name=analysis_name,
        entry_file=EntryCreator.entry_file
    }
    call TranscriptQuantification {
     input: transcriptome_alignment=RunSTARAlignment.transcriptome_alignment,
        sample_name=sample[0],
        genome_dir= AggregateFastq.genome_dir,
        output_dir=output_dir + "/" + sample[0],
        pipeline_path=pipeline_path
    }
    call ERCCQuantification {
     input: genome_alignment=ProcessGenomeAlignment.genome_alignment,
        genome_dir=AggregateFastq.genome_dir,
        sample_name=sample[0],
        output_dir=output_dir + "/" + sample[0],
        pipeline_path=pipeline_path
    }
    call GetErccStats {
     input: genome_alignment=ProcessGenomeAlignment.genome_alignment,
        output_dir = output_dir + "/ERCC/",
        apps_path = apps_path,
        sample_name=sample[0]
    }
    call FixErccFile {
     input: ercc_metrics=GetErccStats.ercc_stats,
    }
    call InsertErccStats {
     input: ercc_metrics=FixErccFile.ercc_stats,
        sample_id=sample[0],
        apps_path=apps_path,
        analysis_name=analysis_name,
        entry_file=EntryCreator.entry_file
    }
    call QualityAssessment {
     input: genome_alignment=ProcessGenomeAlignment.genome_alignment,
        sample_name=sample[0],
        genome_dir=AggregateFastq.genome_dir,
        output_dir=output_dir + "/" + sample[0],
        pipeline_path=pipeline_path
    }
    call RNACounts {
     input: genome_dir=AggregateFastq.genome_dir,
        output_dir=output_dir + "/" + sample[0],
                sample_name=sample[0],
        pipeline_path=pipeline_path,
        fastq1=fastq_dir + "/" + sample[0] + ".1.fastq",
        fastq2=fastq_dir + "/" + sample[0] + ".2.fastq",
            done=QualityAssessment.done
    }
        call CleanUpFastq {
     input: fastq1=RunSTARAlignment.fastq1Out,
                fastq2=RunSTARAlignment.fastq2Out,
        done=RNACounts.complete
    }
    call InsertRnaSeqQcMetrics {
     input: rnaseqqc_metrics= RNACounts.rnaseqqc_metrics,
       apps_path=apps_path,
       sample_id=sample[0],
       analysis_name=analysis_name,
       entry_file=EntryCreator.entry_file
    }
    call SampleDone {
        input:metric1=InsertPicardMeanQualByCycle.done,
        metric2=InsertInsertSizeMetrics.done,
        metric3=InsertErccStats.done,
        metric4=InsertRnaSeqQcMetrics.done,
        metric5=InsertAlignmentSummaryMetrics.done,
        metric6=InsertReadGCMetrics.done,
        metric7=InsertEstimateLibraryComplexity.done
    }
  }
  # Calculating demultiplexed stat requires all runs to be completed first, hence it has its own scatter block.
  scatter (sample in read_tsv(EntryCreator.sample_files)) {
      call SampleDone2 {
          input:metric1=InsertPicardMeanQualByCycle.done,
          metric2=InsertInsertSizeMetrics.done,
          metric3=InsertErccStats.done,
          metric4=InsertRnaSeqQcMetrics.done,
          metric5=InsertAlignmentSummaryMetrics.done,
          metric6=InsertReadGCMetrics.done,
          metric7=InsertEstimateLibraryComplexity.done
      }
    call InsertDemultiplexedStats {
      input: array = SampleDone2.out,
      apps_path = apps_path,
      entry_file = EntryCreator.entry_file,
      sample_id = sample[0]
    }
    call SampleDone3 {
        input: metric1=InsertDemultiplexedStats.done
    }
  }
   call GenerateMDReport {
    input: array = SampleDone3.out,
    entryFile=EntryCreator.entry_file,
    outputDir=output_dir,
        apps_path=apps_path
    }
  call GrantGroupPermission {
   input: array=SampleDone3.out,
          outputDir = output_dir
  }
}
Post edited by KateN on

Answers

  • KateNKateN Cambridge, MAMember, Broadie, Moderator admin

    Is there a reason you cannot use a boolean output rather than a string? Cromwell version 24 now supports conditional statements. (i.e. if and else.)

    If using a boolean instead solves your problem, great! If not, could you post the entire error message?

Sign In or Register to comment.