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

change memory settings

parent 09f9e67f
No related branches found
No related tags found
1 merge request!8Run time settings and additional adjustments
...@@ -35,11 +35,12 @@ task ScatterRegions { ...@@ -35,11 +35,12 @@ task ScatterRegions {
Float? memory Float? memory
Float? memoryMultiplier Float? memoryMultiplier
Int mem = ceil(select_first([memory, 4.0]))
command { command {
set -e -o pipefail set -e -o pipefail
${preCommand} ${preCommand}
mkdir -p ${outputDirPath} mkdir -p ${outputDirPath}
java -Xmx${select_first([memory, 2])}G -jar ${tool_jar} \ java -Xmx${mem}G -jar ${tool_jar} \
-R ${ref_fasta} \ -R ${ref_fasta} \
-o ${outputDirPath} \ -o ${outputDirPath} \
${"-s " + scatterSize} \ ${"-s " + scatterSize} \
...@@ -51,7 +52,7 @@ task ScatterRegions { ...@@ -51,7 +52,7 @@ task ScatterRegions {
} }
runtime { runtime {
memory: ceil(select_first([memory, 2.0]) * select_first([memoryMultiplier, 2.0])) memory: ceil(mem * select_first([memoryMultiplier, 2.0]))
} }
} }
...@@ -68,11 +69,12 @@ task SampleConfig { ...@@ -68,11 +69,12 @@ task SampleConfig {
Float? memory Float? memory
Float? memoryMultiplier Float? memoryMultiplier
Int mem = ceil(select_first([memory, 4.0]))
command { command {
set -e -o pipefail set -e -o pipefail
${preCommand} ${preCommand}
mkdir -p . ${"$(dirname " + jsonOutputPath + ")"} ${"$(dirname " + tsvOutputPath + ")"} mkdir -p . ${"$(dirname " + jsonOutputPath + ")"} ${"$(dirname " + tsvOutputPath + ")"}
java -Xmx${select_first([memory, 4])}G -jar ${tool_jar} \ java -Xmx${mem}G -jar ${tool_jar} \
-i ${sep="-i " inputFiles} \ -i ${sep="-i " inputFiles} \
${"--sample " + sample} \ ${"--sample " + sample} \
${"--library " + library} \ ${"--library " + library} \
...@@ -89,7 +91,7 @@ task SampleConfig { ...@@ -89,7 +91,7 @@ task SampleConfig {
} }
runtime { runtime {
memory: ceil(select_first([memory, 4.0]) * select_first([memoryMultiplier, 2.0])) memory: ceil(mem * select_first([memoryMultiplier, 2.0]))
} }
} }
...@@ -104,11 +106,12 @@ task BaseCounter { ...@@ -104,11 +106,12 @@ task BaseCounter {
Float? memory Float? memory
Float? memoryMultiplier Float? memoryMultiplier
Int mem = ceil(select_first([memory, 12.0]))
command { command {
set -e -o pipefail set -e -o pipefail
${preCommand} ${preCommand}
mkdir -p ${outputDir} mkdir -p ${outputDir}
java -Xmx${select_first([memory, 12])}G -jar ${tool_jar} \ java -Xmx${mem}G -jar ${tool_jar} \
-b ${bam} \ -b ${bam} \
-r ${refFlat} \ -r ${refFlat} \
-o ${outputDir} \ -o ${outputDir} \
...@@ -153,6 +156,6 @@ task BaseCounter { ...@@ -153,6 +156,6 @@ task BaseCounter {
} }
runtime { runtime {
memory: ceil(select_first([memory, 12.0]) * select_first([memoryMultiplier, 1.5])) memory: ceil(mem * select_first([memoryMultiplier, 1.5]))
} }
} }
...@@ -66,11 +66,11 @@ task extractAdapters { ...@@ -66,11 +66,11 @@ task extractAdapters {
Float? memory Float? memory
Float? memoryMultiplier Float? memoryMultiplier
Int mem = ceil(select_first([memory, 4.0]))
command { command {
set -e set -e
mkdir -p ${outputDir} mkdir -p ${outputDir}
java -Xmx${select_first([memory, 4])}G -jar ${extractAdaptersFastqcJar} \ java -Xmx${mem}G -jar ${extractAdaptersFastqcJar} \
--inputFile ${inputFile} \ --inputFile ${inputFile} \
${"--adapterOutputFile " + adapterOutputFilePath } \ ${"--adapterOutputFile " + adapterOutputFilePath } \
${"--contamsOutputFile " + contamsOutputFilePath } \ ${"--contamsOutputFile " + contamsOutputFilePath } \
...@@ -89,7 +89,7 @@ task extractAdapters { ...@@ -89,7 +89,7 @@ task extractAdapters {
} }
runtime { runtime {
memory: ceil(select_first([memory, 4.0]) * select_first([memoryMultiplier, 2.5])) memory: ceil(mem * select_first([memoryMultiplier, 2.5]))
} }
} }
......
...@@ -15,10 +15,11 @@ task BaseRecalibrator { ...@@ -15,10 +15,11 @@ task BaseRecalibrator {
Float? memory Float? memory
Float? memoryMultiplier Float? memoryMultiplier
Int mem = ceil(select_first([memory, 4.0]))
command { command {
set -e -o pipefail set -e -o pipefail
${preCommand} ${preCommand}
java -Xms${select_first([memory, 4])}G -jar ${gatk_jar} \ java -Xms${mem}G -jar ${gatk_jar} \
BaseRecalibrator \ BaseRecalibrator \
-R ${ref_fasta} \ -R ${ref_fasta} \
-I ${input_bam} \ -I ${input_bam} \
...@@ -33,7 +34,7 @@ task BaseRecalibrator { ...@@ -33,7 +34,7 @@ task BaseRecalibrator {
} }
runtime { runtime {
memory: ceil(select_first([memory, 4.0]) * select_first([memoryMultiplier, 1.5])) memory: ceil(mem * select_first([memoryMultiplier, 1.5]))
} }
} }
...@@ -53,11 +54,12 @@ task ApplyBQSR { ...@@ -53,11 +54,12 @@ task ApplyBQSR {
Float? memory Float? memory
Float? memoryMultiplier Float? memoryMultiplier
Int mem = ceil(select_first([memory, 4.0]))
command { command {
set -e -o pipefail set -e -o pipefail
${preCommand} ${preCommand}
java ${"-Dsamjdk.compression_level=" + compression_level} \ java ${"-Dsamjdk.compression_level=" + compression_level} \
-Xms${select_first([memory, 4])}G -jar ${gatk_jar} \ -Xms${mem}G -jar ${gatk_jar} \
ApplyBQSR \ ApplyBQSR \
--create-output-bam-md5 \ --create-output-bam-md5 \
--add-output-sam-program-record \ --add-output-sam-program-record \
...@@ -76,7 +78,7 @@ task ApplyBQSR { ...@@ -76,7 +78,7 @@ task ApplyBQSR {
} }
runtime { runtime {
memory: ceil(select_first([memory, 4.0]) * select_first([memoryMultiplier, 1.5])) memory: ceil(mem * select_first([memoryMultiplier, 1.5]))
} }
} }
...@@ -90,10 +92,11 @@ task GatherBqsrReports { ...@@ -90,10 +92,11 @@ task GatherBqsrReports {
Float? memory Float? memory
Float? memoryMultiplier Float? memoryMultiplier
Int mem = ceil(select_first([memory, 4.0]))
command { command {
set -e -o pipefail set -e -o pipefail
${preCommand} ${preCommand}
java -Xms${select_first([memory, 4])}G -jar ${gatk_jar} \ java -Xms${mem}G -jar ${gatk_jar} \
GatherBQSRReports \ GatherBQSRReports \
-I ${sep=' -I ' input_bqsr_reports} \ -I ${sep=' -I ' input_bqsr_reports} \
-O ${output_report_filepath} -O ${output_report_filepath}
...@@ -104,7 +107,7 @@ task GatherBqsrReports { ...@@ -104,7 +107,7 @@ task GatherBqsrReports {
} }
runtime { runtime {
memory: ceil(select_first([memory, 4.0]) * select_first([memoryMultiplier, 1.5])) memory: ceil(mem * select_first([memoryMultiplier, 1.5]))
} }
} }
...@@ -125,11 +128,12 @@ task HaplotypeCallerGvcf { ...@@ -125,11 +128,12 @@ task HaplotypeCallerGvcf {
Float? memory Float? memory
Float? memoryMultiplier Float? memoryMultiplier
Int mem = ceil(select_first([memory, 4.0]))
command { command {
set -e -o pipefail set -e -o pipefail
${preCommand} ${preCommand}
java ${"-Dsamjdk.compression_level=" + compression_level} \ java ${"-Dsamjdk.compression_level=" + compression_level} \
-Xmx${select_first([memory, 4])}G -jar ${gatk_jar} \ -Xmx${mem}G -jar ${gatk_jar} \
HaplotypeCaller \ HaplotypeCaller \
-R ${ref_fasta} \ -R ${ref_fasta} \
-O ${gvcf_basename}.vcf.gz \ -O ${gvcf_basename}.vcf.gz \
...@@ -145,7 +149,7 @@ task HaplotypeCallerGvcf { ...@@ -145,7 +149,7 @@ task HaplotypeCallerGvcf {
} }
runtime { runtime {
memory: ceil(select_first([memory, 4]) * select_first([memoryMultiplier, 1.5])) memory: ceil(mem * select_first([memoryMultiplier, 1.5]))
} }
} }
...@@ -170,12 +174,13 @@ task GenotypeGVCFs { ...@@ -170,12 +174,13 @@ task GenotypeGVCFs {
Float? memory Float? memory
Float? memoryMultiplier Float? memoryMultiplier
Int mem = ceil(select_first([memory, 4.0]))
command { command {
set -e -o pipefail set -e -o pipefail
${preCommand} ${preCommand}
java ${"-Dsamjdk.compression_level=" + compression_level} \ java ${"-Dsamjdk.compression_level=" + compression_level} \
-Xmx${select_first([memory, 4])}G -jar ${gatk_jar} \ -Xmx${mem}G -jar ${gatk_jar} \
GenotypeGVCFs \ GenotypeGVCFs \
-R ${ref_fasta} \ -R ${ref_fasta} \
-O ${output_basename + ".vcf.gz"} \ -O ${output_basename + ".vcf.gz"} \
...@@ -193,7 +198,7 @@ task GenotypeGVCFs { ...@@ -193,7 +198,7 @@ task GenotypeGVCFs {
} }
runtime{ runtime{
memory: ceil(select_first([memory, 4.0]) * select_first([memoryMultiplier, 1.5])) memory: ceil(mem * select_first([memoryMultiplier, 1.5]))
} }
} }
...@@ -215,13 +220,14 @@ task CombineGVCFs { ...@@ -215,13 +220,14 @@ task CombineGVCFs {
Float? memory Float? memory
Float? memoryMultiplier Float? memoryMultiplier
Int mem = ceil(select_first([memory, 4.0]))
command { command {
set -e -o pipefail set -e -o pipefail
${preCommand} ${preCommand}
if [ ${length(gvcf_files)} -gt 1 ]; then if [ ${length(gvcf_files)} -gt 1 ]; then
java ${"-Dsamjdk.compression_level=" + compression_level} \ java ${"-Dsamjdk.compression_level=" + compression_level} \
-Xmx${select_first([memory, 4])}G -jar ${gatk_jar} \ -Xmx${mem}G -jar ${gatk_jar} \
CombineGVCFs \ CombineGVCFs \
-R ${ref_fasta} \ -R ${ref_fasta} \
-O ${output_basename + ".vcf.gz"} \ -O ${output_basename + ".vcf.gz"} \
...@@ -239,7 +245,7 @@ task CombineGVCFs { ...@@ -239,7 +245,7 @@ task CombineGVCFs {
} }
runtime { runtime {
memory: ceil(select_first([memory, 4.0]) * select_first([memoryMultiplier, 1.5])) memory: ceil(mem * select_first([memoryMultiplier, 1.5]))
} }
} }
...@@ -257,10 +263,11 @@ task SplitNCigarReads { ...@@ -257,10 +263,11 @@ task SplitNCigarReads {
Float? memory Float? memory
Float? memoryMultiplier Float? memoryMultiplier
Int mem = ceil(select_first([memory, 4.0]))
command { command {
set -e -o pipefail set -e -o pipefail
${preCommand} ${preCommand}
java -Xms${select_first([memory, 4])}G -jar ${gatk_jar} \ java -Xms${mem}G -jar ${gatk_jar} \
-I ${input_bam} \ -I ${input_bam} \
-R ${ref_fasta} \ -R ${ref_fasta} \
-O ${output_bam} # might have to be -o depending on GATK version \ -O ${output_bam} # might have to be -o depending on GATK version \
...@@ -273,6 +280,6 @@ task SplitNCigarReads { ...@@ -273,6 +280,6 @@ task SplitNCigarReads {
} }
runtime { runtime {
memory: ceil(select_first([memory, 4.0]) * select_first([memoryMultiplier, 1.5])) memory: ceil(mem * select_first([memoryMultiplier, 1.5]))
} }
} }
...@@ -7,11 +7,12 @@ task ScatterIntervalList { ...@@ -7,11 +7,12 @@ task ScatterIntervalList {
Float? memory Float? memory
Float? memoryMultiplier Float? memoryMultiplier
Int mem = ceil(select_first([memory, 4.0]))
command { command {
set -e -o pipefail set -e -o pipefail
${preCommand} ${preCommand}
mkdir scatter_list mkdir scatter_list
java -Xmx${select_first([memory, 4])}G -jar ${picard_jar} \ java -Xmx${mem}G -jar ${picard_jar} \
IntervalListTools \ IntervalListTools \
SCATTER_COUNT=${scatter_count} \ SCATTER_COUNT=${scatter_count} \
SUBDIVISION_MODE=BALANCING_WITHOUT_INTERVAL_SUBDIVISION_WITH_OVERFLOW \ SUBDIVISION_MODE=BALANCING_WITHOUT_INTERVAL_SUBDIVISION_WITH_OVERFLOW \
...@@ -27,7 +28,7 @@ task ScatterIntervalList { ...@@ -27,7 +28,7 @@ task ScatterIntervalList {
} }
runtime { runtime {
memory: ceil(select_first([memory, 4.0]) * select_first([memoryMultiplier, 1.5])) memory: ceil(mem * select_first([memoryMultiplier, 1.5]))
} }
} }
...@@ -42,11 +43,12 @@ task GatherBamFiles { ...@@ -42,11 +43,12 @@ task GatherBamFiles {
Float? memory Float? memory
Float? memoryMultiplier Float? memoryMultiplier
Int mem = ceil(select_first([memory, 4.0]))
command { command {
set -e -o pipefail set -e -o pipefail
${preCommand} ${preCommand}
java ${"-Dsamjdk.compression_level=" + compression_level} \ java ${"-Dsamjdk.compression_level=" + compression_level} \
-Xmx${select_first([memory, 4])}G -jar ${picard_jar} \ -Xmx${mem}G -jar ${picard_jar} \
GatherBamFiles \ GatherBamFiles \
INPUT=${sep=' INPUT=' input_bams} \ INPUT=${sep=' INPUT=' input_bams} \
OUTPUT=${output_bam_path} \ OUTPUT=${output_bam_path} \
...@@ -61,7 +63,7 @@ task GatherBamFiles { ...@@ -61,7 +63,7 @@ task GatherBamFiles {
} }
runtime { runtime {
memory: ceil(select_first([memory, 4.0]) * select_first([memoryMultiplier, 1.5])) memory: ceil(mem * select_first([memoryMultiplier, 1.5]))
} }
} }
...@@ -85,12 +87,13 @@ task MarkDuplicates { ...@@ -85,12 +87,13 @@ task MarkDuplicates {
# Task is assuming query-sorted input so that the Secondary and Supplementary reads get marked correctly # Task is assuming query-sorted input so that the Secondary and Supplementary reads get marked correctly
# This works because the output of BWA is query-grouped and therefore, so is the output of MergeBamAlignment. # This works because the output of BWA is query-grouped and therefore, so is the output of MergeBamAlignment.
# While query-grouped isn't actually query-sorted, it's good enough for MarkDuplicates with ASSUME_SORT_ORDER="queryname" # While query-grouped isn't actually query-sorted, it's good enough for MarkDuplicates with ASSUME_SORT_ORDER="queryname"
Int mem = ceil(select_first([memory, 4.0]))
command { command {
set -e -o pipefail set -e -o pipefail
${preCommand} ${preCommand}
mkdir -p $(dirname ${output_bam_path}) mkdir -p $(dirname ${output_bam_path})
java ${"-Dsamjdk.compression_level=" + compression_level} \ java ${"-Dsamjdk.compression_level=" + compression_level} \
-Xmx${select_first([memory, 4])}G -jar ${picard_jar} \ -Xmx${mem}G -jar ${picard_jar} \
MarkDuplicates \ MarkDuplicates \
INPUT=${sep=' INPUT=' input_bams} \ INPUT=${sep=' INPUT=' input_bams} \
OUTPUT=${output_bam_path} \ OUTPUT=${output_bam_path} \
...@@ -110,7 +113,7 @@ task MarkDuplicates { ...@@ -110,7 +113,7 @@ task MarkDuplicates {
} }
runtime { runtime {
memory: ceil(select_first([memory, 8.0]) * select_first([memoryMultiplier, 1.5])) memory: ceil(mem * select_first([memoryMultiplier, 1.5]))
} }
} }
...@@ -128,11 +131,12 @@ task MergeVCFs { ...@@ -128,11 +131,12 @@ task MergeVCFs {
# Using MergeVcfs instead of GatherVcfs so we can create indices # Using MergeVcfs instead of GatherVcfs so we can create indices
# See https://github.com/broadinstitute/picard/issues/789 for relevant GatherVcfs ticket # See https://github.com/broadinstitute/picard/issues/789 for relevant GatherVcfs ticket
Int mem = ceil(select_first([memory, 4.0]))
command { command {
set -e -o pipefail set -e -o pipefail
${preCommand} ${preCommand}
java ${"-Dsamjdk.compression_level=" + compression_level} \ java ${"-Dsamjdk.compression_level=" + compression_level} \
-Xmx${select_first([memory, 4])}G -jar ${picard_jar} \ -Xmx${mem}G -jar ${picard_jar} \
MergeVcfs \ MergeVcfs \
INPUT=${sep=' INPUT=' input_vcfs} \ INPUT=${sep=' INPUT=' input_vcfs} \
OUTPUT=${output_vcf_path} OUTPUT=${output_vcf_path}
...@@ -144,6 +148,6 @@ task MergeVCFs { ...@@ -144,6 +148,6 @@ task MergeVCFs {
} }
runtime { runtime {
memory: ceil(select_first([memory, 4.0]) * select_first([memoryMultiplier, 1.5])) memory: ceil(mem * select_first([memoryMultiplier, 1.5]))
} }
} }
\ No newline at end of file
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