Add memory stuff to all gatk4 modules (#1122)

* Add memory stuff to all gatj4 modules

* Add removed input line back in

* revert script section
This commit is contained in:
FriederikeHanssen 2021-12-07 15:22:24 +01:00 committed by GitHub
parent d473a247d2
commit 7389963d5c
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
23 changed files with 129 additions and 26 deletions

View file

@ -22,13 +22,14 @@ process GATK4_APPLYBQSR {
def args = task.ext.args ?: ''
def prefix = task.ext.prefix ?: "${meta.id}"
def interval = intervals ? "-L ${intervals}" : ""
def avail_mem = 3
if (!task.memory) {
log.info '[GATK ApplyBQSR] Available memory not known - defaulting to 3GB. Specify process memory requirements to change this.'
} else {
avail_mem = task.memory.giga
}
"""
gatk ApplyBQSR \\
gatk --java-options "-Xmx${avail_mem}g" ApplyBQSR \\
-R $fasta \\
-I $input \\
--bqsr-recal-file $bqsr_table \\

View file

@ -25,14 +25,14 @@ process GATK4_BASERECALIBRATOR {
def prefix = task.ext.prefix ?: "${meta.id}"
def intervalsCommand = intervalsBed ? "-L ${intervalsBed}" : ""
def sitesCommand = knownSites.collect{"--known-sites ${it}"}.join(' ')
def avail_mem = 3
if (!task.memory) {
log.info '[GATK BaseRecalibrator] Available memory not known - defaulting to 3GB. Specify process memory requirements to change this.'
} else {
avail_mem = task.memory.giga
}
"""
gatk BaseRecalibrator \
gatk --java-options "-Xmx${avail_mem}g" BaseRecalibrator \
-R $fasta \
-I $input \
$sitesCommand \

View file

@ -18,8 +18,14 @@ process GATK4_BEDTOINTERVALLIST {
script:
def args = task.ext.args ?: ''
def prefix = task.ext.prefix ?: "${meta.id}"
def avail_mem = 3
if (!task.memory) {
log.info '[GATK BedToIntervalList] Available memory not known - defaulting to 3GB. Specify process memory requirements to change this.'
} else {
avail_mem = task.memory.giga
}
"""
gatk BedToIntervalList \\
gatk --java-options "-Xmx${avail_mem}g" BedToIntervalList \\
-I $bed \\
-SD $sequence_dict \\
-O ${prefix}.interval_list \\

View file

@ -21,8 +21,14 @@ process GATK4_CALCULATECONTAMINATION {
def prefix = task.ext.prefix ?: "${meta.id}"
def matched_command = matched ? " -matched ${matched} " : ''
def segment_command = segmentout ? " -segments ${prefix}.segmentation.table" : ''
def avail_mem = 3
if (!task.memory) {
log.info '[GATK CalculateContamination] Available memory not known - defaulting to 3GB. Specify process memory requirements to change this.'
} else {
avail_mem = task.memory.giga
}
"""
gatk CalculateContamination \\
gatk --java-options "-Xmx${avail_mem}g" CalculateContamination \\
-I $pileup \\
$matched_command \\
-O ${prefix}.contamination.table \\

View file

@ -18,7 +18,7 @@ process GATK4_CREATESEQUENCEDICTIONARY {
def args = task.ext.args ?: ''
def avail_mem = 6
if (!task.memory) {
log.info '[GATK] Available memory not known - defaulting to 6GB. Specify process memory requirements to change this.'
log.info '[GATK CreateSequenceDictionary] Available memory not known - defaulting to 6GB. Specify process memory requirements to change this.'
} else {
avail_mem = task.memory.giga
}

View file

@ -21,8 +21,14 @@ process GATK4_CREATESOMATICPANELOFNORMALS {
script:
def args = task.ext.args ?: ''
def prefix = task.ext.prefix ?: "${meta.id}"
def avail_mem = 3
if (!task.memory) {
log.info '[GATK CreateSomaticPanelOfNormals] Available memory not known - defaulting to 3GB. Specify process memory requirements to change this.'
} else {
avail_mem = task.memory.giga
}
"""
gatk \\
gatk --java-options "-Xmx${avail_mem}g" \\
CreateSomaticPanelOfNormals \\
-R $fasta \\
-V gendb://$genomicsdb \\

View file

@ -29,7 +29,7 @@ process GATK4_ESTIMATELIBRARYCOMPLEXITY {
avail_mem = task.memory.giga
}
"""
gatk EstimateLibraryComplexity \
gatk --java-options "-Xmx${avail_mem}g" EstimateLibraryComplexity \
${crams} \
-O ${prefix}.metrics \
--REFERENCE_SEQUENCE ${fasta} \

View file

@ -18,8 +18,14 @@ process GATK4_FASTQTOSAM {
def args = task.ext.args ?: ''
def prefix = task.ext.prefix ?: "${meta.id}"
def read_files = meta.single_end ? "-F1 $reads" : "-F1 ${reads[0]} -F2 ${reads[1]}"
def avail_mem = 3
if (!task.memory) {
log.info '[GATK FastqToSam] Available memory not known - defaulting to 3GB. Specify process memory requirements to change this.'
} else {
avail_mem = task.memory.giga
}
"""
gatk FastqToSam \\
gatk --java-options "-Xmx${avail_mem}g" FastqToSam \\
$read_files \\
-O ${prefix}.bam \\
-SM $prefix \\

View file

@ -37,8 +37,14 @@ process GATK4_FILTERMUTECTCALLS {
if (contaminationfile) {
contamination_options = '--contamination-table ' + contaminationfile.join(' --contamination-table ')
}
def avail_mem = 3
if (!task.memory) {
log.info '[GATK FilterMutectCalls] Available memory not known - defaulting to 3GB. Specify process memory requirements to change this.'
} else {
avail_mem = task.memory.giga
}
"""
gatk FilterMutectCalls \\
gatk --java-options "-Xmx${avail_mem}g" FilterMutectCalls \\
-R $fasta \\
-V $vcf \\
$orientationbias_options \\

View file

@ -42,8 +42,14 @@ process GATK4_GENOMICSDBIMPORT {
updated_db = wspace.toString()
}
def avail_mem = 3
if (!task.memory) {
log.info '[GATK GenomicsDBImport] Available memory not known - defaulting to 3GB. Specify process memory requirements to change this.'
} else {
avail_mem = task.memory.giga
}
"""
gatk GenomicsDBImport \\
gatk --java-options "-Xmx${avail_mem}g" GenomicsDBImport \\
$inputs_command \\
$dir_command \\
$intervals_command \\

View file

@ -26,8 +26,14 @@ process GATK4_GENOTYPEGVCFS {
def dbsnp_options = dbsnp ? "-D ${dbsnp}" : ""
def interval_options = intervals_bed ? "-L ${intervals_bed}" : ""
def gvcf_options = gvcf.name.endsWith(".vcf") || gvcf.name.endsWith(".vcf.gz") ? "$gvcf" : "gendb://$gvcf"
def avail_mem = 3
if (!task.memory) {
log.info '[GATK GenotypeGVCFs] Available memory not known - defaulting to 3GB. Specify process memory requirements to change this.'
} else {
avail_mem = task.memory.giga
}
"""
gatk \\
gatk --java-options "-Xmx${avail_mem}g" \\
GenotypeGVCFs \\
$args \\
$interval_options \\

View file

@ -24,8 +24,14 @@ process GATK4_GETPILEUPSUMMARIES {
sitesCommand = sites ? " -L ${sites} " : " -L ${variants} "
def avail_mem = 3
if (!task.memory) {
log.info '[GATK GetPileupSummaries] Available memory not known - defaulting to 3GB. Specify process memory requirements to change this.'
} else {
avail_mem = task.memory.giga
}
"""
gatk GetPileupSummaries \\
gatk --java-options "-Xmx${avail_mem}g" GetPileupSummaries \\
-I $bam \\
-V $variants \\
$sitesCommand \\

View file

@ -16,8 +16,14 @@ process GATK4_INDEXFEATUREFILE {
script:
def args = task.ext.args ?: ''
def avail_mem = 3
if (!task.memory) {
log.info '[GATK IndexFeatureFile] Available memory not known - defaulting to 3GB. Specify process memory requirements to change this.'
} else {
avail_mem = task.memory.giga
}
"""
gatk \\
gatk --java-options "-Xmx${avail_mem}g" \\
IndexFeatureFile \\
$args \\
-I $feature_file

View file

@ -17,11 +17,17 @@ process GATK4_INTERVALLISTTOOLS {
script:
def args = task.ext.args ?: ''
def prefix = task.ext.prefix ?: "${meta.id}"
def avail_mem = 3
if (!task.memory) {
log.info '[GATK IntervalListTools] Available memory not known - defaulting to 3GB. Specify process memory requirements to change this.'
} else {
avail_mem = task.memory.giga
}
"""
mkdir ${prefix}_split
gatk \\
gatk --java-options "-Xmx${avail_mem}g" \\
IntervalListTools \\
-I ${interval_list} \\
-O ${prefix}_split \\

View file

@ -19,8 +19,14 @@ process GATK4_LEARNREADORIENTATIONMODEL {
def prefix = task.ext.prefix ?: "${meta.id}"
def inputs_list = []
f1r2.each() { a -> inputs_list.add(" -I " + a) }
def avail_mem = 3
if (!task.memory) {
log.info '[GATK LearnReadOrientationModel] Available memory not known - defaulting to 3GB. Specify process memory requirements to change this.'
} else {
avail_mem = task.memory.giga
}
"""
gatk \\
gatk --java-options "-Xmx${avail_mem}g" \\
LearnReadOrientationModel \\
${inputs_list.join(' ')} \\
-O ${prefix}.tar.gz \\

View file

@ -20,14 +20,14 @@ process GATK4_MARKDUPLICATES {
def args = task.ext.args ?: ''
def prefix = task.ext.prefix ?: "${meta.id}"
def bam_list = bams.collect(){ bam -> "--INPUT ".concat(bam.toString()) }.join(" ")
def avail_mem = 3
def avail_mem = 3
if (!task.memory) {
log.info '[GATK HaplotypeCaller] Available memory not known - defaulting to 3GB. Specify process memory requirements to change this.'
log.info '[GATK MarkDuplicates] Available memory not known - defaulting to 3GB. Specify process memory requirements to change this.'
} else {
avail_mem = task.memory.giga
}
"""
gatk MarkDuplicates \\
gatk --java-options "-Xmx${avail_mem}g" MarkDuplicates \\
$bam_list \\
--METRICS_FILE ${prefix}.metrics \\
--TMP_DIR . \\

View file

@ -20,8 +20,14 @@ process GATK4_MERGEBAMALIGNMENT {
script:
def args = task.ext.args ?: ''
def prefix = task.ext.prefix ?: "${meta.id}"
def avail_mem = 3
if (!task.memory) {
log.info '[GATK MergeBamAlignment] Available memory not known - defaulting to 3GB. Specify process memory requirements to change this.'
} else {
avail_mem = task.memory.giga
}
"""
gatk MergeBamAlignment \\
gatk --java-options "-Xmx${avail_mem}g" MergeBamAlignment \\
ALIGNED=$aligned \\
UNMAPPED=$unmapped \\
R=$fasta \\

View file

@ -26,8 +26,14 @@ process GATK4_MERGEVCFS {
input += " I=${vcf}"
}
def ref = use_ref_dict ? "D=${ref_dict}" : ""
def avail_mem = 3
if (!task.memory) {
log.info '[GATK MergeVcfs] Available memory not known - defaulting to 3GB. Specify process memory requirements to change this.'
} else {
avail_mem = task.memory.giga
}
"""
gatk MergeVcfs \\
gatk --java-options "-Xmx${avail_mem}g" MergeVcfs \\
$input \\
O=${prefix}.vcf.gz \\
$ref \\

View file

@ -53,8 +53,14 @@ process GATK4_MUTECT2 {
normals_command = '-normal ' + which_norm.join( ' -normal ')
}
def avail_mem = 3
if (!task.memory) {
log.info '[GATK Mutect2] Available memory not known - defaulting to 3GB. Specify process memory requirements to change this.'
} else {
avail_mem = task.memory.giga
}
"""
gatk Mutect2 \\
gatk --java-options "-Xmx${avail_mem}g" Mutect2 \\
-R ${fasta} \\
${inputs_command} \\
${normals_command} \\

View file

@ -17,8 +17,14 @@ process GATK4_REVERTSAM {
script:
def args = task.ext.args ?: ''
def prefix = task.ext.prefix ?: "${meta.id}"
def avail_mem = 3
if (!task.memory) {
log.info '[GATK RevertSam] Available memory not known - defaulting to 3GB. Specify process memory requirements to change this.'
} else {
avail_mem = task.memory.giga
}
"""
gatk RevertSam \\
gatk --java-options "-Xmx${avail_mem}g" RevertSam \\
I=$bam \\
O=${prefix}.reverted.bam \\
$args

View file

@ -18,8 +18,14 @@ process GATK4_SAMTOFASTQ {
def args = task.ext.args ?: ''
def prefix = task.ext.prefix ?: "${meta.id}"
def output = meta.single_end ? "FASTQ=${prefix}.fastq.gz" : "FASTQ=${prefix}_1.fastq.gz SECOND_END_FASTQ=${prefix}_2.fastq.gz"
def avail_mem = 3
if (!task.memory) {
log.info '[GATK SamToFastq] Available memory not known - defaulting to 3GB. Specify process memory requirements to change this.'
} else {
avail_mem = task.memory.giga
}
"""
gatk SamToFastq \\
gatk --java-options "-Xmx${avail_mem}g" SamToFastq \\
I=$bam \\
$output \\
$args

View file

@ -20,8 +20,14 @@ process GATK4_SPLITNCIGARREADS {
script:
def args = task.ext.args ?: ''
def prefix = task.ext.prefix ?: "${meta.id}"
def avail_mem = 3
if (!task.memory) {
log.info '[GATK SplitNCigarReads] Available memory not known - defaulting to 3GB. Specify process memory requirements to change this.'
} else {
avail_mem = task.memory.giga
}
"""
gatk SplitNCigarReads \\
gatk --java-options "-Xmx${avail_mem}g" SplitNCigarReads \\
-R $fasta \\
-I $bam \\
-O ${prefix}.bam \\

View file

@ -23,7 +23,7 @@ process GATK4_VARIANTFILTRATION {
def prefix = task.ext.prefix ?: "${meta.id}"
def avail_mem = 3
if (!task.memory) {
log.info '[GATK HaplotypeCaller] Available memory not known - defaulting to 3GB. Specify process memory requirements to change this.'
log.info '[GATK VariantFiltration] Available memory not known - defaulting to 3GB. Specify process memory requirements to change this.'
} else {
avail_mem = task.memory.toGiga()
}