Skip to content
Snippets Groups Projects
Commit e2c52a71 authored by Cats's avatar Cats
Browse files

style

parent de411900
No related branches found
No related tags found
1 merge request!17Caching related changes
# Generate Base Quality Score Recalibration (BQSR) model # Apply Base Quality Score Recalibration (BQSR) model
task BaseRecalibrator { task ApplyBQSR {
String? preCommand String? preCommand
String gatk_jar File gatkJar
String input_bam File inputBam
String input_bam_index String outputBamPath
String recalibration_report_filename File recalibrationReport
Array[File]+ sequence_group_interval Array[File]+ sequenceGroupInterval
Array[File]+ known_indels_sites_VCFs File refDict
Array[File]+ known_indels_sites_indices File refFasta
File ref_dict File refFastaIndex
File ref_fasta Int? compressionLevel
File ref_fasta_index
Float? memory Float? memory
Float? memoryMultiplier Float? memoryMultiplier
...@@ -19,18 +18,23 @@ task BaseRecalibrator { ...@@ -19,18 +18,23 @@ task BaseRecalibrator {
command { command {
set -e -o pipefail set -e -o pipefail
${preCommand} ${preCommand}
java -Xms${mem}G -jar ${gatk_jar} \ java ${"-Dsamjdk.compression_level=" + compressionLevel} \
BaseRecalibrator \ -Xms${mem}G -jar ${gatkJar} \
-R ${ref_fasta} \ ApplyBQSR \
-I ${input_bam} \ --create-output-bam-md5 \
--add-output-sam-program-record \
-R ${refFasta} \
-I ${inputBam} \
--use-original-qualities \ --use-original-qualities \
-O ${recalibration_report_filename} \ -O ${outputBamPath} \
--known-sites ${sep=" --known-sites " known_indels_sites_VCFs} \ -bqsr ${recalibrationReport} \
-L ${sep=" -L " sequence_group_interval} --static-quantized-quals 10 --static-quantized-quals 20 --static-quantized-quals 30 \
-L ${sep=" -L " sequenceGroupInterval}
} }
output { output {
File recalibration_report = "${recalibration_report_filename}" File recalibrated_bam = outputBamPath
File recalibrated_bam_checksum = outputBamPath + ".md5"
} }
runtime { runtime {
...@@ -38,18 +42,19 @@ task BaseRecalibrator { ...@@ -38,18 +42,19 @@ task BaseRecalibrator {
} }
} }
# Apply Base Quality Score Recalibration (BQSR) model # Generate Base Quality Score Recalibration (BQSR) model
task ApplyBQSR { task BaseRecalibrator {
String? preCommand String? preCommand
String gatk_jar File gatkJar
String input_bam File inputBam
String output_bam_path File inputBamIndex
File recalibration_report String recalibrationReportPath
Array[String] sequence_group_interval Array[File]+ sequenceGroupInterval
File ref_dict Array[File]+ knownIndelsSitesVCFs
File ref_fasta Array[File]+ knownIndelsSitesIndices
File ref_fasta_index File refDict
Int? compression_level File refFasta
File refFastaIndex
Float? memory Float? memory
Float? memoryMultiplier Float? memoryMultiplier
...@@ -58,23 +63,18 @@ task ApplyBQSR { ...@@ -58,23 +63,18 @@ task ApplyBQSR {
command { command {
set -e -o pipefail set -e -o pipefail
${preCommand} ${preCommand}
java ${"-Dsamjdk.compression_level=" + compression_level} \ java -Xms${mem}G -jar ${gatkJar} \
-Xms${mem}G -jar ${gatk_jar} \ BaseRecalibrator \
ApplyBQSR \ -R ${refFasta} \
--create-output-bam-md5 \ -I ${inputBam} \
--add-output-sam-program-record \
-R ${ref_fasta} \
-I ${input_bam} \
--use-original-qualities \ --use-original-qualities \
-O ${output_bam_path} \ -O ${recalibrationReportPath} \
-bqsr ${recalibration_report} \ --known-sites ${sep=" --known-sites " knownIndelsSitesVCFs} \
--static-quantized-quals 10 --static-quantized-quals 20 --static-quantized-quals 30 \ -L ${sep=" -L " sequenceGroupInterval}
-L ${sep=" -L " sequence_group_interval}
} }
output { output {
File recalibrated_bam = "${output_bam_path}" File recalibrationReport = recalibrationReportPath
File recalibrated_bam_checksum = "${output_bam_path}.md5"
} }
runtime { runtime {
...@@ -82,13 +82,21 @@ task ApplyBQSR { ...@@ -82,13 +82,21 @@ task ApplyBQSR {
} }
} }
# Combine multiple recalibration tables from scattered BaseRecalibrator runs task CombineGVCFs {
task GatherBqsrReports {
String? preCommand String? preCommand
String gatk_jar Array[File]+ gvcfFiles
Array[File] input_bqsr_reports Array[File]+ gvcfFileIndexes
String output_report_filepath Array[File]+ intervals
String outputPath
String gatkJar
File refFasta
File refFastaIndex
File refDict
Int? compressionLevel
Float? memory Float? memory
Float? memoryMultiplier Float? memoryMultiplier
...@@ -96,14 +104,24 @@ task GatherBqsrReports { ...@@ -96,14 +104,24 @@ task GatherBqsrReports {
command { command {
set -e -o pipefail set -e -o pipefail
${preCommand} ${preCommand}
java -Xms${mem}G -jar ${gatk_jar} \
GatherBQSRReports \ if [ ${length(gvcfFiles)} -gt 1 ]; then
-I ${sep=' -I ' input_bqsr_reports} \ java ${"-Dsamjdk.compression_level=" + compressionLevel} \
-O ${output_report_filepath} -Xmx${mem}G -jar ${gatkJar} \
CombineGVCFs \
-R ${refFasta} \
-O ${outputPath} \
-V ${sep=' -V ' gvcfFiles} \
-L ${sep=' -L ' intervals}
else # TODO this should be handeled in wdl
ln -sf ${select_first(gvcfFiles)} ${outputPath}
ln -sf ${select_first(gvcfFileIndexes)} ${outputPath}.tbi
fi
} }
output { output {
File output_bqsr_report = "${output_report_filepath}" File outputGVCF = outputPath
File outputGVCFindex = outputPath + ".tbi"
} }
runtime { runtime {
...@@ -111,19 +129,12 @@ task GatherBqsrReports { ...@@ -111,19 +129,12 @@ task GatherBqsrReports {
} }
} }
# Call variants on a single sample with HaplotypeCaller to produce a GVCF # Combine multiple recalibration tables from scattered BaseRecalibrator runs
task HaplotypeCallerGvcf { task GatherBqsrReports {
String? preCommand String? preCommand
Array[File]+ inputBams
Array[File]+ inputBamsIndex
Array[File]+ intervalList
String gvcfPath
File refDict
File refFasta
File refFastaIndex
Float? contamination
Int? compressionLevel
String gatkJar String gatkJar
Array[File] inputBQSRreports
String outputReportPath
Float? memory Float? memory
Float? memoryMultiplier Float? memoryMultiplier
...@@ -132,20 +143,14 @@ task HaplotypeCallerGvcf { ...@@ -132,20 +143,14 @@ task HaplotypeCallerGvcf {
command { command {
set -e -o pipefail set -e -o pipefail
${preCommand} ${preCommand}
java ${"-Dsamjdk.compression_level=" + compressionLevel} \ java -Xms${mem}G -jar ${gatkJar} \
-Xmx${mem}G -jar ${gatkJar} \ GatherBQSRReports \
HaplotypeCaller \ -I ${sep=' -I ' inputBQSRreports} \
-R ${refFasta} \ -O ${outputReportPath}
-O ${gvcfPath} \
-I ${sep=" -I " inputBams} \
-L ${sep=' -L ' intervalList} \
-contamination ${default=0 contamination} \
-ERC GVCF
} }
output { output {
File outputGVCF = gvcfPath File outputBQSRreport = outputReportPath
File outputGVCFindex = gvcfPath + ".tbi"
} }
runtime { runtime {
...@@ -202,21 +207,20 @@ task GenotypeGVCFs { ...@@ -202,21 +207,20 @@ task GenotypeGVCFs {
} }
} }
task CombineGVCFs { # Call variants on a single sample with HaplotypeCaller to produce a GVCF
task HaplotypeCallerGvcf {
String? preCommand String? preCommand
Array[File]+ gvcfFiles Array[File]+ inputBams
Array[File]+ gvcfFileIndexes Array[File]+ inputBamsIndex
Array[File]+ intervals Array[File]+ intervalList
String gvcfPath
String outputPath File refDict
String gatkJar
File refFasta File refFasta
File refFastaIndex File refFastaIndex
File refDict Float? contamination
Int? compressionLevel Int? compressionLevel
String gatkJar
Float? memory Float? memory
Float? memoryMultiplier Float? memoryMultiplier
...@@ -224,24 +228,20 @@ task CombineGVCFs { ...@@ -224,24 +228,20 @@ task CombineGVCFs {
command { command {
set -e -o pipefail set -e -o pipefail
${preCommand} ${preCommand}
java ${"-Dsamjdk.compression_level=" + compressionLevel} \
if [ ${length(gvcfFiles)} -gt 1 ]; then -Xmx${mem}G -jar ${gatkJar} \
java ${"-Dsamjdk.compression_level=" + compressionLevel} \ HaplotypeCaller \
-Xmx${mem}G -jar ${gatkJar} \ -R ${refFasta} \
CombineGVCFs \ -O ${gvcfPath} \
-R ${refFasta} \ -I ${sep=" -I " inputBams} \
-O ${outputPath} \ -L ${sep=' -L ' intervalList} \
-V ${sep=' -V ' gvcfFiles} \ -contamination ${default=0 contamination} \
-L ${sep=' -L ' intervals} -ERC GVCF
else
ln -sf ${select_first(gvcfFiles)} ${outputPath}
ln -sf ${select_first(gvcfFileIndexes)} ${outputPath}.tbi
fi
} }
output { output {
File outputGVCF = outputPath File outputGVCF = gvcfPath
File outputGVCFindex = outputPath + ".tbi" File outputGVCFindex = gvcfPath + ".tbi"
} }
runtime { runtime {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment