Skip to content
Snippets Groups Projects
Verified Commit ca0ecd54 authored by Laurent Modolo's avatar Laurent Modolo
Browse files

gatk4: add xmx_memory parsing for every process

parent ead3fe96
No related branches found
No related tags found
No related merge requests found
...@@ -13,8 +13,9 @@ process variant_calling { ...@@ -13,8 +13,9 @@ process variant_calling {
tuple val(file_id), path("*.vcf"), emit: vcf tuple val(file_id), path("*.vcf"), emit: vcf
script: script:
xmx_memory = task.memory - ~/\s*GB/
""" """
gatk --java-options "-Xmx${task.memory}" -T HaplotypeCaller \ gatk --java-options "-Xmx${xmx_memory}" -T HaplotypeCaller \
-nct ${task.cpus} \ -nct ${task.cpus} \
-R ${fasta} \ -R ${fasta} \
-I ${bam} \ -I ${bam} \
...@@ -33,8 +34,9 @@ process filter_snp { ...@@ -33,8 +34,9 @@ process filter_snp {
output: output:
tuple val(file_id), path("*_snp.vcf"), emit: vcf tuple val(file_id), path("*_snp.vcf"), emit: vcf
script: script:
xmx_memory = task.memory - ~/\s*GB/
""" """
gatk --java-options "-Xmx${task.memory}" -T SelectVariants \ gatk --java-options "-Xmx${xmx_memory}" -T SelectVariants \
-nct ${task.cpus} \ -nct ${task.cpus} \
-R ${fasta} \ -R ${fasta} \
-V ${vcf} \ -V ${vcf} \
...@@ -54,8 +56,9 @@ process filter_indels { ...@@ -54,8 +56,9 @@ process filter_indels {
output: output:
tuple val(file_id), path("*_indel.vcf"), emit: vcf tuple val(file_id), path("*_indel.vcf"), emit: vcf
script: script:
xmx_memory = task.memory - ~/\s*GB/
""" """
gatk --java-options "-Xmx${task.memory}" -T SelectVariants \ gatk --java-options "-Xmx${xmx_memory}"-T SelectVariants \
-nct ${task.cpus} \ -nct ${task.cpus} \
-R ${fasta} \ -R ${fasta} \
-V ${vcf} \ -V ${vcf} \
...@@ -77,8 +80,9 @@ process high_confidence_snp { ...@@ -77,8 +80,9 @@ process high_confidence_snp {
output: output:
tuple val(file_id), path("*_snp.vcf"), emit: vcf tuple val(file_id), path("*_snp.vcf"), emit: vcf
script: script:
xmx_memory = task.memory - ~/\s*GB/
""" """
gatk --java-options "-Xmx${task.memory}" -T VariantFiltration \ gatk --java-options "-Xmx${xmx_memory}"-T VariantFiltration \
-nct ${task.cpus} \ -nct ${task.cpus} \
-R ${fasta} \ -R ${fasta} \
-V ${vcf} \ -V ${vcf} \
...@@ -101,8 +105,9 @@ process high_confidence_indels { ...@@ -101,8 +105,9 @@ process high_confidence_indels {
output: output:
tuple val(file_id), path("*_indel.vcf"), emit: vcf tuple val(file_id), path("*_indel.vcf"), emit: vcf
script: script:
xmx_memory = task.memory - ~/\s*GB/
""" """
gatk --java-options "-Xmx${task.memory}" -T VariantFiltration \ gatk --java-options "-Xmx${xmx_memory}" -T VariantFiltration \
-nct ${task.cpus} \ -nct ${task.cpus} \
-R ${fasta} \ -R ${fasta} \
-V ${vcf} \ -V ${vcf} \
...@@ -123,8 +128,9 @@ process recalibrate_snp_table { ...@@ -123,8 +128,9 @@ process recalibrate_snp_table {
output: output:
tuple val(file_id), path("recal_data_table"), emit: recal_table tuple val(file_id), path("recal_data_table"), emit: recal_table
script: script:
xmx_memory = task.memory - ~/\s*GB/
""" """
gatk --java-options "-Xmx${task.memory}" -T BaseRecalibrator \ gatk --java-options "-Xmx${xmx_memory}" -T BaseRecalibrator \
-nct ${task.cpus} \ -nct ${task.cpus} \
-R ${fasta} \ -R ${fasta} \
-I ${bam} \ -I ${bam} \
...@@ -146,8 +152,9 @@ process recalibrate_snp { ...@@ -146,8 +152,9 @@ process recalibrate_snp {
output: output:
tuple val(file_id), path("*.bam"), emit: bam tuple val(file_id), path("*.bam"), emit: bam
script: script:
xmx_memory = task.memory - ~/\s*GB/
""" """
gatk --java-options "-Xmx${task.memory}" -T PrintReads \ gatk --java-options "-Xmx${xmx_memory}" -T PrintReads \
--use_jdk_deflater \ --use_jdk_deflater \
--use_jdk_inflater \ --use_jdk_inflater \
-nct ${task.cpus} \ -nct ${task.cpus} \
...@@ -169,8 +176,9 @@ process haplotype_caller { ...@@ -169,8 +176,9 @@ process haplotype_caller {
output: output:
tuple val(file_id), path("*.gvcf"), emit: gvcf tuple val(file_id), path("*.gvcf"), emit: gvcf
script: script:
xmx_memory = task.memory - ~/\s*GB/
""" """
gatk --java-options "-Xmx${task.memory}" -T HaplotypeCaller \ gatk --java-options "-Xmx${xmx_memory}" -T HaplotypeCaller \
-nct ${task.cpus} \ -nct ${task.cpus} \
-R ${fasta} \ -R ${fasta} \
-I ${bam} \ -I ${bam} \
...@@ -191,8 +199,9 @@ process gvcf_genotyping { ...@@ -191,8 +199,9 @@ process gvcf_genotyping {
output: output:
tuple val(file_id), path("*.vcf"), emit: vcf tuple val(file_id), path("*.vcf"), emit: vcf
script: script:
xmx_memory = task.memory - ~/\s*GB/
""" """
gatk --java-options "-Xmx${task.memory}" -T GenotypeGVCFs \ gatk --java-options "-Xmx${xmx_memory}" -T GenotypeGVCFs \
-nct ${task.cpus} \ -nct ${task.cpus} \
-R ${fasta} \ -R ${fasta} \
-V ${gvcf} \ -V ${gvcf} \
......
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