From 07d924a7fedeb462e5083c64b4de2f8fa38f2dce Mon Sep 17 00:00:00 2001 From: ellendejong Date: Wed, 5 Jul 2023 16:00:15 +0200 Subject: [PATCH 01/10] add tmpdir to GATK VariantFiltrationSnpIndel --- GATK/4.2.1.0/VariantFiltration.nf | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/GATK/4.2.1.0/VariantFiltration.nf b/GATK/4.2.1.0/VariantFiltration.nf index aa511584..682bc7f7 100644 --- a/GATK/4.2.1.0/VariantFiltration.nf +++ b/GATK/4.2.1.0/VariantFiltration.nf @@ -19,18 +19,21 @@ process VariantFiltrationSnpIndel { --reference ${params.genome} \ --variant $vcf_file \ --output ${vcf_file.simpleName}.snp${ext_vcf} \ - --select-type-to-exclude INDEL + --select-type-to-exclude INDEL \ + --tmp-dir $TMPDIR gatk --java-options "-Xmx${task.memory.toGiga()-4}G" SelectVariants \ --reference ${params.genome} \ --variant $vcf_file \ --output ${vcf_file.simpleName}.indel${ext_vcf} \ - --select-type-to-include INDEL + --select-type-to-include INDEL \ + --tmp-dir $TMPDIR gatk --java-options "-Xmx${task.memory.toGiga()-4}G" VariantFiltration \ --reference ${params.genome} \ --variant ${vcf_file.simpleName}.snp${ext_vcf} \ --output ${vcf_file.simpleName}.snp_filter${ext_vcf} \ + --tmp-dir $TMPDIR \ ${params.snp_filter} \ ${params.snp_cluster} @@ -38,11 +41,13 @@ process VariantFiltrationSnpIndel { --reference ${params.genome} \ --variant ${vcf_file.simpleName}.indel${ext_vcf} \ --output ${vcf_file.simpleName}.indel_filter${ext_vcf} \ + --tmp-dir $TMPDIR \ ${params.indel_filter} gatk --java-options "-Xmx${task.memory.toGiga()-4}G" MergeVcfs \ --INPUT ${vcf_file.simpleName}.snp_filter${ext_vcf} \ --INPUT ${vcf_file.simpleName}.indel_filter${ext_vcf} \ - --OUTPUT ${vcf_file.simpleName}.filter${ext_vcf} + --OUTPUT ${vcf_file.simpleName}.filter${ext_vcf} \ + --tmp-dir $TMPDIR """ } From b785c88ee745d1e79134e896e4fe47217c31c700 Mon Sep 17 00:00:00 2001 From: ellendejong Date: Fri, 7 Jul 2023 11:58:20 +0200 Subject: [PATCH 02/10] Add java tmpdir and GATK tmpdir --- GATK/3.8-1-0-gf15c1c3ef/BaseRecalibrator.nf | 2 +- GATK/3.8-1-0-gf15c1c3ef/CatVariants.nf | 2 +- GATK/3.8-1-0-gf15c1c3ef/CombineVariants.nf | 4 ++-- GATK/3.8-1-0-gf15c1c3ef/GenotypeGVCFs.nf | 2 +- GATK/3.8-1-0-gf15c1c3ef/HaplotypeCaller.nf | 4 ++-- GATK/3.8-1-0-gf15c1c3ef/IndelRealigner.nf | 2 +- .../RealignerTargetCreator.nf | 2 +- GATK/3.8-1-0-gf15c1c3ef/SelectVariants.nf | 2 +- GATK/3.8-1-0-gf15c1c3ef/UnifiedGenotyper.nf | 2 +- GATK/3.8-1-0-gf15c1c3ef/VariantFiltration.nf | 6 +++--- GATK/4.1.3.0/BaseRecalibration.nf | 5 +++-- GATK/4.1.3.0/BaseRecalibrationTable.nf | 3 ++- GATK/4.1.3.0/CollectMultipleMetrics.nf | 1 + GATK/4.1.3.0/CollectWGSMetrics.nf | 1 + GATK/4.1.3.0/CombineGVCFs.nf | 3 ++- GATK/4.1.3.0/GatherBaseRecalibrationTables.nf | 1 + GATK/4.1.3.0/GenotypeGVCFs.nf | 3 ++- GATK/4.1.3.0/HaplotypeCaller.nf | 3 ++- GATK/4.1.3.0/MergeVCFs.nf | 3 ++- GATK/4.1.3.0/SamToFastq.nf | 1 + GATK/4.1.3.0/SelectVariants.nf | 3 ++- GATK/4.1.3.0/SplitIntervals.nf | 9 +++++---- GATK/4.1.3.0/SplitNCigarReads.nf | 3 ++- GATK/4.1.3.0/VariantAnnotator.nf | 1 + GATK/4.1.3.0/VariantFiltration.nf | 1 + GATK/4.2.1.0/GenotypeGvcfs.nf | 6 ++++-- GATK/4.2.1.0/HaplotypeCaller.nf | 6 ++++-- GATK/4.2.1.0/MergeVcfs.nf | 10 ++++++++-- GATK/4.2.1.0/SelectVariants.nf | 3 ++- GATK/4.2.1.0/VariantFiltration.nf | 20 +++++++++---------- 30 files changed, 70 insertions(+), 44 deletions(-) diff --git a/GATK/3.8-1-0-gf15c1c3ef/BaseRecalibrator.nf b/GATK/3.8-1-0-gf15c1c3ef/BaseRecalibrator.nf index 98a5d3eb..8a5632ce 100644 --- a/GATK/3.8-1-0-gf15c1c3ef/BaseRecalibrator.nf +++ b/GATK/3.8-1-0-gf15c1c3ef/BaseRecalibrator.nf @@ -13,7 +13,7 @@ process BaseRecalibrator { script: """ - java -Xmx${task.memory.toGiga()-4}G -jar $params.gatk_path -T BaseRecalibrator \ + java -Xmx${task.memory.toGiga()-4}G -Djava.io.tmpdir=\$TMPDIR -jar $params.gatk_path -T BaseRecalibrator \ --num_cpu_threads_per_data_thread ${task.cpus} \ --reference_sequence ${params.genome} \ --input_file ${bam_file} \ diff --git a/GATK/3.8-1-0-gf15c1c3ef/CatVariants.nf b/GATK/3.8-1-0-gf15c1c3ef/CatVariants.nf index ca673c79..de3a0492 100644 --- a/GATK/3.8-1-0-gf15c1c3ef/CatVariants.nf +++ b/GATK/3.8-1-0-gf15c1c3ef/CatVariants.nf @@ -14,6 +14,6 @@ process CatVariantsGVCF { script: def input_files = gvcf_files.collect{"$it"}.join(" -V ") """ - java -Xmx${task.memory.toGiga()-4}G -cp ${params.gatk_path} org.broadinstitute.gatk.tools.CatVariants --reference ${params.genome} -V ${input_files} --outputFile ${sample_id}.g.vcf.gz ${params.optional} + java -Xmx${task.memory.toGiga()-4}G -Djava.io.tmpdir=\$TMPDIR -cp ${params.gatk_path} org.broadinstitute.gatk.tools.CatVariants --reference ${params.genome} -V ${input_files} --outputFile ${sample_id}.g.vcf.gz ${params.optional} """ } diff --git a/GATK/3.8-1-0-gf15c1c3ef/CombineVariants.nf b/GATK/3.8-1-0-gf15c1c3ef/CombineVariants.nf index 5ed12ece..c01effcb 100644 --- a/GATK/3.8-1-0-gf15c1c3ef/CombineVariants.nf +++ b/GATK/3.8-1-0-gf15c1c3ef/CombineVariants.nf @@ -14,7 +14,7 @@ process CombineVariants { script: def input_files = vcf_files.collect{"$it"}.join(" -V ") """ - java -Xmx${task.memory.toGiga()-4}G -jar ${params.gatk_path} -T CombineVariants --reference_sequence ${params.genome} -V ${input_files} --out ${analysis_id}.vcf ${params.optional} + java -Xmx${task.memory.toGiga()-4}G -Djava.io.tmpdir=\$TMPDIR -jar ${params.gatk_path} -T CombineVariants --reference_sequence ${params.genome} -V ${input_files} --out ${analysis_id}.vcf ${params.optional} """ } @@ -34,6 +34,6 @@ process CombineVariantsGVCF { script: def input_files = vcf_files.collect{"$it"}.join(" -V ") """ - java -Xmx${task.memory.toGiga()-4}G -jar ${params.gatk_path} -T CombineVariants --reference_sequence ${params.genome} -V ${input_files} --out ${sample_id}.g.vcf ${params.optional} + java -Xmx${task.memory.toGiga()-4}G -Djava.io.tmpdir=\$TMPDIR -jar ${params.gatk_path} -T CombineVariants --reference_sequence ${params.genome} -V ${input_files} --out ${sample_id}.g.vcf ${params.optional} """ } diff --git a/GATK/3.8-1-0-gf15c1c3ef/GenotypeGVCFs.nf b/GATK/3.8-1-0-gf15c1c3ef/GenotypeGVCFs.nf index 1714b61f..788eee72 100644 --- a/GATK/3.8-1-0-gf15c1c3ef/GenotypeGVCFs.nf +++ b/GATK/3.8-1-0-gf15c1c3ef/GenotypeGVCFs.nf @@ -14,7 +14,7 @@ process GenotypeGVCFs { script: def input_files = gvcf_files.collect{"$it"}.join(" -V ") """ - java -Xmx${task.memory.toGiga()-4}G -jar ${params.gatk_path} -T GenotypeGVCFs \ + java -Xmx${task.memory.toGiga()-4}G -Djava.io.tmpdir=\$TMPDIR -jar ${params.gatk_path} -T GenotypeGVCFs \ --reference_sequence ${params.genome} \ -V ${input_files} \ --out ${analysis_id}_${interval_file.baseName}.vcf \ diff --git a/GATK/3.8-1-0-gf15c1c3ef/HaplotypeCaller.nf b/GATK/3.8-1-0-gf15c1c3ef/HaplotypeCaller.nf index c3f0bf28..4d83fa16 100644 --- a/GATK/3.8-1-0-gf15c1c3ef/HaplotypeCaller.nf +++ b/GATK/3.8-1-0-gf15c1c3ef/HaplotypeCaller.nf @@ -14,7 +14,7 @@ process HaplotypeCaller { script: def input_files = bam_files.collect{"$it"}.join(" --input_file ") """ - java -Xmx${task.memory.toGiga()-4}G -jar ${params.gatk_path} -T HaplotypeCaller \ + java -Xmx${task.memory.toGiga()-4}G -Djava.io.tmpdir=\$TMPDIR -jar ${params.gatk_path} -T HaplotypeCaller \ --reference_sequence ${params.genome} \ --input_file ${input_files} \ --intervals ${interval_file} \ @@ -38,7 +38,7 @@ process HaplotypeCallerGVCF { script: """ - java -Xmx${task.memory.toGiga()-4}G -jar ${params.gatk_path} -T HaplotypeCaller \ + java -Xmx${task.memory.toGiga()-4}G -Djava.io.tmpdir=\$TMPDIR -jar ${params.gatk_path} -T HaplotypeCaller \ --reference_sequence ${params.genome} \ --input_file ${bam_file} \ --intervals ${interval_file} \ diff --git a/GATK/3.8-1-0-gf15c1c3ef/IndelRealigner.nf b/GATK/3.8-1-0-gf15c1c3ef/IndelRealigner.nf index f5e46cc2..62e7081f 100644 --- a/GATK/3.8-1-0-gf15c1c3ef/IndelRealigner.nf +++ b/GATK/3.8-1-0-gf15c1c3ef/IndelRealigner.nf @@ -13,7 +13,7 @@ process IndelRealigner { script: """ - java -Xmx${task.memory.toGiga()-4}G -jar ${params.gatk_path} -T IndelRealigner \ + java -Xmx${task.memory.toGiga()-4}G -Djava.io.tmpdir=\$TMPDIR -jar ${params.gatk_path} -T IndelRealigner \ --reference_sequence ${params.genome} \ --input_file ${bam_file} \ --intervals ${chr} \ diff --git a/GATK/3.8-1-0-gf15c1c3ef/RealignerTargetCreator.nf b/GATK/3.8-1-0-gf15c1c3ef/RealignerTargetCreator.nf index c0780237..4142eb70 100644 --- a/GATK/3.8-1-0-gf15c1c3ef/RealignerTargetCreator.nf +++ b/GATK/3.8-1-0-gf15c1c3ef/RealignerTargetCreator.nf @@ -13,7 +13,7 @@ process RealignerTargetCreator { script: """ - java -Xmx${task.memory.toGiga()-4}G -jar $params.gatk_path -T RealignerTargetCreator \ + java -Xmx${task.memory.toGiga()-4}G -Djava.io.tmpdir=\$TMPDIR -jar $params.gatk_path -T RealignerTargetCreator \ --reference_sequence ${params.genome} \ --input_file ${bam_file} \ --intervals ${chr} \ diff --git a/GATK/3.8-1-0-gf15c1c3ef/SelectVariants.nf b/GATK/3.8-1-0-gf15c1c3ef/SelectVariants.nf index 1f4a8d7f..b164a2f1 100644 --- a/GATK/3.8-1-0-gf15c1c3ef/SelectVariants.nf +++ b/GATK/3.8-1-0-gf15c1c3ef/SelectVariants.nf @@ -13,6 +13,6 @@ process SelectVariantsSample { script: """ - java -Xmx${task.memory.toGiga()-4}G -jar ${params.gatk_path} -T SelectVariants --reference_sequence ${params.genome} -V ${vcf_file} --out ${sample_id}_${vcf_file.baseName}.vcf -sn ${sample_id} + java -Xmx${task.memory.toGiga()-4}G -Djava.io.tmpdir=\$TMPDIR -jar ${params.gatk_path} -T SelectVariants --reference_sequence ${params.genome} -V ${vcf_file} --out ${sample_id}_${vcf_file.baseName}.vcf -sn ${sample_id} """ } diff --git a/GATK/3.8-1-0-gf15c1c3ef/UnifiedGenotyper.nf b/GATK/3.8-1-0-gf15c1c3ef/UnifiedGenotyper.nf index 5a190faf..8cd7d86f 100644 --- a/GATK/3.8-1-0-gf15c1c3ef/UnifiedGenotyper.nf +++ b/GATK/3.8-1-0-gf15c1c3ef/UnifiedGenotyper.nf @@ -14,6 +14,6 @@ process UnifiedGenotyper { script: """ - java -Xmx${task.memory.toGiga()-4}G -jar ${params.gatk_path} -T UnifiedGenotyper --reference_sequence ${params.genome} --input_file ${bam_file} --out ${sample_id}.vcf ${params.optional} + java -Xmx${task.memory.toGiga()-4}G -Djava.io.tmpdir=\$TMPDIR -jar ${params.gatk_path} -T UnifiedGenotyper --reference_sequence ${params.genome} --input_file ${bam_file} --out ${sample_id}.vcf ${params.optional} """ } diff --git a/GATK/3.8-1-0-gf15c1c3ef/VariantFiltration.nf b/GATK/3.8-1-0-gf15c1c3ef/VariantFiltration.nf index bc79805b..eba0dab7 100644 --- a/GATK/3.8-1-0-gf15c1c3ef/VariantFiltration.nf +++ b/GATK/3.8-1-0-gf15c1c3ef/VariantFiltration.nf @@ -13,10 +13,10 @@ process VariantFiltrationSnpIndel { script: """ - java -Xmx${task.memory.toGiga()-4}G -jar ${params.gatk_path} -T SelectVariants --reference_sequence ${params.genome} -V $vcf_file --out ${vcf_file.baseName}.snp.vcf --selectTypeToExclude INDEL - java -Xmx${task.memory.toGiga()-4}G -jar ${params.gatk_path} -T SelectVariants --reference_sequence ${params.genome} -V $vcf_file --out ${vcf_file.baseName}.indel.vcf --selectTypeToInclude INDEL + java -Xmx${task.memory.toGiga()-4}G -Djava.io.tmpdir=\$TMPDIR -jar ${params.gatk_path} -T SelectVariants --reference_sequence ${params.genome} -V $vcf_file --out ${vcf_file.baseName}.snp.vcf --selectTypeToExclude INDEL + java -Xmx${task.memory.toGiga()-4}G -Djava.io.tmpdir=\$TMPDIR -jar ${params.gatk_path} -T SelectVariants --reference_sequence ${params.genome} -V $vcf_file --out ${vcf_file.baseName}.indel.vcf --selectTypeToInclude INDEL - java -Xmx${task.memory.toGiga()-4}G -jar ${params.gatk_path} -T VariantFiltration --reference_sequence ${params.genome} -V ${vcf_file.baseName}.snp.vcf --out ${vcf_file.baseName}.snp_filter.vcf ${params.snp_filter} ${params.snp_cluster} + java -Xmx${task.memory.toGiga()-4}G -Djava.io.tmpdir=\$TMPDIR -jar ${params.gatk_path} -T VariantFiltration --reference_sequence ${params.genome} -V ${vcf_file.baseName}.snp.vcf --out ${vcf_file.baseName}.snp_filter.vcf ${params.snp_filter} ${params.snp_cluster} java -Xmx${task.memory.toGiga()-4}G -jar ${params.gatk_path} -T VariantFiltration --reference_sequence ${params.genome} -V ${vcf_file.baseName}.indel.vcf --out ${vcf_file.baseName}.indel_filter.vcf ${params.indel_filter} java -Xmx${task.memory.toGiga()-4}G -jar ${params.gatk_path} -T CombineVariants --reference_sequence ${params.genome} -V ${vcf_file.baseName}.snp_filter.vcf -V ${vcf_file.baseName}.indel_filter.vcf --out ${vcf_file.baseName}.filter.vcf --assumeIdenticalSamples diff --git a/GATK/4.1.3.0/BaseRecalibration.nf b/GATK/4.1.3.0/BaseRecalibration.nf index aa260ed0..1a4ce2a8 100644 --- a/GATK/4.1.3.0/BaseRecalibration.nf +++ b/GATK/4.1.3.0/BaseRecalibration.nf @@ -16,13 +16,14 @@ process BaseRecalibration { script: int_tag = interval_file.toRealPath().toString().split("/")[-2] """ - gatk --java-options "-Xmx${task.memory.toGiga()-4}g -Djava.io.tmpdir=\$TMPDIR"\ + gatk --java-options "-Xmx${task.memory.toGiga()-4}g -Djava.io.tmpdir=\$TMPDIR" \ ApplyBQSR \ --input $bam \ --output ${sample_id}.${int_tag}_recalibrated.bam \ -R ${params.genome_fasta} \ --create-output-bam-index true \ --bqsr-recal-file ${recal_table} \ - -L $interval_file + -L $interval_file \ + --tmp-dir \$TMPDIR """ } diff --git a/GATK/4.1.3.0/BaseRecalibrationTable.nf b/GATK/4.1.3.0/BaseRecalibrationTable.nf index a7c0ce79..495b5d00 100644 --- a/GATK/4.1.3.0/BaseRecalibrationTable.nf +++ b/GATK/4.1.3.0/BaseRecalibrationTable.nf @@ -23,7 +23,8 @@ process BaseRecalibrationTable { --output ${sample_id}.${int_tag}.recal.table \ -R ${params.genome_fasta} \ $known \ - -L $interval_file + -L $interval_file \ + --tmp-dir \$TMPDIR """ } diff --git a/GATK/4.1.3.0/CollectMultipleMetrics.nf b/GATK/4.1.3.0/CollectMultipleMetrics.nf index 24929e46..f48276f7 100644 --- a/GATK/4.1.3.0/CollectMultipleMetrics.nf +++ b/GATK/4.1.3.0/CollectMultipleMetrics.nf @@ -19,6 +19,7 @@ process CollectMultipleMetrics { -I $bam \ -O ${sample_id}.multiple_metrics\ -R ${params.genome_fasta} \ + --tmp-dir \$TMPDIR \ ${params.optional} """ } diff --git a/GATK/4.1.3.0/CollectWGSMetrics.nf b/GATK/4.1.3.0/CollectWGSMetrics.nf index a905efa0..70da18c1 100644 --- a/GATK/4.1.3.0/CollectWGSMetrics.nf +++ b/GATK/4.1.3.0/CollectWGSMetrics.nf @@ -19,6 +19,7 @@ process CollectWGSMetrics { -I $bam \ -O ${sample_id}.wgs_metrics.txt \ -R ${params.genome_fasta} \ + --tmp-dir \$TMPDIR \ ${params.optional} sed -i 's/picard\\.analysis\\.WgsMetrics/picard\\.analysis\\.CollectWgsMetrics\\\$WgsMetrics/' ${sample_id}.wgs_metrics.txt """ diff --git a/GATK/4.1.3.0/CombineGVCFs.nf b/GATK/4.1.3.0/CombineGVCFs.nf index ecf7fcf4..95f8012a 100644 --- a/GATK/4.1.3.0/CombineGVCFs.nf +++ b/GATK/4.1.3.0/CombineGVCFs.nf @@ -19,6 +19,7 @@ process CombineGVCFs { -R ${params.genome_fasta} \ -V $vcfs \ -O ${run_id}.${interval}.g.vcf \ - -L $interval_file + -L $interval_file \ + --tmp-dir \$TMPDIR """ } diff --git a/GATK/4.1.3.0/GatherBaseRecalibrationTables.nf b/GATK/4.1.3.0/GatherBaseRecalibrationTables.nf index d9e66e9c..35f773bb 100644 --- a/GATK/4.1.3.0/GatherBaseRecalibrationTables.nf +++ b/GATK/4.1.3.0/GatherBaseRecalibrationTables.nf @@ -19,5 +19,6 @@ process GatherBaseRecalibrationTables { GatherBQSRReports \ -I $tables \ --output ${sample_id}.recal.table \ + --tmp-dir \$TMPDIR """ } diff --git a/GATK/4.1.3.0/GenotypeGVCFs.nf b/GATK/4.1.3.0/GenotypeGVCFs.nf index be096cd2..610285dc 100644 --- a/GATK/4.1.3.0/GenotypeGVCFs.nf +++ b/GATK/4.1.3.0/GenotypeGVCFs.nf @@ -19,6 +19,7 @@ process GenotypeGVCFs { -O ${run_id}.${interval}.vcf \ -R ${params.genome_fasta} \ -D ${params.genome_dbsnp} \ - -L $interval_file + -L $interval_file \ + --tmp-dir \$TMPDIR """ } diff --git a/GATK/4.1.3.0/HaplotypeCaller.nf b/GATK/4.1.3.0/HaplotypeCaller.nf index 42e61c7a..140935dc 100644 --- a/GATK/4.1.3.0/HaplotypeCaller.nf +++ b/GATK/4.1.3.0/HaplotypeCaller.nf @@ -21,6 +21,7 @@ process HaplotypeCaller { -I $bam \ --output ${sample_id}.${int_tag}${ext} \ -R $params.genome_fasta \ - -L $interval_file + -L $interval_file \ + --tmp-dir \$TMPDIR """ } diff --git a/GATK/4.1.3.0/MergeVCFs.nf b/GATK/4.1.3.0/MergeVCFs.nf index bfe838bb..d33e4338 100644 --- a/GATK/4.1.3.0/MergeVCFs.nf +++ b/GATK/4.1.3.0/MergeVCFs.nf @@ -20,7 +20,8 @@ process MergeVCFs { gatk --java-options "-Xmx${task.memory.toGiga()-4}g -Djava.io.tmpdir=\$PWD" \ SortVcf \ --INPUT $vcfs \ - --OUTPUT ${id}${ext} + --OUTPUT ${id}${ext} \ + --tmp-dir \$TMPDIR bgzip ${id}${ext} tabix ${id}${ext}.gz diff --git a/GATK/4.1.3.0/SamToFastq.nf b/GATK/4.1.3.0/SamToFastq.nf index 86b74ee9..8a937e1c 100644 --- a/GATK/4.1.3.0/SamToFastq.nf +++ b/GATK/4.1.3.0/SamToFastq.nf @@ -23,5 +23,6 @@ process SamToFastq { --FASTQ ${sample_id}_${flowcell}_R1_001.fastq.gz \ --SECOND_END_FASTQ ${sample_id}_${flowcell}_R2_001.fastq.gz \ --INCLUDE_NON_PF_READS true \ + --tmp-dir \$TMPDIR """ } diff --git a/GATK/4.1.3.0/SelectVariants.nf b/GATK/4.1.3.0/SelectVariants.nf index 95eb7c07..b947caca 100644 --- a/GATK/4.1.3.0/SelectVariants.nf +++ b/GATK/4.1.3.0/SelectVariants.nf @@ -19,6 +19,7 @@ process SelectVariants { -R ${params.genome_fasta} \ -V $vcf \ -O ${run_id}.${interval}.${type}.tmp.vcf \ - $select_type + $select_type \ + --tmp-dir \$TMPDIR """ } diff --git a/GATK/4.1.3.0/SplitIntervals.nf b/GATK/4.1.3.0/SplitIntervals.nf index d95dba9b..114e24a3 100644 --- a/GATK/4.1.3.0/SplitIntervals.nf +++ b/GATK/4.1.3.0/SplitIntervals.nf @@ -17,9 +17,10 @@ process SplitIntervals { """ gatk --java-options "-Xmx${task.memory.toGiga()-4}g -Djava.io.tmpdir=\${TMPDIR}" \ IntervalListTools \ - -I ${scatter_interval_list} \ - ${params.optional} \ - --BREAK_BANDS_AT_MULTIPLES_OF $break_bands_at_multiples_of \ - -O . + -I ${scatter_interval_list} \ + ${params.optional} \ + --BREAK_BANDS_AT_MULTIPLES_OF $break_bands_at_multiples_of \ + -O . \ + --tmp-dir \$TMPDIR """ } diff --git a/GATK/4.1.3.0/SplitNCigarReads.nf b/GATK/4.1.3.0/SplitNCigarReads.nf index 6194a652..4daa996d 100644 --- a/GATK/4.1.3.0/SplitNCigarReads.nf +++ b/GATK/4.1.3.0/SplitNCigarReads.nf @@ -13,11 +13,12 @@ process SplitNCigarReads { script: """ - gatk --java-options "-Xmx${task.memory.toGiga()-4}g" \ + gatk --java-options "-Xmx${task.memory.toGiga()-4}g -Djava.io.tmpdir=\$TMPDIR" \ SplitNCigarReads --tmp-dir \$PWD \ -R ${params.genome_fasta} \ -I ${bam_file} \ --refactor-cigar-string \ -O ${sample_id}.split.bam + --tmp-dir \$TMPDIR """ } diff --git a/GATK/4.1.3.0/VariantAnnotator.nf b/GATK/4.1.3.0/VariantAnnotator.nf index 202a595c..8cc5668e 100644 --- a/GATK/4.1.3.0/VariantAnnotator.nf +++ b/GATK/4.1.3.0/VariantAnnotator.nf @@ -23,5 +23,6 @@ process VariantAnnotator { -V $vcf \ --output ${vcf.baseName}_${db_name}.vcf \ --dbsnp ${params.genome_variant_annotator_db} \ + --tmp-dir \$TMPDIR """ } diff --git a/GATK/4.1.3.0/VariantFiltration.nf b/GATK/4.1.3.0/VariantFiltration.nf index 0909d3fb..3481b70d 100644 --- a/GATK/4.1.3.0/VariantFiltration.nf +++ b/GATK/4.1.3.0/VariantFiltration.nf @@ -27,6 +27,7 @@ process VariantFiltration { -R $params.genome_fasta \ -V $vcf \ -O ${run_id}.${interval}.${type}.filtered_variants.vcf \ + --tmp-dir \$TMPDIR \ $filter_criteria """ } diff --git a/GATK/4.2.1.0/GenotypeGvcfs.nf b/GATK/4.2.1.0/GenotypeGvcfs.nf index 7174d6ec..a0b28803 100644 --- a/GATK/4.2.1.0/GenotypeGvcfs.nf +++ b/GATK/4.2.1.0/GenotypeGvcfs.nf @@ -21,11 +21,12 @@ process GenotypeGVCFs { ext_vcf = params.compress || gvcf_files.getExtension() == ".gz" ? ".vcf.gz" : ".vcf" ext_vcf_index = params.compress || gvcf_files.getExtension() == ".gz" ? ".tbi" : ".idx" """ - gatk --java-options "-Xmx${task.memory.toGiga()-4}G" GenotypeGVCFs \ + gatk --java-options "-Xmx${task.memory.toGiga()-4}G -Djava.io.tmpdir=\$TMPDIR" GenotypeGVCFs \ --reference ${params.genome} \ --variant $input_files \ --output ${analysis_id}_${interval_file.simpleName}${ext_vcf} \ --intervals ${interval_file} \ + --tmp-dir \$TMPDIR \ ${params.optional} """ } @@ -53,11 +54,12 @@ process GenotypeGVCF { ext_vcf = params.compress || gvcf_files.getExtension() == ".gz" ? ".vcf.gz" : ".vcf" ext_vcf_index = params.compress || gvcf_files.getExtension() == ".gz" ? ".tbi" : ".idx" """ - gatk --java-options "-Xmx${task.memory.toGiga()-4}G" GenotypeGVCFs \ + gatk --java-options "-Xmx${task.memory.toGiga()-4}G -Djava.io.tmpdir=\$TMPDIR" GenotypeGVCFs \ --reference ${params.genome} \ --variant $input_files \ --output ${sample_id}_${interval_file.simpleName}${ext_vcf} \ --intervals ${interval_file} \ + --tmp-dir \$TMPDIR \ ${params.optional} """ } diff --git a/GATK/4.2.1.0/HaplotypeCaller.nf b/GATK/4.2.1.0/HaplotypeCaller.nf index 638ce33a..a7d2ccf0 100644 --- a/GATK/4.2.1.0/HaplotypeCaller.nf +++ b/GATK/4.2.1.0/HaplotypeCaller.nf @@ -21,11 +21,12 @@ process HaplotypeCaller { ext_vcf = params.compress ? ".vcf.gz" : ".vcf" ext_vcf_index = params.compress ? ".tbi" : ".idx" """ - gatk --java-options "-Xmx${task.memory.toGiga()-4}G" HaplotypeCaller \ + gatk --java-options "-Xmx${task.memory.toGiga()-4}G -Djava.io.tmpdir=\$TMPDIR" HaplotypeCaller \ --reference ${params.genome} \ --input ${input_files} \ --intervals ${interval_file} \ --output ${analysis_id}.${interval_file.simpleName}${ext_vcf} \ + --tmp-dir \$TMPDIR \ ${params.optional} """ } @@ -54,12 +55,13 @@ process HaplotypeCallerGVCF { ext_gvcf = params.compress ? ".g.vcf.gz" : ".g.vcf" ext_gvcf_index = params.compress ? ".tbi" : ".idx" """ - gatk --java-options "-Xmx${task.memory.toGiga()-4}G" HaplotypeCaller \ + gatk --java-options "-Xmx${task.memory.toGiga()-4}G -Djava.io.tmpdir=\$TMPDIR" HaplotypeCaller \ --reference ${params.genome} \ --input ${bam_file} \ --intervals ${interval_file} \ --output ${sample_id}_${interval_file.simpleName}${ext_gvcf} \ --emit-ref-confidence ${params.emit_ref_confidence} \ + --tmp-dir \$TMPDIR \ ${params.optional} """ } diff --git a/GATK/4.2.1.0/MergeVcfs.nf b/GATK/4.2.1.0/MergeVcfs.nf index 426dbc9a..d6895048 100644 --- a/GATK/4.2.1.0/MergeVcfs.nf +++ b/GATK/4.2.1.0/MergeVcfs.nf @@ -16,7 +16,10 @@ process MergeVcfs { ext_vcf = params.compress ? ".vcf.gz" : ".vcf" ext_vcf_index = params.compress ? ".tbi" : ".idx" """ - gatk --java-options "-Xmx${task.memory.toGiga()-4}G" MergeVcfs --INPUT ${input_files} --OUTPUT ${output_name}${ext_vcf} + gatk --java-options "-Xmx${task.memory.toGiga()-4}G" MergeVcfs \ + --INPUT ${input_files} \ + --OUTPUT ${output_name}${ext_vcf} \ + --tmp-dir \$TMPDIR """ } @@ -39,6 +42,9 @@ process MergeGvcfs { ext_gvcf = params.compress ? ".g.vcf.gz" : ".g.vcf" ext_gvcf_index = params.compress ? ".tbi" : ".idx" """ - gatk --java-options "-Xmx${task.memory.toGiga()-4}G" MergeVcfs --INPUT ${input_files} --OUTPUT ${output_name}${ext_gvcf} + gatk --java-options "-Xmx${task.memory.toGiga()-4}G -Djava.io.tmpdir=\$TMPDIR" MergeVcfs \ + --INPUT ${input_files} \ + --OUTPUT ${output_name}${ext_gvcf} \ + --tmp-dir \$TMPDIR """ } diff --git a/GATK/4.2.1.0/SelectVariants.nf b/GATK/4.2.1.0/SelectVariants.nf index f7ae7121..944eacff 100644 --- a/GATK/4.2.1.0/SelectVariants.nf +++ b/GATK/4.2.1.0/SelectVariants.nf @@ -20,11 +20,12 @@ process SelectVariantsSample { ext_vcf = params.compress || vcf_file.getExtension() == ".gz" ? ".vcf.gz" : ".vcf" ext_vcf_index = params.compress || vcf_file.getExtension() == ".gz" ? ".tbi" : ".idx" """ - gatk --java-options "-Xmx${task.memory.toGiga()-4}G" SelectVariants \ + gatk --java-options "-Xmx${task.memory.toGiga()-4}G -Djava.io.tmpdir=\$TMPDIR" SelectVariants \ --reference ${params.genome} \ --variant ${vcf_file} \ --output ${sample_id}_${vcf_file.simpleName}${ext_vcf} \ --sample-name ${sample_id} \ + --tmp-dir \$TMPDIR \ ${params.optional} """ } diff --git a/GATK/4.2.1.0/VariantFiltration.nf b/GATK/4.2.1.0/VariantFiltration.nf index 682bc7f7..b822db08 100644 --- a/GATK/4.2.1.0/VariantFiltration.nf +++ b/GATK/4.2.1.0/VariantFiltration.nf @@ -15,39 +15,39 @@ process VariantFiltrationSnpIndel { ext_vcf = params.compress || vcf_file.getExtension() == ".gz" ? ".vcf.gz" : ".vcf" ext_vcf_index = params.compress || vcf_file.getExtension() == ".gz" ? ".tbi" : ".idx" """ - gatk --java-options "-Xmx${task.memory.toGiga()-4}G" SelectVariants \ + gatk --java-options "-Xmx${task.memory.toGiga()-4}G -Djava.io.tmpdir=\$TMPDIR" SelectVariants \ --reference ${params.genome} \ --variant $vcf_file \ --output ${vcf_file.simpleName}.snp${ext_vcf} \ --select-type-to-exclude INDEL \ - --tmp-dir $TMPDIR + --tmp-dir \$TMPDIR - gatk --java-options "-Xmx${task.memory.toGiga()-4}G" SelectVariants \ + gatk --java-options "-Xmx${task.memory.toGiga()-4}G -Djava.io.tmpdir=\$TMPDIR" SelectVariants \ --reference ${params.genome} \ --variant $vcf_file \ --output ${vcf_file.simpleName}.indel${ext_vcf} \ --select-type-to-include INDEL \ - --tmp-dir $TMPDIR + --tmp-dir \$TMPDIR - gatk --java-options "-Xmx${task.memory.toGiga()-4}G" VariantFiltration \ + gatk --java-options "-Xmx${task.memory.toGiga()-4}G -Djava.io.tmpdir=\$TMPDIR" VariantFiltration \ --reference ${params.genome} \ --variant ${vcf_file.simpleName}.snp${ext_vcf} \ --output ${vcf_file.simpleName}.snp_filter${ext_vcf} \ - --tmp-dir $TMPDIR \ + --tmp-dir \$TMPDIR \ ${params.snp_filter} \ ${params.snp_cluster} - gatk --java-options "-Xmx${task.memory.toGiga()-4}G" VariantFiltration \ + gatk --java-options "-Xmx${task.memory.toGiga()-4}G -Djava.io.tmpdir=\$TMPDIR" VariantFiltration \ --reference ${params.genome} \ --variant ${vcf_file.simpleName}.indel${ext_vcf} \ --output ${vcf_file.simpleName}.indel_filter${ext_vcf} \ - --tmp-dir $TMPDIR \ + --tmp-dir \$TMPDIR \ ${params.indel_filter} - gatk --java-options "-Xmx${task.memory.toGiga()-4}G" MergeVcfs \ + gatk --java-options "-Xmx${task.memory.toGiga()-4}G -Djava.io.tmpdir=\$TMPDIR" MergeVcfs \ --INPUT ${vcf_file.simpleName}.snp_filter${ext_vcf} \ --INPUT ${vcf_file.simpleName}.indel_filter${ext_vcf} \ --OUTPUT ${vcf_file.simpleName}.filter${ext_vcf} \ - --tmp-dir $TMPDIR + --tmp-dir \$TMPDIR """ } From 728dadc45c2684851506047fe5ebe09c309dd8b4 Mon Sep 17 00:00:00 2001 From: ellendejong Date: Wed, 19 Jul 2023 09:30:23 +0200 Subject: [PATCH 03/10] add tmpdir --- GATK/4.2.1.0/MergeVcfs.nf | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/GATK/4.2.1.0/MergeVcfs.nf b/GATK/4.2.1.0/MergeVcfs.nf index d6895048..0d0d5951 100644 --- a/GATK/4.2.1.0/MergeVcfs.nf +++ b/GATK/4.2.1.0/MergeVcfs.nf @@ -16,7 +16,7 @@ process MergeVcfs { ext_vcf = params.compress ? ".vcf.gz" : ".vcf" ext_vcf_index = params.compress ? ".tbi" : ".idx" """ - gatk --java-options "-Xmx${task.memory.toGiga()-4}G" MergeVcfs \ + gatk --java-options "-Xmx${task.memory.toGiga()-4}G -Djava.io.tmpdir=\$TMPDIR" MergeVcfs \ --INPUT ${input_files} \ --OUTPUT ${output_name}${ext_vcf} \ --tmp-dir \$TMPDIR From bb0de90dc0961e83594e6696f9c6d7453e5a326c Mon Sep 17 00:00:00 2001 From: ellendejong Date: Wed, 19 Jul 2023 09:30:32 +0200 Subject: [PATCH 04/10] remove empty lines --- GATK/4.1.3.0/BaseRecalibration.nf | 2 -- GATK/4.1.3.0/BaseRecalibrationTable.nf | 1 - GATK/4.1.3.0/CollectMultipleMetrics.nf | 1 - GATK/4.1.3.0/CollectWGSMetrics.nf | 1 - GATK/4.1.3.0/GatherBaseRecalibrationTables.nf | 1 - GATK/4.1.3.0/SamToFastq.nf | 1 - GATK/4.1.3.0/VariantAnnotator.nf | 1 - GATK/4.1.3.0/VariantFiltration.nf | 1 - 8 files changed, 9 deletions(-) diff --git a/GATK/4.1.3.0/BaseRecalibration.nf b/GATK/4.1.3.0/BaseRecalibration.nf index 1a4ce2a8..d609b1bb 100644 --- a/GATK/4.1.3.0/BaseRecalibration.nf +++ b/GATK/4.1.3.0/BaseRecalibration.nf @@ -1,5 +1,3 @@ - - process BaseRecalibration { tag {"GATK BaseRecalibration ${sample_id}.${int_tag}"} label 'GATK_4_1_3_0' diff --git a/GATK/4.1.3.0/BaseRecalibrationTable.nf b/GATK/4.1.3.0/BaseRecalibrationTable.nf index 495b5d00..31b79849 100644 --- a/GATK/4.1.3.0/BaseRecalibrationTable.nf +++ b/GATK/4.1.3.0/BaseRecalibrationTable.nf @@ -1,4 +1,3 @@ - process BaseRecalibrationTable { tag {"GATK BaseRecalibrationTable ${sample_id}.${int_tag}"} label 'GATK_4_1_3_0' diff --git a/GATK/4.1.3.0/CollectMultipleMetrics.nf b/GATK/4.1.3.0/CollectMultipleMetrics.nf index f48276f7..a8842c9e 100644 --- a/GATK/4.1.3.0/CollectMultipleMetrics.nf +++ b/GATK/4.1.3.0/CollectMultipleMetrics.nf @@ -1,4 +1,3 @@ - process CollectMultipleMetrics { tag {"GATK CollectMultipleMetrics ${sample_id}"} label 'GATK_4_1_3_0' diff --git a/GATK/4.1.3.0/CollectWGSMetrics.nf b/GATK/4.1.3.0/CollectWGSMetrics.nf index 70da18c1..58e85731 100644 --- a/GATK/4.1.3.0/CollectWGSMetrics.nf +++ b/GATK/4.1.3.0/CollectWGSMetrics.nf @@ -1,4 +1,3 @@ - process CollectWGSMetrics { tag {"GATK CollectWGSMetrics ${sample_id}"} label 'GATK_4_1_3_0' diff --git a/GATK/4.1.3.0/GatherBaseRecalibrationTables.nf b/GATK/4.1.3.0/GatherBaseRecalibrationTables.nf index 35f773bb..7c24c6f0 100644 --- a/GATK/4.1.3.0/GatherBaseRecalibrationTables.nf +++ b/GATK/4.1.3.0/GatherBaseRecalibrationTables.nf @@ -1,4 +1,3 @@ - process GatherBaseRecalibrationTables { tag {"GATK GatherBaseRecalibrationTables ${sample_id}"} label 'GATK_4_1_3_0' diff --git a/GATK/4.1.3.0/SamToFastq.nf b/GATK/4.1.3.0/SamToFastq.nf index 8a937e1c..92ddc6c0 100644 --- a/GATK/4.1.3.0/SamToFastq.nf +++ b/GATK/4.1.3.0/SamToFastq.nf @@ -1,4 +1,3 @@ - process SamToFastq { tag {"GATK SamToFastq ${sample_id} "} label 'GATK_4_1_3_0' diff --git a/GATK/4.1.3.0/VariantAnnotator.nf b/GATK/4.1.3.0/VariantAnnotator.nf index 8cc5668e..92b23a09 100644 --- a/GATK/4.1.3.0/VariantAnnotator.nf +++ b/GATK/4.1.3.0/VariantAnnotator.nf @@ -1,4 +1,3 @@ - process VariantAnnotator { tag {"GATK VariantAnnotator ${run_id}"} label 'GATK_4_1_3_0' diff --git a/GATK/4.1.3.0/VariantFiltration.nf b/GATK/4.1.3.0/VariantFiltration.nf index 3481b70d..2d81a9b8 100644 --- a/GATK/4.1.3.0/VariantFiltration.nf +++ b/GATK/4.1.3.0/VariantFiltration.nf @@ -1,4 +1,3 @@ - process VariantFiltration { tag {"GATK VariantFiltration ${run_id}.${interval}.${type}"} label 'GATK_4_1_3_0' From 406d349e18d8df345863bc36e8d81f5382b86f21 Mon Sep 17 00:00:00 2001 From: ellendejong Date: Thu, 20 Jul 2023 09:36:52 +0200 Subject: [PATCH 05/10] param tmpdir to uppercase PICARD tasks. --- GATK/4.1.3.0/CollectMultipleMetrics.nf | 2 +- GATK/4.1.3.0/CollectWGSMetrics.nf | 2 +- GATK/4.1.3.0/MergeVCFs.nf | 2 +- GATK/4.1.3.0/SamToFastq.nf | 2 +- GATK/4.1.3.0/SplitIntervals.nf | 2 +- GATK/4.2.1.0/MergeVcfs.nf | 4 ++-- 6 files changed, 7 insertions(+), 7 deletions(-) diff --git a/GATK/4.1.3.0/CollectMultipleMetrics.nf b/GATK/4.1.3.0/CollectMultipleMetrics.nf index a8842c9e..5385b019 100644 --- a/GATK/4.1.3.0/CollectMultipleMetrics.nf +++ b/GATK/4.1.3.0/CollectMultipleMetrics.nf @@ -18,7 +18,7 @@ process CollectMultipleMetrics { -I $bam \ -O ${sample_id}.multiple_metrics\ -R ${params.genome_fasta} \ - --tmp-dir \$TMPDIR \ + --TMP_DIR \$TMPDIR \ ${params.optional} """ } diff --git a/GATK/4.1.3.0/CollectWGSMetrics.nf b/GATK/4.1.3.0/CollectWGSMetrics.nf index 58e85731..7ef71f22 100644 --- a/GATK/4.1.3.0/CollectWGSMetrics.nf +++ b/GATK/4.1.3.0/CollectWGSMetrics.nf @@ -18,7 +18,7 @@ process CollectWGSMetrics { -I $bam \ -O ${sample_id}.wgs_metrics.txt \ -R ${params.genome_fasta} \ - --tmp-dir \$TMPDIR \ + --TMP_DIR \$TMPDIR \ ${params.optional} sed -i 's/picard\\.analysis\\.WgsMetrics/picard\\.analysis\\.CollectWgsMetrics\\\$WgsMetrics/' ${sample_id}.wgs_metrics.txt """ diff --git a/GATK/4.1.3.0/MergeVCFs.nf b/GATK/4.1.3.0/MergeVCFs.nf index d33e4338..333870c8 100644 --- a/GATK/4.1.3.0/MergeVCFs.nf +++ b/GATK/4.1.3.0/MergeVCFs.nf @@ -21,7 +21,7 @@ process MergeVCFs { SortVcf \ --INPUT $vcfs \ --OUTPUT ${id}${ext} \ - --tmp-dir \$TMPDIR + --TMP_DIR \$TMPDIR bgzip ${id}${ext} tabix ${id}${ext}.gz diff --git a/GATK/4.1.3.0/SamToFastq.nf b/GATK/4.1.3.0/SamToFastq.nf index 92ddc6c0..ea10c9b7 100644 --- a/GATK/4.1.3.0/SamToFastq.nf +++ b/GATK/4.1.3.0/SamToFastq.nf @@ -22,6 +22,6 @@ process SamToFastq { --FASTQ ${sample_id}_${flowcell}_R1_001.fastq.gz \ --SECOND_END_FASTQ ${sample_id}_${flowcell}_R2_001.fastq.gz \ --INCLUDE_NON_PF_READS true \ - --tmp-dir \$TMPDIR + --TMP_DIR \$TMPDIR """ } diff --git a/GATK/4.1.3.0/SplitIntervals.nf b/GATK/4.1.3.0/SplitIntervals.nf index 114e24a3..93d83115 100644 --- a/GATK/4.1.3.0/SplitIntervals.nf +++ b/GATK/4.1.3.0/SplitIntervals.nf @@ -21,6 +21,6 @@ process SplitIntervals { ${params.optional} \ --BREAK_BANDS_AT_MULTIPLES_OF $break_bands_at_multiples_of \ -O . \ - --tmp-dir \$TMPDIR + --TMP_DIR \$TMPDIR """ } diff --git a/GATK/4.2.1.0/MergeVcfs.nf b/GATK/4.2.1.0/MergeVcfs.nf index 0d0d5951..83e26e09 100644 --- a/GATK/4.2.1.0/MergeVcfs.nf +++ b/GATK/4.2.1.0/MergeVcfs.nf @@ -19,7 +19,7 @@ process MergeVcfs { gatk --java-options "-Xmx${task.memory.toGiga()-4}G -Djava.io.tmpdir=\$TMPDIR" MergeVcfs \ --INPUT ${input_files} \ --OUTPUT ${output_name}${ext_vcf} \ - --tmp-dir \$TMPDIR + --TMP_DIR \$TMPDIR """ } @@ -45,6 +45,6 @@ process MergeGvcfs { gatk --java-options "-Xmx${task.memory.toGiga()-4}G -Djava.io.tmpdir=\$TMPDIR" MergeVcfs \ --INPUT ${input_files} \ --OUTPUT ${output_name}${ext_gvcf} \ - --tmp-dir \$TMPDIR + --TMP_DIR \$TMPDIR """ } From 180bb6163f0445fc2ae2f0f8ac373a51b927d8e4 Mon Sep 17 00:00:00 2001 From: ellendejong Date: Thu, 20 Jul 2023 09:37:16 +0200 Subject: [PATCH 06/10] format long lines --- GATK/3.8-1-0-gf15c1c3ef/CatVariants.nf | 6 +++++- GATK/3.8-1-0-gf15c1c3ef/CombineVariants.nf | 6 +++++- GATK/3.8-1-0-gf15c1c3ef/SelectVariants.nf | 6 +++++- GATK/3.8-1-0-gf15c1c3ef/UnifiedGenotyper.nf | 6 +++++- GATK/3.8-1-0-gf15c1c3ef/VariantFiltration.nf | 20 +++++++++++++++----- 5 files changed, 35 insertions(+), 9 deletions(-) diff --git a/GATK/3.8-1-0-gf15c1c3ef/CatVariants.nf b/GATK/3.8-1-0-gf15c1c3ef/CatVariants.nf index de3a0492..eb2fb29c 100644 --- a/GATK/3.8-1-0-gf15c1c3ef/CatVariants.nf +++ b/GATK/3.8-1-0-gf15c1c3ef/CatVariants.nf @@ -14,6 +14,10 @@ process CatVariantsGVCF { script: def input_files = gvcf_files.collect{"$it"}.join(" -V ") """ - java -Xmx${task.memory.toGiga()-4}G -Djava.io.tmpdir=\$TMPDIR -cp ${params.gatk_path} org.broadinstitute.gatk.tools.CatVariants --reference ${params.genome} -V ${input_files} --outputFile ${sample_id}.g.vcf.gz ${params.optional} + java -Xmx${task.memory.toGiga()-4}G -Djava.io.tmpdir=\$TMPDIR -cp ${params.gatk_path} org.broadinstitute.gatk.tools.CatVariants \ + --reference ${params.genome} \ + -V ${input_files} \ + --outputFile ${sample_id}.g.vcf.gz \ + ${params.optional} """ } diff --git a/GATK/3.8-1-0-gf15c1c3ef/CombineVariants.nf b/GATK/3.8-1-0-gf15c1c3ef/CombineVariants.nf index c01effcb..32ef3350 100644 --- a/GATK/3.8-1-0-gf15c1c3ef/CombineVariants.nf +++ b/GATK/3.8-1-0-gf15c1c3ef/CombineVariants.nf @@ -34,6 +34,10 @@ process CombineVariantsGVCF { script: def input_files = vcf_files.collect{"$it"}.join(" -V ") """ - java -Xmx${task.memory.toGiga()-4}G -Djava.io.tmpdir=\$TMPDIR -jar ${params.gatk_path} -T CombineVariants --reference_sequence ${params.genome} -V ${input_files} --out ${sample_id}.g.vcf ${params.optional} + java -Xmx${task.memory.toGiga()-4}G -Djava.io.tmpdir=\$TMPDIR -jar ${params.gatk_path} -T CombineVariants \ + --reference_sequence ${params.genome} \ + -V ${input_files} \ + --out ${sample_id}.g.vcf \ + ${params.optional} """ } diff --git a/GATK/3.8-1-0-gf15c1c3ef/SelectVariants.nf b/GATK/3.8-1-0-gf15c1c3ef/SelectVariants.nf index b164a2f1..44fec7ca 100644 --- a/GATK/3.8-1-0-gf15c1c3ef/SelectVariants.nf +++ b/GATK/3.8-1-0-gf15c1c3ef/SelectVariants.nf @@ -13,6 +13,10 @@ process SelectVariantsSample { script: """ - java -Xmx${task.memory.toGiga()-4}G -Djava.io.tmpdir=\$TMPDIR -jar ${params.gatk_path} -T SelectVariants --reference_sequence ${params.genome} -V ${vcf_file} --out ${sample_id}_${vcf_file.baseName}.vcf -sn ${sample_id} + java -Xmx${task.memory.toGiga()-4}G -Djava.io.tmpdir=\$TMPDIR -jar ${params.gatk_path} -T SelectVariants \ + --reference_sequence ${params.genome} \ + -V ${vcf_file} \ + --out ${sample_id}_${vcf_file.baseName}.vcf \ + -sn ${sample_id} """ } diff --git a/GATK/3.8-1-0-gf15c1c3ef/UnifiedGenotyper.nf b/GATK/3.8-1-0-gf15c1c3ef/UnifiedGenotyper.nf index 8cd7d86f..6f7af706 100644 --- a/GATK/3.8-1-0-gf15c1c3ef/UnifiedGenotyper.nf +++ b/GATK/3.8-1-0-gf15c1c3ef/UnifiedGenotyper.nf @@ -14,6 +14,10 @@ process UnifiedGenotyper { script: """ - java -Xmx${task.memory.toGiga()-4}G -Djava.io.tmpdir=\$TMPDIR -jar ${params.gatk_path} -T UnifiedGenotyper --reference_sequence ${params.genome} --input_file ${bam_file} --out ${sample_id}.vcf ${params.optional} + java -Xmx${task.memory.toGiga()-4}G -Djava.io.tmpdir=\$TMPDIR -jar ${params.gatk_path} -T UnifiedGenotyper \ + --reference_sequence ${params.genome} \ + --input_file ${bam_file} \ + --out ${sample_id}.vcf \ + ${params.optional} """ } diff --git a/GATK/3.8-1-0-gf15c1c3ef/VariantFiltration.nf b/GATK/3.8-1-0-gf15c1c3ef/VariantFiltration.nf index eba0dab7..7c2d9bfd 100644 --- a/GATK/3.8-1-0-gf15c1c3ef/VariantFiltration.nf +++ b/GATK/3.8-1-0-gf15c1c3ef/VariantFiltration.nf @@ -13,12 +13,22 @@ process VariantFiltrationSnpIndel { script: """ - java -Xmx${task.memory.toGiga()-4}G -Djava.io.tmpdir=\$TMPDIR -jar ${params.gatk_path} -T SelectVariants --reference_sequence ${params.genome} -V $vcf_file --out ${vcf_file.baseName}.snp.vcf --selectTypeToExclude INDEL - java -Xmx${task.memory.toGiga()-4}G -Djava.io.tmpdir=\$TMPDIR -jar ${params.gatk_path} -T SelectVariants --reference_sequence ${params.genome} -V $vcf_file --out ${vcf_file.baseName}.indel.vcf --selectTypeToInclude INDEL + java -Xmx${task.memory.toGiga()-4}G -Djava.io.tmpdir=\$TMPDIR -jar ${params.gatk_path} -T SelectVariants \ + --reference_sequence ${params.genome} -V $vcf_file --out ${vcf_file.baseName}.snp.vcf --selectTypeToExclude INDEL - java -Xmx${task.memory.toGiga()-4}G -Djava.io.tmpdir=\$TMPDIR -jar ${params.gatk_path} -T VariantFiltration --reference_sequence ${params.genome} -V ${vcf_file.baseName}.snp.vcf --out ${vcf_file.baseName}.snp_filter.vcf ${params.snp_filter} ${params.snp_cluster} - java -Xmx${task.memory.toGiga()-4}G -jar ${params.gatk_path} -T VariantFiltration --reference_sequence ${params.genome} -V ${vcf_file.baseName}.indel.vcf --out ${vcf_file.baseName}.indel_filter.vcf ${params.indel_filter} + java -Xmx${task.memory.toGiga()-4}G -Djava.io.tmpdir=\$TMPDIR -jar ${params.gatk_path} -T SelectVariants \ + --reference_sequence ${params.genome} -V $vcf_file --out ${vcf_file.baseName}.indel.vcf --selectTypeToInclude INDEL - java -Xmx${task.memory.toGiga()-4}G -jar ${params.gatk_path} -T CombineVariants --reference_sequence ${params.genome} -V ${vcf_file.baseName}.snp_filter.vcf -V ${vcf_file.baseName}.indel_filter.vcf --out ${vcf_file.baseName}.filter.vcf --assumeIdenticalSamples + java -Xmx${task.memory.toGiga()-4}G -Djava.io.tmpdir=\$TMPDIR -jar ${params.gatk_path} -T VariantFiltration \ + --reference_sequence ${params.genome} -V ${vcf_file.baseName}.snp.vcf --out ${vcf_file.baseName}.snp_filter.vcf \ + ${params.snp_filter} ${params.snp_cluster} + + java -Xmx${task.memory.toGiga()-4}G -Djava.io.tmpdir=\$TMPDIR -jar ${params.gatk_path} -T VariantFiltration \ + --reference_sequence ${params.genome} -V ${vcf_file.baseName}.indel.vcf --out ${vcf_file.baseName}.indel_filter.vcf \ + ${params.indel_filter} + + java -Xmx${task.memory.toGiga()-4}G -Djava.io.tmpdir=\$TMPDIR -jar ${params.gatk_path} -T CombineVariants \ + --reference_sequence ${params.genome} -V ${vcf_file.baseName}.snp_filter.vcf -V ${vcf_file.baseName}.indel_filter.vcf \ + --out ${vcf_file.baseName}.filter.vcf --assumeIdenticalSamples """ } From d96d3ba5bf1eecaa65c5119eb9d1bad03e00ebf2 Mon Sep 17 00:00:00 2001 From: ellendejong Date: Thu, 20 Jul 2023 09:37:56 +0200 Subject: [PATCH 07/10] fix tmpdir --- GATK/3.8-1-0-gf15c1c3ef/BaseRecalibrator.nf | 2 +- GATK/4.1.3.0/SplitNCigarReads.nf | 1 - 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/GATK/3.8-1-0-gf15c1c3ef/BaseRecalibrator.nf b/GATK/3.8-1-0-gf15c1c3ef/BaseRecalibrator.nf index 8a5632ce..bc6fedbd 100644 --- a/GATK/3.8-1-0-gf15c1c3ef/BaseRecalibrator.nf +++ b/GATK/3.8-1-0-gf15c1c3ef/BaseRecalibrator.nf @@ -21,7 +21,7 @@ process BaseRecalibrator { --out ${bam_file.baseName}.bqsr.${chr}.table \ ${params.optional_bqsr} - java -Xmx${task.memory.toGiga()-4}G -jar ${params.gatk_path} -T PrintReads \ + java -Xmx${task.memory.toGiga()-4}G -Djava.io.tmpdir=\$TMPDIR -jar ${params.gatk_path} -T PrintReads \ --num_cpu_threads_per_data_thread ${task.cpus} \ --reference_sequence ${params.genome} \ --input_file ${bam_file} \ diff --git a/GATK/4.1.3.0/SplitNCigarReads.nf b/GATK/4.1.3.0/SplitNCigarReads.nf index 4daa996d..dda83e0a 100644 --- a/GATK/4.1.3.0/SplitNCigarReads.nf +++ b/GATK/4.1.3.0/SplitNCigarReads.nf @@ -19,6 +19,5 @@ process SplitNCigarReads { -I ${bam_file} \ --refactor-cigar-string \ -O ${sample_id}.split.bam - --tmp-dir \$TMPDIR """ } From f2054775930c4496919ccfa9af26c115f9435e58 Mon Sep 17 00:00:00 2001 From: ellendejong Date: Mon, 24 Jul 2023 10:55:36 +0200 Subject: [PATCH 08/10] split to multiline --- GATK/3.8-1-0-gf15c1c3ef/CombineVariants.nf | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/GATK/3.8-1-0-gf15c1c3ef/CombineVariants.nf b/GATK/3.8-1-0-gf15c1c3ef/CombineVariants.nf index 32ef3350..3e39264a 100644 --- a/GATK/3.8-1-0-gf15c1c3ef/CombineVariants.nf +++ b/GATK/3.8-1-0-gf15c1c3ef/CombineVariants.nf @@ -14,7 +14,11 @@ process CombineVariants { script: def input_files = vcf_files.collect{"$it"}.join(" -V ") """ - java -Xmx${task.memory.toGiga()-4}G -Djava.io.tmpdir=\$TMPDIR -jar ${params.gatk_path} -T CombineVariants --reference_sequence ${params.genome} -V ${input_files} --out ${analysis_id}.vcf ${params.optional} + java -Xmx${task.memory.toGiga()-4}G -Djava.io.tmpdir=\$TMPDIR -jar ${params.gatk_path} -T CombineVariants \ + --reference_sequence ${params.genome} \ + -V ${input_files} \ + --out ${analysis_id}.vcf \ + ${params.optional} """ } From fae61347301050251f7c3821a65989b0cabc6b70 Mon Sep 17 00:00:00 2001 From: ellendejong Date: Mon, 24 Jul 2023 10:56:00 +0200 Subject: [PATCH 09/10] change $PWD to $TMPDIR --- GATK/4.1.3.0/MergeVCFs.nf | 2 +- GATK/4.1.3.0/SplitNCigarReads.nf | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/GATK/4.1.3.0/MergeVCFs.nf b/GATK/4.1.3.0/MergeVCFs.nf index 333870c8..a31a6e97 100644 --- a/GATK/4.1.3.0/MergeVCFs.nf +++ b/GATK/4.1.3.0/MergeVCFs.nf @@ -17,7 +17,7 @@ process MergeVCFs { vcfs = vcf_chunks.join(' -INPUT ') """ - gatk --java-options "-Xmx${task.memory.toGiga()-4}g -Djava.io.tmpdir=\$PWD" \ + gatk --java-options "-Xmx${task.memory.toGiga()-4}g -Djava.io.tmpdir=\$TMPDIR" \ SortVcf \ --INPUT $vcfs \ --OUTPUT ${id}${ext} \ diff --git a/GATK/4.1.3.0/SplitNCigarReads.nf b/GATK/4.1.3.0/SplitNCigarReads.nf index dda83e0a..9712cfbb 100644 --- a/GATK/4.1.3.0/SplitNCigarReads.nf +++ b/GATK/4.1.3.0/SplitNCigarReads.nf @@ -14,7 +14,8 @@ process SplitNCigarReads { script: """ gatk --java-options "-Xmx${task.memory.toGiga()-4}g -Djava.io.tmpdir=\$TMPDIR" \ - SplitNCigarReads --tmp-dir \$PWD \ + SplitNCigarReads \ + --tmp-dir \$TMPDIR \ -R ${params.genome_fasta} \ -I ${bam_file} \ --refactor-cigar-string \ From f39285858905d70e1f42d7efba1512e7c04920e6 Mon Sep 17 00:00:00 2001 From: ellendejong Date: Mon, 24 Jul 2023 10:56:27 +0200 Subject: [PATCH 10/10] add java tmpdir to picard tasks --- Picard/2.22.0/CollectHsMetrics.nf | 9 ++++++++- Picard/2.22.0/CollectMultipleMetrics.nf | 8 +++++++- Picard/2.22.0/CollectWgsMetrics.nf | 6 +++++- Picard/2.22.0/CreateSequenceDictionary.nf | 4 +++- Picard/2.22.0/EstimateLibraryComplexity.nf | 6 +++++- Picard/2.22.0/IntervalListTools.nf | 3 ++- 6 files changed, 30 insertions(+), 6 deletions(-) diff --git a/Picard/2.22.0/CollectHsMetrics.nf b/Picard/2.22.0/CollectHsMetrics.nf index b9633e13..c07a4159 100644 --- a/Picard/2.22.0/CollectHsMetrics.nf +++ b/Picard/2.22.0/CollectHsMetrics.nf @@ -13,6 +13,13 @@ process CollectHsMetrics { script: """ - picard -Xmx${task.memory.toGiga()-4}G CollectHsMetrics TMP_DIR=\$TMPDIR R=${params.genome} INPUT=${bam_file} OUTPUT=${sample_id}.HsMetrics.txt BAIT_INTERVALS=${params.bait} TARGET_INTERVALS=${params.target} ${params.optional} + picard -Xmx${task.memory.toGiga()-4}G -Djava.io.tmpdir=\$TMPDIR CollectHsMetrics \ + TMP_DIR=\$TMPDIR \ + R=${params.genome} \ + INPUT=${bam_file} \ + OUTPUT=${sample_id}.HsMetrics.txt \ + BAIT_INTERVALS=${params.bait} \ + TARGET_INTERVALS=${params.target} \ + ${params.optional} """ } diff --git a/Picard/2.22.0/CollectMultipleMetrics.nf b/Picard/2.22.0/CollectMultipleMetrics.nf index 45be1ea8..10097a9d 100644 --- a/Picard/2.22.0/CollectMultipleMetrics.nf +++ b/Picard/2.22.0/CollectMultipleMetrics.nf @@ -13,6 +13,12 @@ process CollectMultipleMetrics { script: """ - picard -Xmx${task.memory.toGiga()-4}G CollectMultipleMetrics TMP_DIR=\$TMPDIR R=${params.genome} INPUT=${bam_file} OUTPUT=${sample_id} EXT=.txt ${params.optional} + picard -Xmx${task.memory.toGiga()-4}G -Djava.io.tmpdir=\$TMPDIR CollectMultipleMetrics \ + TMP_DIR=\$TMPDIR \ + R=${params.genome} \ + INPUT=${bam_file} \ + OUTPUT=${sample_id} \ + EXT=.txt \ + ${params.optional} """ } diff --git a/Picard/2.22.0/CollectWgsMetrics.nf b/Picard/2.22.0/CollectWgsMetrics.nf index 66e51fb2..ee01f367 100644 --- a/Picard/2.22.0/CollectWgsMetrics.nf +++ b/Picard/2.22.0/CollectWgsMetrics.nf @@ -13,6 +13,10 @@ process CollectWgsMetrics { script: """ - picard -Xmx${task.memory.toGiga()-4}G CollectWgsMetrics TMP_DIR=\$TMPDIR R=${params.genome} INPUT=${bam_file} OUTPUT=${sample_id}.wgs_metrics.txt ${params.optional} + picard -Xmx${task.memory.toGiga()-4}G -Djava.io.tmpdir=\$TMPDIR CollectWgsMetrics \ + TMP_DIR=\$TMPDIR R=${params.genome} \ + INPUT=${bam_file} \ + OUTPUT=${sample_id}.wgs_metrics.txt \ + ${params.optional} """ } diff --git a/Picard/2.22.0/CreateSequenceDictionary.nf b/Picard/2.22.0/CreateSequenceDictionary.nf index df15d284..3e57288f 100644 --- a/Picard/2.22.0/CreateSequenceDictionary.nf +++ b/Picard/2.22.0/CreateSequenceDictionary.nf @@ -13,6 +13,8 @@ process CreateSequenceDictionary { script: """ - picard -Xmx${task.memory.toGiga()-4}G CreateSequenceDictionary REFERENCE=${genome_fasta} OUTPUT=${genome_fasta.baseName}.dict + picard -Xmx${task.memory.toGiga()-4}G -Djava.io.tmpdir=\$TMPDIR CreateSequenceDictionary \ + REFERENCE=${genome_fasta} \ + OUTPUT=${genome_fasta.baseName}.dict """ } diff --git a/Picard/2.22.0/EstimateLibraryComplexity.nf b/Picard/2.22.0/EstimateLibraryComplexity.nf index 6100ff95..42a18141 100644 --- a/Picard/2.22.0/EstimateLibraryComplexity.nf +++ b/Picard/2.22.0/EstimateLibraryComplexity.nf @@ -13,6 +13,10 @@ process EstimateLibraryComplexity { script: """ - picard -Xmx${task.memory.toGiga()-4}G EstimateLibraryComplexity TMP_DIR=\$TMPDIR INPUT=${bam_file} OUTPUT=${sample_id}.LibraryComplexity.txt ${params.optional} + picard -Xmx${task.memory.toGiga()-4}G -Djava.io.tmpdir=\$TMPDIR EstimateLibraryComplexity \ + TMP_DIR=\$TMPDIR \ + INPUT=${bam_file} \ + OUTPUT=${sample_id}.LibraryComplexity.txt \ + ${params.optional} """ } diff --git a/Picard/2.22.0/IntervalListTools.nf b/Picard/2.22.0/IntervalListTools.nf index 838e5801..eb2aaf48 100644 --- a/Picard/2.22.0/IntervalListTools.nf +++ b/Picard/2.22.0/IntervalListTools.nf @@ -13,7 +13,8 @@ process IntervalListTools { script: """ - picard -Xmx${task.memory.toGiga()-4}G IntervalListTools TMP_DIR=\$TMPDIR \ + picard -Xmx${task.memory.toGiga()-4}G -Djava.io.tmpdir=\$TMPDIR IntervalListTools \ + TMP_DIR=\$TMPDIR \ INPUT=${interval_list} OUTPUT=. \ SUBDIVISION_MODE=BALANCING_WITHOUT_INTERVAL_SUBDIVISION_WITH_OVERFLOW \ SCATTER_COUNT=${params.scatter_count} \