diff --git a/test_input_templates/GatherSampleEvidence/GatherSampleEvidenceBatch.json.tmpl b/test_input_templates/GatherSampleEvidence/GatherSampleEvidenceBatch.json.tmpl index e7f66ae45..d2d957972 100644 --- a/test_input_templates/GatherSampleEvidence/GatherSampleEvidenceBatch.json.tmpl +++ b/test_input_templates/GatherSampleEvidence/GatherSampleEvidenceBatch.json.tmpl @@ -19,7 +19,6 @@ "GatherSampleEvidenceBatch.samtools_cloud_docker": {{ dockers.samtools_cloud_docker | tojson }}, "GatherSampleEvidenceBatch.sv_base_mini_docker":{{ dockers.sv_base_mini_docker | tojson }}, "GatherSampleEvidenceBatch.sv_pipeline_docker": {{ dockers.sv_pipeline_docker | tojson }}, - "GatherSampleEvidenceBatch.delly_docker": {{ dockers.delly_docker | tojson }}, "GatherSampleEvidenceBatch.manta_docker": {{ dockers.manta_docker | tojson }}, "GatherSampleEvidenceBatch.melt_docker" : {{ dockers.melt_docker | tojson }}, "GatherSampleEvidenceBatch.wham_docker": {{ dockers.wham_docker | tojson }}, diff --git a/wdl/MELT.wdl b/wdl/MELT.wdl index 109f5dfd8..ab75b959a 100644 --- a/wdl/MELT.wdl +++ b/wdl/MELT.wdl @@ -562,6 +562,7 @@ task RunMELT { Float mem_offset = 6.833 Float mem_size_gb = mem_offset + mem_per_pct_chimeras * pct_chimeras + mem_per_improper_pairs * pf_reads_improper_pairs + Float java_mem_fraction = 0.85 # Ensure there's sufficient disk space. Estimate using extra metrics @@ -610,6 +611,19 @@ task RunMELT { MELT_ROOT=$(find "$MELT_DIR" -name "MELT.jar" | xargs -n1 dirname) MELT_SCRIPT=$(ls "$MELT_DIR/run_MELT"*.sh) + function getJavaMem() { + # get JVM memory in GiB by getting total memory from /proc/meminfo + # and multiplying by java_mem_fraction + cat /proc/meminfo \ + | awk -v MEM_FIELD="$1" '{ + f[substr($1, 1, length($1)-1)] = $2 + } END { + printf "%.2fG", f[MEM_FIELD] * ~{java_mem_fraction} / 1048576 + }' + } + JVM_MAX_MEM=$(getJavaMem MemTotal) + echo "JVM memory: $JVM_MAX_MEM" + # call MELT "$MELT_SCRIPT" \ "~{sample_id}.bam" \