Skip to content

Commit

Permalink
modifs for callcaching behaviour, removed useles files, modified fina…
Browse files Browse the repository at this point in the history
…l outputs
  • Loading branch information
beboche committed Aug 17, 2018
1 parent e975a96 commit f8a9ddd
Show file tree
Hide file tree
Showing 8 changed files with 40 additions and 23 deletions.
5 changes: 3 additions & 2 deletions modules/bwaSamtools.wdl
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,8 @@ task bwaSamtools {
String BwaExe
String Platform
File RefFasta
File RefFai
#File RefFai
#RefFai useles for bwa
#index files for bwa
File RefAmb
File RefAnn
Expand All @@ -32,4 +33,4 @@ task bwaSamtools {
File sortedBam = "${OutDir}${SampleID}/${WorkflowType}/${SampleID}.bam"
#File sortedBamIndex = "${OutDir}${SampleID}/${WorkflowType}/${SampleID}.bam.bai"
}
}
}
16 changes: 9 additions & 7 deletions modules/cleanUpPanelCaptureTmpDirs.wdl
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,10 @@ task cleanUpPanelCaptureTmpDirs {
String WorkflowType
File FinalVcf
Array[String] BamArray
String FinalBam
String FinalBamIndex
#String FinalBam
#String FinalBamIndex
#String FinalCram
#String FinalCramIndex
Array[String] VcfArray
command {
if [ -d "${OutDir}${SampleID}/${WorkflowType}/splitted_intervals" ];then \
Expand All @@ -24,12 +26,12 @@ task cleanUpPanelCaptureTmpDirs {
fi
rm ${sep=" " BamArray}
rm ${sep=" " VcfArray}
#mv "${FinalBam}" "${OutDir}${SampleID}/${WorkflowType}/${SampleID}.bam"
#mv "${FinalBamIndex}" "${OutDir}${SampleID}/${WorkflowType}/${SampleID}.bam.bai"
}
output {
File finalBam = "${FinalBam}"
File finalBamIndex = "${FinalBamIndex}"
#File finalBam = "${FinalBam}"
#File finalBamIndex = "${FinalBamIndex}"
#File finalCram = "${FinalCram}"
#File finalCramIndex = "${FinalCramIndex}"
File finalVcf = "${FinalVcf}"
}
}
}
4 changes: 2 additions & 2 deletions modules/computeCoverage.wdl
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,9 @@ task computeCoverage {
command <<<
${SortExe} -k1,1 -k2,2n -k3,3n ${BedCovFile} \
| ${AwkExe} 'BEGIN {OFS="\t"}{a=($3-$2+1);b=($7/a);print $1,$2,$3,$4,b,"+","+"}' \
> "${OutDir}/${SampleID}/${WorkflowType}/coverage/${SampleID}_coverage.tsv"
> "${OutDir}${SampleID}/${WorkflowType}/coverage/${SampleID}_coverage.tsv"
>>>
output {
File TsvCoverageFile = "${OutDir}/${SampleID}/${WorkflowType}/coverage/${SampleID}_coverage.tsv"
File TsvCoverageFile = "${OutDir}${SampleID}/${WorkflowType}/coverage/${SampleID}_coverage.tsv"
}
}
4 changes: 2 additions & 2 deletions modules/computeCoverageClamms.wdl
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,9 @@ task computeCoverageClamms {
command <<<
${SortExe} -k1,1 -k2,2n -k3,3n ${BedCovFile} \
| awk '{ printf "%s\t%d\t%d\t%.6g\n", $1, $2, $3, $NF/($3-$2); }' \
> "${OutDir}/${SampleID}/${WorkflowType}/coverage/${SampleID}_coverage.bed"
> "${OutDir}${SampleID}/${WorkflowType}/coverage/${SampleID}_coverage.bed"
>>>
output {
File ClammsCoverageFile = "${OutDir}/${SampleID}/${WorkflowType}/coverage/${SampleID}_coverage.bed"
File ClammsCoverageFile = "${OutDir}${SampleID}/${WorkflowType}/coverage/${SampleID}_coverage.bed"
}
}
4 changes: 2 additions & 2 deletions modules/computePoorCoverage.wdl
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,9 @@ task computePoorCoverage {
| ${BedToolsExe} merge -c 4 -o distinct -i - \
| ${AwkExe} -v small_intervall="${BedToolsSmallInterval}" \
'BEGIN {OFS="\t";print "#chr","start","end","region","size bp","type","UCSC link"} {a=($3-$2+1);if(a<small_intervall) {b="SMALL_INTERVAL"} else {b="OTHER"};url="http://genome-euro.ucsc.edu/cgi-bin/hgTracks?db='${GenomeVersion}'&position="$1":"$2-10"-"$3+10"&highlight='${GenomeVersion}'."$1":"$2"-"$3;print $0, a, b, url}' \
> "${OutDir}/${SampleID}/${WorkflowType}/coverage/${SampleID}_poor_coverage.tsv"
> "${OutDir}${SampleID}/${WorkflowType}/coverage/${SampleID}_poor_coverage.tsv"
>>>
output {
File poorCoverageFile = "${OutDir}/${SampleID}/${WorkflowType}/coverage/${SampleID}_poor_coverage.tsv"
File poorCoverageFile = "${OutDir}${SampleID}/${WorkflowType}/coverage/${SampleID}_poor_coverage.tsv"
}
}
4 changes: 3 additions & 1 deletion modules/gatkHaplotypeCaller.wdl
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@ task gatkHaplotypeCaller {
String intervalName = basename("${GatkInterval}", ".intervals")
File BamFile
File BamIndex
#when callcaching on, seem to keep Bam and index in the same directory for HC execution
Pair[File, File] Bam = (BamFile, BamIndex)
String SwMode
command {
${SrunLow} ${GatkExe} HaplotypeCaller \
Expand All @@ -28,4 +30,4 @@ task gatkHaplotypeCaller {
output {
File hcVcf = "${OutDir}${SampleID}/${WorkflowType}/vcfs/${SampleID}.${intervalName}.vcf"
}
}
}
4 changes: 2 additions & 2 deletions modules/multiqc.wdl
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@ task multiqc {
String MultiqcExe
File Vcf
command {
${SrunLow} ${MultiqcExe} -o "${OutDir}${SampleID}/${WorkflowType}/" -n "${SampleID}_multiqc" "${OutDir}${SampleID}/${WorkflowType}/"
${SrunLow} ${MultiqcExe} -o "${OutDir}${SampleID}/${WorkflowType}/" -n "${SampleID}_multiqc" "${OutDir}${SampleID}/${WorkflowType}/" -f
}
output {
File multiqcHtml = "${OutDir}${SampleID}/${WorkflowType}/${SampleID}_multiqc.html"
}
}
}
22 changes: 17 additions & 5 deletions panelCapture.wdl
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,11 @@ import "modules/cleanUpPanelCaptureTmpDirs.wdl" as runCleanUpPanelCaptureTmpDirs
import "modules/multiqc.wdl" as runMultiqc

