diff --git a/biopet.wdl b/biopet.wdl index 755fed12ec8b7d31d5504319f0cdc60fb4b9d15b..b110defd1e3167397f3d4d8022f9b697acae92af 100644 --- a/biopet.wdl +++ b/biopet.wdl @@ -244,6 +244,39 @@ task SampleConfig { } } +task SampleConfigCromwellArrays { + input { + File? toolJar + String? preCommand + Array[File]+ inputFiles + String outputPath + + Int memory = 4 + Float memoryMultiplier = 2.0 + } + + String toolCommand = if defined(toolJar) + then "java -Xmx" + memory + "G -jar " + toolJar + else "biopet-sampleconfig -Xmx" + memory + "G" + + command { + set -e -o pipefail + ~{preCommand} + mkdir -p $(dirname ~{outputPath}) + ~{toolCommand} CromwellArrays \ + -i ~{sep="-i " inputFiles} \ + ~{"-o " + outputPath} + } + + output { + File outputFile = outputPath + } + + runtime { + memory: ceil(memory * memoryMultiplier) + } +} + task ScatterRegions { input { String? preCommand @@ -425,7 +458,7 @@ task VcfStats { File refFasta File refFastaIndex File refDict - String outDir + String outputDir File? intervals Array[String]+? infoTags Array[String]+? genotypeTags @@ -455,11 +488,12 @@ task VcfStats { command { set -e -o pipefail + mkdir -p ~{outputDir} ~{preCommand} ~{toolCommand} \ -I ~{vcfFile} \ -R ~{refFasta} \ - -o ~{outDir} \ + -o ~{outputDir} \ -t ~{localThreads} \ ~{"--intervals " + intervals} \ ~{true="--infoTag" false="" defined(infoTags)} ~{sep=" --infoTag " infoTags} \ @@ -480,6 +514,58 @@ task VcfStats { sep=" --sparkConfigValue" sparkConfigValues} } + output { + File? general = outputDir + "/general.tsv" + File? genotype = outputDir + "/genotype.tsv" + File? sampleDistributionAvailableAggregate = outputDir + + "/sample_distributions/Available.aggregate.tsv" + File? sampleDistributionAvailable = outputDir + "/sample_distributions/Available.tsv" + File? sampleDistributionCalledAggregate = outputDir + + "/sample_distributions/Called.aggregate.tsv" + File? sampleDistributionCalled = outputDir + "/sample_distributions/Called.tsv" + File? sampleDistributionFilteredAggregate = outputDir + + "/sample_distributions/Filtered.aggregate.tsv" + File? sampleDistributionFiltered = outputDir + "/sample_distributions/Filtered.tsv" + File? sampleDistributionHetAggregate = outputDir + "/sample_distributions/Het.aggregate.tsv" + File? sampleDistributionHetNoNRefAggregate = outputDir + + "/sample_distributions/HetNonRef.aggregate.tsv" + File? sampleDistributionHetNonRef = outputDir + "/sample_distributions/HetNonRef.tsv" + File? sampleDistributionHet = outputDir + "/sample_distributions/Het.tsv" + File? sampleDistributionHomAggregate = outputDir + "/sample_distributions/Hom.aggregate.tsv" + File? sampleDistributionHomRefAggregate = outputDir + + "/sample_distributions/HomRef.aggregate.tsv" + File? sampleDistributionHomRef = outputDir + "/sample_distributions/HomRef.tsv" + File? sampleDistributionHom = outputDir + "/sample_distributions/Hom.tsv" + File? sampleDistributionHomVarAggregate = outputDir + + "/sample_distributions/HomVar.aggregate.tsv" + File? sampleDistributionHomVar = outputDir + "/sample_distributions/HomVar.tsv" + File? sampleDistributionMixedAggregate = outputDir + + "/sample_distributions/Mixed.aggregate.tsv" + File? sampleDistributionMixed = outputDir + "/sample_distributions/Mixed.tsv" + File? sampleDistributionNoCallAggregate = outputDir + + "/sample_distributions/NoCall.aggregate.tsv" + File? sampleDistributionNoCall = outputDir + "/sample_distributions/NoCall.tsv" + File? sampleDistributionNonInformativeAggregate = outputDir + + "/sample_distributions/NonInformative.aggregate.tsv" + File? sampleDistributionNonInformative = outputDir + + "/sample_distributions/NonInformative.tsv" + File? sampleDistributionToalAggregate = outputDir + + "/sample_distributions/Total.aggregate.tsv" + File? sampleDistributionTotal = outputDir + "/sample_distributions/Total.tsv" + File? sampleDistributionVariantAggregate = outputDir + + "/sample_distributions/Variant.aggregate.tsv" + File? sampleDistributionVariant = outputDir + "/sample_distributions/Variant.tsv" + File? sampleCompareAlleleAbs = outputDir + "/sample_compare/allele.abs.tsv" + File? sampleCompareAlleleNonRefAbs = outputDir + "/sample_compare/allele.non_ref.abs.tsv" + File? sampleCompareAlleleRefAbs = outputDir + "/sample_compare/allele.ref.abs.tsv" + File? sampleCompareAlleleRel = outputDir + "/sample_compare/allele.rel.tsv" + File? sampleCompareGenotypeAbs = outputDir + "/sample_compare/genotype.abs.tsv" + File? sampleCompareGenotypeNonRefAbs = outputDir + + "/sample_compare/genotype.non_ref.abs.tsv" + File? sampleCompareGenotypeRefAbs = outputDir + "/sample_compare/genotype.ref.abs.tsv" + File? sampleCompareGenotypeRel = outputDir + "/sample_compare/genotype.rel.tsv" + } + runtime { cpu: localThreads memory: ceil(memory * memoryMultiplier) diff --git a/bwa.wdl b/bwa.wdl index 01d1b7d08b798083d0bb7dbf6fd74ce4ebe64a14..ba0023a3194c58e85b534d06371d6ab5a5e51184 100644 --- a/bwa.wdl +++ b/bwa.wdl @@ -5,8 +5,7 @@ task Mem { String? preCommand File inputR1 File? inputR2 - File referenceFasta - Array[File] indexFiles # These indexFiles need to be added, otherwise cromwell will not find them. + BwaIndex bwaIndex String outputPath String? readgroup @@ -20,7 +19,7 @@ task Mem { ~{preCommand} bwa mem ~{"-t " + threads} \ ~{"-R '" + readgroup + "'"} \ - ~{referenceFasta} \ + ~{bwaIndex.fastaFile} \ ~{inputR1} \ ~{inputR2} \ | samtools sort --output-fmt BAM - > ~{outputPath} @@ -75,3 +74,7 @@ task Index { } } +struct BwaIndex { + File fastaFile + Array[File] indexFiles +} diff --git a/common.wdl b/common.wdl index 15e99f5804089fdd328f263b21804dc18712e752..379da32aa5d4b795960918ce488811e4a16013ce 100644 --- a/common.wdl +++ b/common.wdl @@ -134,3 +134,9 @@ task StringArrayMd5 { memory: 1 } } + +struct Reference { + File fasta + File fai + File dict +}