workflow panelCapture {
meta {
author: "David Baux"
email: "david.baux(at)inserm.fr"
}
#variables declarations
#global
String srunHigh
String srunLow
Expand Down Expand Up @@ -145,7 +150,7 @@ workflow panelCapture {
BwaExe = bwaExe,
Platform = platform,
RefFasta = refFasta,
RefFai = refFai,
#RefFai = refFai,
RefAmb = refAmb,
RefAnn = refAnn,
RefBwt = refBwt,
Expand Down Expand Up @@ -558,8 +563,10 @@ workflow panelCapture {
WorkflowType = workflowType,
FinalVcf = compressIndexVcf.bgZippedVcf,
BamArray = ["${dataPath}" + basename(sambambaMarkDup.markedBam), "${dataPath}" + basename(sambambaMarkDup.markedBamIndex), "${dataPath}" + basename(gatkGatherBQSRReports.gatheredRecalTable), "${dataPath}" + basename(gatkGatherBamFiles.gatheredBam)],
FinalBam = "${dataPath}" + basename(samtoolsSort.sortedBam),
FinalBamIndex = "${dataPath}" + basename(finalIndexing.bamIndex),
#FinalBam = "${dataPath}" + basename(samtoolsSort.sortedBam),
#FinalBamIndex = "${dataPath}" + basename(finalIndexing.bamIndex),
#FinalCram = "${dataPath}" + basename(samtoolsCramConvert.cram),
#FinalCramIndex = "${dataPath}" + basename(samtoolsCramIndex.cramIndex),
VcfArray = ["${dataPath}" + basename(gatkGatherVcfs.gatheredHcVcf), "${dataPath}" + basename(gatkGatherVcfs.gatheredHcVcfIndex), "${dataPath}" + basename(jvarkitVcfPolyX.polyxedVcf), "${dataPath}" + basename(jvarkitVcfPolyX.polyxedVcfIndex), "${dataPath}" + basename(gatkSplitVcfs.snpVcf), "${dataPath}" + basename(gatkSplitVcfs.snpVcfIndex), "${dataPath}" + basename(gatkSplitVcfs.indelVcf), "${dataPath}" + basename(gatkSplitVcfs.indelVcfIndex), "${dataPath}" + basename(gatkVariantFiltrationSnp.filteredSnpVcf), "${dataPath}" + basename(gatkVariantFiltrationSnp.filteredSnpVcfIndex), "${dataPath}" + basename(gatkVariantFiltrationIndel.filteredIndelVcf), "${dataPath}" + basename(gatkVariantFiltrationIndel.filteredIndelVcfIndex), "${dataPath}" + basename(gatkMergeVcfs.mergedVcf), "${dataPath}" + basename(gatkMergeVcfs.mergedVcfIndex), "${dataPath}" + basename(gatkSortVcf.sortedVcf), "${dataPath}" + basename(gatkSortVcf.sortedVcfIndex)]
}
call runMultiqc.multiqc {
Expand All @@ -571,6 +578,11 @@ workflow panelCapture {
MultiqcExe = multiqcExe,
Vcf = cleanUpPanelCaptureTmpDirs.finalVcf
}


output {
File FinalVcf = cleanUpPanelCaptureTmpDirs.finalVcf
#FinalBam = "${dataPath}" + basename(samtoolisSort.sortedBam),
#FinalBamIndex = "${dataPath}" + basename(finalIndexing.bamIndex),
File FinalCram = samtoolsCramConvert.cram
File FinalCramIndex = samtoolsCramIndex.cramIndex
}
}

0 comments on commit f8a9ddd

Please sign in to comment.