From 070c5ffe240e87cc5b5925588f36c0327df9d61f Mon Sep 17 00:00:00 2001 From: Rike Date: Mon, 28 Feb 2022 10:53:22 +0100 Subject: [PATCH 01/10] Use nf-core/deeptools --- modules.json | 3 ++ .../modules/deeptools/bamcoverage/main.nf} | 16 +++--- .../modules/deeptools/bamcoverage/meta.yml | 49 +++++++++++++++++++ 3 files changed, 61 insertions(+), 7 deletions(-) rename modules/{local/deeptools/bamcoverage.nf => nf-core/modules/deeptools/bamcoverage/main.nf} (61%) create mode 100644 modules/nf-core/modules/deeptools/bamcoverage/meta.yml diff --git a/modules.json b/modules.json index ecae7099d0..1e2ef006c4 100644 --- a/modules.json +++ b/modules.json @@ -27,6 +27,9 @@ "custom/dumpsoftwareversions": { "git_sha": "e745e167c1020928ef20ea1397b6b4d230681b4d" }, + "deeptools/bamcoverage": { + "git_sha": "fdb1664885480d9411c24ba45bb4fde4738e5907" + }, "deepvariant": { "git_sha": "e745e167c1020928ef20ea1397b6b4d230681b4d" }, diff --git a/modules/local/deeptools/bamcoverage.nf b/modules/nf-core/modules/deeptools/bamcoverage/main.nf similarity index 61% rename from modules/local/deeptools/bamcoverage.nf rename to modules/nf-core/modules/deeptools/bamcoverage/main.nf index db7b6cad0d..83e3ffebae 100644 --- a/modules/local/deeptools/bamcoverage.nf +++ b/modules/nf-core/modules/deeptools/bamcoverage/main.nf @@ -8,28 +8,30 @@ process DEEPTOOLS_BAMCOVERAGE { 'quay.io/biocontainers/deeptools:3.5.1--py_0' }" input: - tuple val(meta), path(bam), path(bai) + tuple val(meta), path(input), path(input_index) output: - tuple val(meta), path("*.bigWig"), emit: bigwig - path "versions.yml" , emit: versions + tuple val(meta), path("*.bigWig") , emit: bigwig, optional: true + tuple val(meta), path("*.bedgraph") , emit: bedgraph, optional: true + path "versions.yml" , emit: versions when: task.ext.when == null || task.ext.when script: def args = task.ext.args ?: '' - def prefix = task.ext.prefix ?: "${meta.id}" + def prefix = task.ext.prefix ?: "${meta.id}.bigWig" + """ bamCoverage \ - --bam $bam \ + --bam $input \ $args \ --numberOfProcessors ${task.cpus} \ - --outFileName ${prefix}.bigWig + --outFileName ${prefix} cat <<-END_VERSIONS > versions.yml "${task.process}": - deeptools: \$(echo \$(deeptools --version 2>&1) | sed 's/^.*deeptools //; s/Using.*\$//' )) + deeptools: \$(bamCoverage --version | sed -e "s/bamCoverage //g") END_VERSIONS """ } diff --git a/modules/nf-core/modules/deeptools/bamcoverage/meta.yml b/modules/nf-core/modules/deeptools/bamcoverage/meta.yml new file mode 100644 index 0000000000..d0590b2a41 --- /dev/null +++ b/modules/nf-core/modules/deeptools/bamcoverage/meta.yml @@ -0,0 +1,49 @@ +name: deeptools_bamcoverage +description: This tool takes an alignment of reads or fragments as input (BAM file) and generates a coverage track (bigWig or bedGraph) as output. +keywords: + - sort +tools: + - deeptools: + description: A set of user-friendly tools for normalization and visualzation of deep-sequencing data + homepage: https://deeptools.readthedocs.io/en/develop/content/tools/bamCoverage.html + documentation: https://deeptools.readthedocs.io/en/develop/content/tools/bamCoverage.html + tool_dev_url: https://github.com/deeptools/deepTools/ + doi: "https://doi.org/10.1093/nar/gkw257" + licence: ['GPL v3'] + +input: + - meta: + type: map + description: | + Groovy Map containing sample information + e.g. [ id:'test', single_end:false ] + - input: + type: file + description: BAM/CRAM file + pattern: "*.{bam,cram}" + - input_index: + type: file + description: BAM/CRAM index file + pattern: "*.{bai,crai}" + +output: + - meta: + type: map + description: | + Groovy Map containing sample information + e.g. [ id:'test', single_end:false ] + - versions: + type: file + description: File containing software versions + pattern: "versions.yml" + - bigWig: + type: file + description: BigWig file + pattern: "*.bigWig" + - bedgraph: + type: file + description: Bedgraph file + pattern: "*.bedgraph" + +authors: + - "@FriederikeHanssen" From 1ddc2478554def5b49eed11010bf7ffe1dddb2e0 Mon Sep 17 00:00:00 2001 From: Rike Date: Mon, 28 Feb 2022 12:45:17 +0100 Subject: [PATCH 02/10] update samtools version to 1.15 --- modules.json | 14 +++++++------- modules/nf-core/modules/samtools/bam2fq/main.nf | 6 +++--- modules/nf-core/modules/samtools/faidx/main.nf | 6 +++--- modules/nf-core/modules/samtools/index/main.nf | 6 +++--- modules/nf-core/modules/samtools/merge/main.nf | 6 +++--- modules/nf-core/modules/samtools/mpileup/main.nf | 6 +++--- modules/nf-core/modules/samtools/stats/main.nf | 6 +++--- modules/nf-core/modules/samtools/view/main.nf | 6 +++--- 8 files changed, 28 insertions(+), 28 deletions(-) diff --git a/modules.json b/modules.json index 1e2ef006c4..0ede153de9 100644 --- a/modules.json +++ b/modules.json @@ -121,25 +121,25 @@ "git_sha": "e745e167c1020928ef20ea1397b6b4d230681b4d" }, "samtools/bam2fq": { - "git_sha": "e745e167c1020928ef20ea1397b6b4d230681b4d" + "git_sha": "1ad73f1b2abdea9398680d6d20014838135c9a35" }, "samtools/faidx": { - "git_sha": "e745e167c1020928ef20ea1397b6b4d230681b4d" + "git_sha": "1ad73f1b2abdea9398680d6d20014838135c9a35" }, "samtools/index": { - "git_sha": "e745e167c1020928ef20ea1397b6b4d230681b4d" + "git_sha": "1ad73f1b2abdea9398680d6d20014838135c9a35" }, "samtools/merge": { - "git_sha": "e745e167c1020928ef20ea1397b6b4d230681b4d" + "git_sha": "1ad73f1b2abdea9398680d6d20014838135c9a35" }, "samtools/mpileup": { - "git_sha": "e745e167c1020928ef20ea1397b6b4d230681b4d" + "git_sha": "1ad73f1b2abdea9398680d6d20014838135c9a35" }, "samtools/stats": { - "git_sha": "e745e167c1020928ef20ea1397b6b4d230681b4d" + "git_sha": "1ad73f1b2abdea9398680d6d20014838135c9a35" }, "samtools/view": { - "git_sha": "e745e167c1020928ef20ea1397b6b4d230681b4d" + "git_sha": "1ad73f1b2abdea9398680d6d20014838135c9a35" }, "seqkit/split2": { "git_sha": "e745e167c1020928ef20ea1397b6b4d230681b4d" diff --git a/modules/nf-core/modules/samtools/bam2fq/main.nf b/modules/nf-core/modules/samtools/bam2fq/main.nf index 4b78a46e32..8dd64dc019 100644 --- a/modules/nf-core/modules/samtools/bam2fq/main.nf +++ b/modules/nf-core/modules/samtools/bam2fq/main.nf @@ -2,10 +2,10 @@ process SAMTOOLS_BAM2FQ { tag "$meta.id" label 'process_low' - conda (params.enable_conda ? "bioconda::samtools=1.14" : null) + conda (params.enable_conda ? "bioconda::samtools=1.15" : null) container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ? - 'https://depot.galaxyproject.org/singularity/samtools:1.14--hb421002_0' : - 'quay.io/biocontainers/samtools:1.14--hb421002_0' }" + 'https://depot.galaxyproject.org/singularity/samtools:1.15--h1170115_1' : + 'quay.io/biocontainers/samtools:1.15--h1170115_1' }" input: tuple val(meta), path(inputbam) diff --git a/modules/nf-core/modules/samtools/faidx/main.nf b/modules/nf-core/modules/samtools/faidx/main.nf index b83a4952d8..7732a4ec10 100644 --- a/modules/nf-core/modules/samtools/faidx/main.nf +++ b/modules/nf-core/modules/samtools/faidx/main.nf @@ -2,10 +2,10 @@ process SAMTOOLS_FAIDX { tag "$fasta" label 'process_low' - conda (params.enable_conda ? "bioconda::samtools=1.14" : null) + conda (params.enable_conda ? "bioconda::samtools=1.15" : null) container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ? - 'https://depot.galaxyproject.org/singularity/samtools:1.14--hb421002_0' : - 'quay.io/biocontainers/samtools:1.14--hb421002_0' }" + 'https://depot.galaxyproject.org/singularity/samtools:1.15--h1170115_1' : + 'quay.io/biocontainers/samtools:1.15--h1170115_1' }" input: tuple val(meta), path(fasta) diff --git a/modules/nf-core/modules/samtools/index/main.nf b/modules/nf-core/modules/samtools/index/main.nf index dfe0234f7c..e41cdcc888 100644 --- a/modules/nf-core/modules/samtools/index/main.nf +++ b/modules/nf-core/modules/samtools/index/main.nf @@ -2,10 +2,10 @@ process SAMTOOLS_INDEX { tag "$meta.id" label 'process_low' - conda (params.enable_conda ? "bioconda::samtools=1.14" : null) + conda (params.enable_conda ? "bioconda::samtools=1.15" : null) container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ? - 'https://depot.galaxyproject.org/singularity/samtools:1.14--hb421002_0' : - 'quay.io/biocontainers/samtools:1.14--hb421002_0' }" + 'https://depot.galaxyproject.org/singularity/samtools:1.15--h1170115_1' : + 'quay.io/biocontainers/samtools:1.15--h1170115_1' }" input: tuple val(meta), path(input) diff --git a/modules/nf-core/modules/samtools/merge/main.nf b/modules/nf-core/modules/samtools/merge/main.nf index be6fe32ebc..7b77167730 100644 --- a/modules/nf-core/modules/samtools/merge/main.nf +++ b/modules/nf-core/modules/samtools/merge/main.nf @@ -2,10 +2,10 @@ process SAMTOOLS_MERGE { tag "$meta.id" label 'process_low' - conda (params.enable_conda ? "bioconda::samtools=1.14" : null) + conda (params.enable_conda ? "bioconda::samtools=1.15" : null) container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ? - 'https://depot.galaxyproject.org/singularity/samtools:1.14--hb421002_0' : - 'quay.io/biocontainers/samtools:1.14--hb421002_0' }" + 'https://depot.galaxyproject.org/singularity/samtools:1.15--h1170115_1' : + 'quay.io/biocontainers/samtools:1.15--h1170115_1' }" input: tuple val(meta), path(input_files) diff --git a/modules/nf-core/modules/samtools/mpileup/main.nf b/modules/nf-core/modules/samtools/mpileup/main.nf index 77afae60a7..cea4032193 100644 --- a/modules/nf-core/modules/samtools/mpileup/main.nf +++ b/modules/nf-core/modules/samtools/mpileup/main.nf @@ -2,10 +2,10 @@ process SAMTOOLS_MPILEUP { tag "$meta.id" label 'process_medium' - conda (params.enable_conda ? "bioconda::samtools=1.14" : null) + conda (params.enable_conda ? "bioconda::samtools=1.15" : null) container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ? - 'https://depot.galaxyproject.org/singularity/samtools:1.14--hb421002_0' : - 'quay.io/biocontainers/samtools:1.14--hb421002_0' }" + 'https://depot.galaxyproject.org/singularity/samtools:1.15--h1170115_1' : + 'quay.io/biocontainers/samtools:1.15--h1170115_1' }" input: tuple val(meta), path(bam) diff --git a/modules/nf-core/modules/samtools/stats/main.nf b/modules/nf-core/modules/samtools/stats/main.nf index f6fe3bfef8..6efc9d9a56 100644 --- a/modules/nf-core/modules/samtools/stats/main.nf +++ b/modules/nf-core/modules/samtools/stats/main.nf @@ -2,10 +2,10 @@ process SAMTOOLS_STATS { tag "$meta.id" label 'process_low' - conda (params.enable_conda ? "bioconda::samtools=1.14" : null) + conda (params.enable_conda ? "bioconda::samtools=1.15" : null) container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ? - 'https://depot.galaxyproject.org/singularity/samtools:1.14--hb421002_0' : - 'quay.io/biocontainers/samtools:1.14--hb421002_0' }" + 'https://depot.galaxyproject.org/singularity/samtools:1.15--h1170115_1' : + 'quay.io/biocontainers/samtools:1.15--h1170115_1' }" input: tuple val(meta), path(input), path(input_index) diff --git a/modules/nf-core/modules/samtools/view/main.nf b/modules/nf-core/modules/samtools/view/main.nf index aee21a4eae..75aad0635c 100644 --- a/modules/nf-core/modules/samtools/view/main.nf +++ b/modules/nf-core/modules/samtools/view/main.nf @@ -2,10 +2,10 @@ process SAMTOOLS_VIEW { tag "$meta.id" label 'process_medium' - conda (params.enable_conda ? "bioconda::samtools=1.14" : null) + conda (params.enable_conda ? "bioconda::samtools=1.15" : null) container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ? - 'https://depot.galaxyproject.org/singularity/samtools:1.14--hb421002_0' : - 'quay.io/biocontainers/samtools:1.14--hb421002_0' }" + 'https://depot.galaxyproject.org/singularity/samtools:1.15--h1170115_1' : + 'quay.io/biocontainers/samtools:1.15--h1170115_1' }" input: tuple val(meta), path(input) From 6fc23e30e15b5a4eb4c5bb672c1945cdee8fa541 Mon Sep 17 00:00:00 2001 From: Rike Date: Mon, 28 Feb 2022 12:58:07 +0100 Subject: [PATCH 03/10] Fix grouping after mapping --- subworkflows/nf-core/gatk4_mapping/main.nf | 4 +++- subworkflows/nf-core/markduplicates.nf | 2 +- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/subworkflows/nf-core/gatk4_mapping/main.nf b/subworkflows/nf-core/gatk4_mapping/main.nf index e1c2432c84..0420b60976 100644 --- a/subworkflows/nf-core/gatk4_mapping/main.nf +++ b/subworkflows/nf-core/gatk4_mapping/main.nf @@ -31,14 +31,16 @@ workflow GATK4_MAPPING { new_meta.remove('size') new_meta.id = meta.sample + println meta // groupKey is to makes sure that the correct group can advance as soon as it is complete // and not stall the workflow until all reads from all channels are mapped - def groupKey = groupKey(meta, meta.numLanes * meta.size) + def groupKey = groupKey(new_meta, meta.numLanes * meta.size) //Returns the values we need tuple(groupKey, new_meta, bam) }.groupTuple(by:[0,1]).map{ groupKey, new_meta, bam -> [new_meta, bam] } + bam_mapped.view() // gatk4 markduplicates can handle multiple bams as input, so no need to merge/index here // Except if and only if skipping markduplicates or saving mapped bams diff --git a/subworkflows/nf-core/markduplicates.nf b/subworkflows/nf-core/markduplicates.nf index 61105d6048..33b9238c8c 100644 --- a/subworkflows/nf-core/markduplicates.nf +++ b/subworkflows/nf-core/markduplicates.nf @@ -4,7 +4,7 @@ // For all modules here: // A when clause condition is defined in the conf/modules.config to determine if the module should be run -include { DEEPTOOLS_BAMCOVERAGE } from '../../modules/local/deeptools/bamcoverage' +include { DEEPTOOLS_BAMCOVERAGE } from '../../modules/nf-core/modules/deeptools/bamcoverage/main' include { GATK4_ESTIMATELIBRARYCOMPLEXITY } from '../../modules/nf-core/modules/gatk4/estimatelibrarycomplexity/main' include { GATK4_MARKDUPLICATES } from '../../modules/nf-core/modules/gatk4/markduplicates/main' include { GATK4_MARKDUPLICATES_SPARK } from '../../modules/local/gatk4/markduplicatesspark/main' From 0585e6ae16c8defee271483de15c10238c0dfc1c Mon Sep 17 00:00:00 2001 From: Rike Date: Mon, 28 Feb 2022 22:28:23 +0100 Subject: [PATCH 04/10] local -> nf-core modules --- conf/modules.config | 2 +- modules.json | 12 ++++ .../gatk4/gatherpileupsummaries/main.nf | 45 ++++++++++++++ .../gatk4/gatherpileupsummaries/meta.yml | 41 +++++++++++++ .../modules/gatk4/intervallisttobed/main.nf | 41 +++++++++++++ .../modules/gatk4/intervallisttobed/meta.yml | 41 +++++++++++++ .../modules/gatk4/mergemutectstats/main.nf | 41 +++++++++++++ .../modules/gatk4/mergemutectstats/meta.yml | 42 +++++++++++++ .../nf-core/modules/qualimap/bamqc/main.nf | 55 +++++++++++++++++ .../nf-core/modules/qualimap/bamqc/meta.yml | 47 +++++++++++++++ .../modules/qualimap/bamqccram/main.nf | 60 +++++++++++++++++++ .../modules/qualimap/bamqccram/meta.yml | 51 ++++++++++++++++ subworkflows/local/prepare_intervals.nf | 2 +- subworkflows/nf-core/gatk4_mapping/main.nf | 2 - .../main.nf | 8 +-- .../main.nf | 6 +- subworkflows/nf-core/markduplicates.nf | 4 +- subworkflows/nf-core/recalibrate.nf | 8 +-- 18 files changed, 491 insertions(+), 17 deletions(-) create mode 100644 modules/nf-core/modules/gatk4/gatherpileupsummaries/main.nf create mode 100644 modules/nf-core/modules/gatk4/gatherpileupsummaries/meta.yml create mode 100644 modules/nf-core/modules/gatk4/intervallisttobed/main.nf create mode 100644 modules/nf-core/modules/gatk4/intervallisttobed/meta.yml create mode 100644 modules/nf-core/modules/gatk4/mergemutectstats/main.nf create mode 100644 modules/nf-core/modules/gatk4/mergemutectstats/meta.yml create mode 100644 modules/nf-core/modules/qualimap/bamqc/main.nf create mode 100644 modules/nf-core/modules/qualimap/bamqc/meta.yml create mode 100644 modules/nf-core/modules/qualimap/bamqccram/main.nf create mode 100644 modules/nf-core/modules/qualimap/bamqccram/meta.yml diff --git a/conf/modules.config b/conf/modules.config index 5113b0a64c..731e9d8db8 100644 --- a/conf/modules.config +++ b/conf/modules.config @@ -403,7 +403,7 @@ process { pattern: "*cram" ] } - withName: 'QUALIMAP_BAMQC_CRAM' { + withName: 'QUALIMAP_BAMQCCRAM' { ext.args = '--paint-chromosome-limits --genome-gc-distr HUMAN -skip-duplicated --skip-dup-mode 0 -outformat HTML' ext.prefix = { "${meta.id}.recal" } ext.when = { !(params.skip_tools && params.skip_tools.contains('bamqc')) } diff --git a/modules.json b/modules.json index 0ede153de9..23995b92c7 100644 --- a/modules.json +++ b/modules.json @@ -75,6 +75,9 @@ "gatk4/gatherbqsrreports": { "git_sha": "e745e167c1020928ef20ea1397b6b4d230681b4d" }, + "gatk4/gatherpileupsummaries": { + "git_sha": "8c8be7d7c6c5b17b89f1c392866fc433b0f79d69" + }, "gatk4/genomicsdbimport": { "git_sha": "967fb22dedc2c8855f00e64c3d7b5814c85242a6" }, @@ -87,12 +90,18 @@ "gatk4/haplotypecaller": { "git_sha": "e745e167c1020928ef20ea1397b6b4d230681b4d" }, + "gatk4/intervallisttobed": { + "git_sha": "fcd483e1b5156262a60184d96e7cd35d8d475bf4" + }, "gatk4/learnreadorientationmodel": { "git_sha": "e745e167c1020928ef20ea1397b6b4d230681b4d" }, "gatk4/markduplicates": { "git_sha": "e745e167c1020928ef20ea1397b6b4d230681b4d" }, + "gatk4/mergemutectstats": { + "git_sha": "3f364e2f31443f6742e8c63bf2083b5583431ef7" + }, "gatk4/mutect2": { "git_sha": "e745e167c1020928ef20ea1397b6b4d230681b4d" }, @@ -117,6 +126,9 @@ "multiqc": { "git_sha": "e745e167c1020928ef20ea1397b6b4d230681b4d" }, + "qualimap/bamqc": { + "git_sha": "e31f1ff3b1375b30db08637d8937e25cc046f3cc" + }, "samblaster": { "git_sha": "e745e167c1020928ef20ea1397b6b4d230681b4d" }, diff --git a/modules/nf-core/modules/gatk4/gatherpileupsummaries/main.nf b/modules/nf-core/modules/gatk4/gatherpileupsummaries/main.nf new file mode 100644 index 0000000000..52e57127fd --- /dev/null +++ b/modules/nf-core/modules/gatk4/gatherpileupsummaries/main.nf @@ -0,0 +1,45 @@ +process GATK4_GATHERPILEUPSUMMARIES { + tag "$meta.id" + label 'process_low' + + conda (params.enable_conda ? "bioconda::gatk4=4.2.5.0" : null) + container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ? + 'https://depot.galaxyproject.org/singularity/gatk4:4.2.5.0--hdfd78af_0' : + 'quay.io/biocontainers/gatk4:4.2.5.0--hdfd78af_0' }" + + + input: + tuple val(meta), path(pileup) + path dict + + output: + tuple val(meta), path("*.pileupsummaries.table"), emit: table + path "versions.yml" , emit: versions + + when: + task.ext.when == null || task.ext.when + + script: + def args = task.ext.args ?: '' + def prefix = task.ext.prefix ?: "${meta.id}" + def input = pileup.collect{ "-I ${it} " }.join(' ') + + def avail_mem = 3 + if (!task.memory) { + log.info '[GATK GatherPileupSummaries] Available memory not known - defaulting to 3GB. Specify process memory requirements to change this.' + } else { + avail_mem = task.memory.giga + } + """ + gatk --java-options "-Xmx${avail_mem}g" \ + GatherPileupSummaries \ + --sequence-dictionary ${dict} \ + ${input} \ + -O ${prefix}.pileupsummaries.table + + cat <<-END_VERSIONS > versions.yml + "${task.process}": + gatk4: \$(echo \$(gatk --version 2>&1) | sed 's/^.*(GATK) v//; s/ .*\$//') + END_VERSIONS + """ +} diff --git a/modules/nf-core/modules/gatk4/gatherpileupsummaries/meta.yml b/modules/nf-core/modules/gatk4/gatherpileupsummaries/meta.yml new file mode 100644 index 0000000000..7885a93079 --- /dev/null +++ b/modules/nf-core/modules/gatk4/gatherpileupsummaries/meta.yml @@ -0,0 +1,41 @@ +name: gatk4_gatherpileupsummaries +description: write your description here +keywords: + - sort +tools: + - gatk4: + description: Genome Analysis Toolkit (GATK4) + homepage: https://gatk.broadinstitute.org/hc/en-us + documentation: https://gatk.broadinstitute.org/hc/en-us + tool_dev_url: https://github.com/broadinstitute/gatk + doi: "10.1158/1538-7445.AM2017-3590" + licence: ['BSD-3-clause'] + +input: + - meta: + type: map + description: | + Groovy Map containing sample information + e.g. [ id:'test', single_end:false ] + - pileup: + type: (list of) file(s) + description: Pileup files from gatk4/getpileupsummaries + pattern: "*.pileups.table" + +output: + - meta: + type: map + description: | + Groovy Map containing sample information + e.g. [ id:'test', single_end:false ] + - versions: + type: file + description: File containing software versions + pattern: "versions.yml" + - table: + type: file + description: Pileup file + pattern: "*.pileups.table" + +authors: + - "@FriederikeHanssen" diff --git a/modules/nf-core/modules/gatk4/intervallisttobed/main.nf b/modules/nf-core/modules/gatk4/intervallisttobed/main.nf new file mode 100644 index 0000000000..24d20be1ad --- /dev/null +++ b/modules/nf-core/modules/gatk4/intervallisttobed/main.nf @@ -0,0 +1,41 @@ +process GATK4_INTERVALLISTTOBED { + tag "$meta.id" + label 'process_low' + + conda (params.enable_conda ? "bioconda::gatk4=4.2.5.0" : null) + container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ? + 'https://depot.galaxyproject.org/singularity/gatk4:4.2.5.0--hdfd78af_0' : + 'quay.io/biocontainers/gatk4:4.2.5.0--hdfd78af_0' }" + + input: + tuple val(meta), path(interval) + + output: + tuple val(meta), path("*.bed"), emit: bed + path "versions.yml" , emit: versions + + when: + task.ext.when == null || task.ext.when + + script: + def args = task.ext.args ?: '' + def prefix = task.ext.prefix ?: "${meta.id}" + + def avail_mem = 3 + if (!task.memory) { + log.info '[GATK IntervalListToBed] Available memory not known - defaulting to 3GB. Specify process memory requirements to change this.' + } else { + avail_mem = task.memory.giga + } + """ + gatk --java-options "-Xmx${avail_mem}g" IntervalListToBed \\ + --INPUT ${interval} \\ + --OUTPUT ${prefix}.bed \\ + $args + + cat <<-END_VERSIONS > versions.yml + "${task.process}": + gatk4: \$(echo \$(gatk --version 2>&1) | sed 's/^.*(GATK) v//; s/ .*\$//') + END_VERSIONS + """ +} diff --git a/modules/nf-core/modules/gatk4/intervallisttobed/meta.yml b/modules/nf-core/modules/gatk4/intervallisttobed/meta.yml new file mode 100644 index 0000000000..90b78c057a --- /dev/null +++ b/modules/nf-core/modules/gatk4/intervallisttobed/meta.yml @@ -0,0 +1,41 @@ +name: gatk4_intervallisttobed +keywords: + - interval + - bed +tools: + - gatk4: + description: Genome Analysis Toolkit (GATK4) + homepage: https://gatk.broadinstitute.org/hc/en-us + documentation: https://gatk.broadinstitute.org/hc/en-us/categories/360002369672s + tool_dev_url: https://github.com/broadinstitute/gatk + doi: "10.1158/1538-7445.AM2017-3590" + licence: ["BSD-3-clause"] + +input: + - meta: + type: map + description: | + Groovy Map containing sample information + e.g. [ id:'test', single_end:false ] + - interval: + type: file + description: Interval list + pattern: "*.{interval,interval_list}" + +output: + - meta: + type: map + description: | + Groovy Map containing sample information + e.g. [ id:'test', single_end:false ] + - bed: + type: file + description: BED file + pattern: "*.bed" + - versions: + type: file + description: File containing software versions + pattern: "versions.yml" + +authors: + - "@FriederikeHanssen" diff --git a/modules/nf-core/modules/gatk4/mergemutectstats/main.nf b/modules/nf-core/modules/gatk4/mergemutectstats/main.nf new file mode 100644 index 0000000000..bb9f91fbc2 --- /dev/null +++ b/modules/nf-core/modules/gatk4/mergemutectstats/main.nf @@ -0,0 +1,41 @@ +process GATK4_MERGEMUTECTSTATS { + tag "$meta.id" + label 'process_low' + + conda (params.enable_conda ? "bioconda::gatk4=4.2.5.0" : null) + container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ? + 'https://depot.galaxyproject.org/singularity/gatk4:4.2.5.0--hdfd78af_0' : + 'quay.io/biocontainers/gatk4:4.2.5.0--hdfd78af_0' }" + + input: + tuple val(meta), path(stats) + output: + tuple val(meta), path("*.vcf.gz.stats"), emit: stats + path "versions.yml" , emit: versions + + when: + task.ext.when == null || task.ext.when + + script: + def args = task.ext.args ?: '' + prefix = task.ext.prefix ?: "${meta.id}" + def input = stats.collect{ " -stats ${it} "}.join() + + def avail_mem = 3 + if (!task.memory) { + log.info '[GATK MergeMutectStats] Available memory not known - defaulting to 3GB. Specify process memory requirements to change this.' + } else { + avail_mem = task.memory.giga + } + """ + gatk --java-options "-Xmx${avail_mem}g" MergeMutectStats \\ + ${input} \\ + -output ${meta.id}.vcf.gz.stats \\ + $args + + cat <<-END_VERSIONS > versions.yml + "${task.process}": + gatk4: \$(echo \$(gatk --version 2>&1) | sed 's/^.*(GATK) v//; s/ .*\$//') + END_VERSIONS + """ +} diff --git a/modules/nf-core/modules/gatk4/mergemutectstats/meta.yml b/modules/nf-core/modules/gatk4/mergemutectstats/meta.yml new file mode 100644 index 0000000000..c9950e1400 --- /dev/null +++ b/modules/nf-core/modules/gatk4/mergemutectstats/meta.yml @@ -0,0 +1,42 @@ +name: gatk4_mergemutectstats +description: Merges mutect2 stats generated on different intervals/regions +keywords: + - mutectstats + - merge +tools: + - gatk4: + description: Genome Analysis Toolkit (GATK4) + homepage: https://gatk.broadinstitute.org/hc/en-us + documentation: https://gatk.broadinstitute.org/hc/en-us/categories/360002369672s + tool_dev_url: https://github.com/broadinstitute/gatk + doi: "10.1158/1538-7445.AM2017-3590" + licence: ["BSD-3-clause"] + +input: + - meta: + type: map + description: | + Groovy Map containing sample information + e.g. [ id:'test', single_end:false ] + - stats: + type: (list of) file(s) + description: Stats file + pattern: "*.{stats}" + +output: + - meta: + type: map + description: | + Groovy Map containing sample information + e.g. [ id:'test', single_end:false ] + - versions: + type: file + description: File containing software versions + pattern: "versions.yml" + - stats: + type: file + description: Stats file + pattern: "*.vcf.gz.stats" + +authors: + - "@FriederikeHanssen" diff --git a/modules/nf-core/modules/qualimap/bamqc/main.nf b/modules/nf-core/modules/qualimap/bamqc/main.nf new file mode 100644 index 0000000000..92f38f8c46 --- /dev/null +++ b/modules/nf-core/modules/qualimap/bamqc/main.nf @@ -0,0 +1,55 @@ +process QUALIMAP_BAMQC { + tag "$meta.id" + label 'process_medium' + + conda (params.enable_conda ? "bioconda::qualimap=2.2.2d" : null) + container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ? + 'https://depot.galaxyproject.org/singularity/qualimap:2.2.2d--1' : + 'quay.io/biocontainers/qualimap:2.2.2d--1' }" + + input: + tuple val(meta), path(bam) + path gff + + output: + tuple val(meta), path("${prefix}"), emit: results + path "versions.yml" , emit: versions + + when: + task.ext.when == null || task.ext.when + + script: + def args = task.ext.args ?: '' + prefix = task.ext.prefix ?: "${meta.id}" + + def collect_pairs = meta.single_end ? '' : '--collect-overlap-pairs' + def memory = task.memory.toGiga() + "G" + def regions = gff ? "--gff $gff" : '' + + def strandedness = 'non-strand-specific' + if (meta.strandedness == 'forward') { + strandedness = 'strand-specific-forward' + } else if (meta.strandedness == 'reverse') { + strandedness = 'strand-specific-reverse' + } + """ + unset DISPLAY + mkdir tmp + export _JAVA_OPTIONS=-Djava.io.tmpdir=./tmp + qualimap \\ + --java-mem-size=$memory \\ + bamqc \\ + $args \\ + -bam $bam \\ + $regions \\ + -p $strandedness \\ + $collect_pairs \\ + -outdir $prefix \\ + -nt $task.cpus + + cat <<-END_VERSIONS > versions.yml + "${task.process}": + qualimap: \$(echo \$(qualimap 2>&1) | sed 's/^.*QualiMap v.//; s/Built.*\$//') + END_VERSIONS + """ +} diff --git a/modules/nf-core/modules/qualimap/bamqc/meta.yml b/modules/nf-core/modules/qualimap/bamqc/meta.yml new file mode 100644 index 0000000000..303532eb7c --- /dev/null +++ b/modules/nf-core/modules/qualimap/bamqc/meta.yml @@ -0,0 +1,47 @@ +name: qualimap_bamqc +description: Evaluate alignment data +keywords: + - quality control + - qc + - bam +tools: + - qualimap: + description: | + Qualimap 2 is a platform-independent application written in + Java and R that provides both a Graphical User Interface and + a command-line interface to facilitate the quality control of + alignment sequencing data and its derivatives like feature counts. + homepage: http://qualimap.bioinfo.cipf.es/ + documentation: http://qualimap.conesalab.org/doc_html/index.html + doi: 10.1093/bioinformatics/bts503 + licence: ["GPL-2.0-only"] +input: + - meta: + type: map + description: | + Groovy Map containing sample information + e.g. [ id:'test', single_end:false ] + - bam: + type: file + description: BAM file + pattern: "*.{bam}" + - gff: + type: file + description: Feature file with regions of interest + pattern: "*.{gff,gtf,bed}" +output: + - meta: + type: map + description: | + Groovy Map containing sample information + e.g. [ id:'test', single_end:false ] + - results: + type: dir + description: Qualimap results dir + pattern: "*/*" + - versions: + type: file + description: File containing software versions + pattern: "versions.yml" +authors: + - "@phue" diff --git a/modules/nf-core/modules/qualimap/bamqccram/main.nf b/modules/nf-core/modules/qualimap/bamqccram/main.nf new file mode 100644 index 0000000000..b9a5538dab --- /dev/null +++ b/modules/nf-core/modules/qualimap/bamqccram/main.nf @@ -0,0 +1,60 @@ +process QUALIMAP_BAMQCCRAM { + tag "$meta.id" + label 'process_medium' + + conda (params.enable_conda ? "bioconda::qualimap=2.2.2d bioconda::samtools=1.12" : null) + container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ? + 'https://depot.galaxyproject.org/singularity/mulled-v2-d3934ca6bb4e61334891ffa2e9a4c87a530e3188:4bf11d12f2c3eccf1eb585097c0b6fd31c18c418-0' : + 'quay.io/biocontainers/mulled-v2-d3934ca6bb4e61334891ffa2e9a4c87a530e3188:4bf11d12f2c3eccf1eb585097c0b6fd31c18c418-0' }" + + input: + tuple val(meta), path(cram), path(crai) + path gff + path fasta + path fasta_fai + + output: + tuple val(meta), path("${prefix}"), emit: results + path "versions.yml" , emit: versions + + when: + task.ext.when == null || task.ext.when + + script: + def args = task.ext.args ?: '' + prefix = task.ext.prefix ?: "${meta.id}" + + def collect_pairs = meta.single_end ? '' : '--collect-overlap-pairs' + def memory = task.memory.toGiga() + "G" + def regions = gff ? "--gff $gff" : '' + + def strandedness = 'non-strand-specific' + if (meta.strandedness == 'forward') { + strandedness = 'strand-specific-forward' + } else if (meta.strandedness == 'reverse') { + strandedness = 'strand-specific-reverse' + } + """ + unset DISPLAY + mkdir tmp + export _JAVA_OPTIONS=-Djava.io.tmpdir=./tmp + + samtools view -hb -T ${fasta} ${cram} | + qualimap \\ + --java-mem-size=$memory \\ + bamqc \\ + $args \\ + -bam /dev/stdin \\ + $regions \\ + -p $strandedness \\ + $collect_pairs \\ + -outdir $prefix \\ + -nt $task.cpus + + cat <<-END_VERSIONS > versions.yml + "${task.process}": + qualimap: \$(echo \$(qualimap 2>&1) | sed 's/^.*QualiMap v.//; s/Built.*\$//') + samtools: \$(echo \$(samtools --version 2>&1) | sed 's/^.*samtools //; s/Using.*\$//') + END_VERSIONS + """ +} diff --git a/modules/nf-core/modules/qualimap/bamqccram/meta.yml b/modules/nf-core/modules/qualimap/bamqccram/meta.yml new file mode 100644 index 0000000000..d72f203df6 --- /dev/null +++ b/modules/nf-core/modules/qualimap/bamqccram/meta.yml @@ -0,0 +1,51 @@ +name: qualimap_bamqccram +description: Evaluate alignment data +keywords: + - quality control + - qc + - bam +tools: + - qualimap: + description: | + Qualimap 2 is a platform-independent application written in + Java and R that provides both a Graphical User Interface and + a command-line interface to facilitate the quality control of + alignment sequencing data and its derivatives like feature counts. + homepage: http://qualimap.bioinfo.cipf.es/ + documentation: http://qualimap.conesalab.org/doc_html/index.html + doi: 10.1093/bioinformatics/bts503 + licence: ["GPL-2.0-only"] +input: + - meta: + type: map + description: | + Groovy Map containing sample information + e.g. [ id:'test', single_end:false ] + - bacramm: + type: file + description: BAM file + pattern: "*.{bam}" + - gff: + type: file + description: Feature file with regions of interest + pattern: "*.{gff,gtf,bed}" + - fasta: + type: file + description: Reference file of cram file + pattern: "*.{fasta,fa,fna}" +output: + - meta: + type: map + description: | + Groovy Map containing sample information + e.g. [ id:'test', single_end:false ] + - results: + type: dir + description: Qualimap results dir + pattern: "*/*" + - versions: + type: file + description: File containing software versions + pattern: "versions.yml" +authors: + - "@FriederikeHanssen" diff --git a/subworkflows/local/prepare_intervals.nf b/subworkflows/local/prepare_intervals.nf index 78a552f28a..505516f6ff 100644 --- a/subworkflows/local/prepare_intervals.nf +++ b/subworkflows/local/prepare_intervals.nf @@ -8,7 +8,7 @@ include { BUILD_INTERVALS } from '../../modules/local/build_intervals/main' include { CREATE_INTERVALS_BED } from '../../modules/local/create_intervals_bed/main' -include { GATK4_INTERVALLISTTOBED } from '../../modules/local/gatk4/intervallisttobed' +include { GATK4_INTERVALLISTTOBED } from '../../modules/nf-core/modules/gatk4/intervallisttobed/main' include { TABIX_BGZIPTABIX as TABIX_BGZIPTABIX_INTERVAL_SPLIT } from '../../modules/nf-core/modules/tabix/bgziptabix/main' include { TABIX_BGZIPTABIX as TABIX_BGZIPTABIX_INTERVAL_ALL } from '../../modules/nf-core/modules/tabix/bgziptabix/main' diff --git a/subworkflows/nf-core/gatk4_mapping/main.nf b/subworkflows/nf-core/gatk4_mapping/main.nf index 0420b60976..027d571b72 100644 --- a/subworkflows/nf-core/gatk4_mapping/main.nf +++ b/subworkflows/nf-core/gatk4_mapping/main.nf @@ -31,7 +31,6 @@ workflow GATK4_MAPPING { new_meta.remove('size') new_meta.id = meta.sample - println meta // groupKey is to makes sure that the correct group can advance as soon as it is complete // and not stall the workflow until all reads from all channels are mapped def groupKey = groupKey(new_meta, meta.numLanes * meta.size) @@ -40,7 +39,6 @@ workflow GATK4_MAPPING { tuple(groupKey, new_meta, bam) }.groupTuple(by:[0,1]).map{ groupKey, new_meta, bam -> [new_meta, bam] } - bam_mapped.view() // gatk4 markduplicates can handle multiple bams as input, so no need to merge/index here // Except if and only if skipping markduplicates or saving mapped bams diff --git a/subworkflows/nf-core/gatk_tumor_normal_somatic_variant_calling/main.nf b/subworkflows/nf-core/gatk_tumor_normal_somatic_variant_calling/main.nf index 6866a6d707..a211c74dba 100644 --- a/subworkflows/nf-core/gatk_tumor_normal_somatic_variant_calling/main.nf +++ b/subworkflows/nf-core/gatk_tumor_normal_somatic_variant_calling/main.nf @@ -3,13 +3,13 @@ // include { BGZIP as BGZIP_MUTECT2 } from '../../../modules/local/bgzip' -include { CONCAT_VCF as CONCAT_VCF_MUTECT2 } from '../../../modules/local/concat_vcf/main' +include { CONCAT_VCF as CONCAT_MUTECT2 } from '../../../modules/local/concat_vcf/main' include { GATK4_MUTECT2 as MUTECT2 } from '../../../modules/nf-core/modules/gatk4/mutect2/main' -include { GATK4_MERGEMUTECTSTATS as MERGEMUTECTSTATS } from '../../../modules/local/gatk4/mergemutectstats' +include { GATK4_MERGEMUTECTSTATS as MERGEMUTECTSTATS } from '../../../modules/nf-core/modules/gatk4/mergemutectstats/main' include { GATK4_LEARNREADORIENTATIONMODEL as LEARNREADORIENTATIONMODEL } from '../../../modules/nf-core/modules/gatk4/learnreadorientationmodel/main' -include { GATK4_GATHERPILEUPSUMMARIES as GATHERPILEUPSUMMARIES_TUMOR } from '../../../modules/local/gatk4/gatherpileupsummaries' -include { GATK4_GATHERPILEUPSUMMARIES as GATHERPILEUPSUMMARIES_NORMAL} from '../../../modules/local/gatk4/gatherpileupsummaries' +include { GATK4_GATHERPILEUPSUMMARIES as GATHERPILEUPSUMMARIES_TUMOR } from '../../../modules/nf-core/modules/gatk4/gatherpileupsummaries/main' +include { GATK4_GATHERPILEUPSUMMARIES as GATHERPILEUPSUMMARIES_NORMAL} from '../../../modules/nf-core/modules/gatk4/gatherpileupsummaries/main' include { GATK4_GETPILEUPSUMMARIES as GETPILEUPSUMMARIES_TUMOR } from '../../../modules/nf-core/modules/gatk4/getpileupsummaries/main' include { GATK4_GETPILEUPSUMMARIES as GETPILEUPSUMMARIES_NORMAL } from '../../../modules/nf-core/modules/gatk4/getpileupsummaries/main' include { GATK4_CALCULATECONTAMINATION as CALCULATECONTAMINATION } from '../../../modules/nf-core/modules/gatk4/calculatecontamination/main' diff --git a/subworkflows/nf-core/gatk_tumor_only_somatic_variant_calling/main.nf b/subworkflows/nf-core/gatk_tumor_only_somatic_variant_calling/main.nf index 98c0f46d1d..c8d81f02fe 100644 --- a/subworkflows/nf-core/gatk_tumor_only_somatic_variant_calling/main.nf +++ b/subworkflows/nf-core/gatk_tumor_only_somatic_variant_calling/main.nf @@ -3,12 +3,12 @@ // include { BGZIP as BGZIP_MUTECT2 } from '../../../modules/local/bgzip' -include { CONCAT_VCF as CONCAT_VCF_MUTECT2 } from '../../../modules/local/concat_vcf/main' +include { CONCAT_VCF as CONCAT_MUTECT2 } from '../../../modules/local/concat_vcf/main' include { GATK4_MUTECT2 as MUTECT2 } from '../../../modules/nf-core/modules/gatk4/mutect2/main' -include { GATK4_MERGEMUTECTSTATS as MERGEMUTECTSTATS } from '../../../modules/local/gatk4/mergemutectstats' +include { GATK4_MERGEMUTECTSTATS as MERGEMUTECTSTATS } from '../../../modules/nf-core/modules/gatk4/mergemutectstats/main' include { GATK4_GETPILEUPSUMMARIES as GETPILEUPSUMMARIES } from '../../../modules/nf-core/modules/gatk4/getpileupsummaries/main' -include { GATK4_GATHERPILEUPSUMMARIES as GATHERPILEUPSUMMARIES } from '../../../modules/local/gatk4/gatherpileupsummaries' +include { GATK4_GATHERPILEUPSUMMARIES as GATHERPILEUPSUMMARIES } from '../../../modules/nf-core/modules/gatk4/gatherpileupsummaries/main' include { GATK4_CALCULATECONTAMINATION as CALCULATECONTAMINATION } from '../../../modules/nf-core/modules/gatk4/calculatecontamination/main' include { GATK4_FILTERMUTECTCALLS as FILTERMUTECTCALLS } from '../../../modules/nf-core/modules/gatk4/filtermutectcalls/main' diff --git a/subworkflows/nf-core/markduplicates.nf b/subworkflows/nf-core/markduplicates.nf index 33b9238c8c..118da59bea 100644 --- a/subworkflows/nf-core/markduplicates.nf +++ b/subworkflows/nf-core/markduplicates.nf @@ -8,7 +8,7 @@ include { DEEPTOOLS_BAMCOVERAGE } from '../.. include { GATK4_ESTIMATELIBRARYCOMPLEXITY } from '../../modules/nf-core/modules/gatk4/estimatelibrarycomplexity/main' include { GATK4_MARKDUPLICATES } from '../../modules/nf-core/modules/gatk4/markduplicates/main' include { GATK4_MARKDUPLICATES_SPARK } from '../../modules/local/gatk4/markduplicatesspark/main' -include { QUALIMAP_BAMQC } from '../../modules/local/qualimap/bamqc/main' +include { QUALIMAP_BAMQC } from '../../modules/nf-core/modules/qualimap/bamqc/main' include { SAMTOOLS_INDEX as INDEX_MARKDUPLICATES } from '../../modules/local/samtools/index/main' include { SAMTOOLS_STATS } from '../../modules/nf-core/modules/samtools/stats/main' include { SAMTOOLS_VIEWINDEX as SAMTOOLS_BAM_TO_CRAM_DUPLICATES } from '../../modules/local/samtools/viewindex/main' @@ -58,7 +58,7 @@ workflow MARKDUPLICATES { // When running Marduplicates spark, and saving reports GATK4_ESTIMATELIBRARYCOMPLEXITY(bam_mapped, fasta, fasta_fai, dict) // Reports on Marduplicates spark bam output or on bam input - QUALIMAP_BAMQC(bam_indexed.mix(GATK4_MARKDUPLICATES.out.bam.join(GATK4_MARKDUPLICATES.out.bai)), intervals_combined_bed_gz_tbi) + QUALIMAP_BAMQC(bam_mapped.mix(GATK4_MARKDUPLICATES.out.bam), intervals_combined_bed_gz_tbi) DEEPTOOLS_BAMCOVERAGE(bam_indexed.mix(GATK4_MARKDUPLICATES.out.bam.join(GATK4_MARKDUPLICATES.out.bai))) // Other reports run on cram SAMTOOLS_STATS(cram_markduplicates, fasta) diff --git a/subworkflows/nf-core/recalibrate.nf b/subworkflows/nf-core/recalibrate.nf index 0806f0a156..fa0b6870a7 100644 --- a/subworkflows/nf-core/recalibrate.nf +++ b/subworkflows/nf-core/recalibrate.nf @@ -6,7 +6,7 @@ include { GATK4_APPLYBQSR as APPLYBQSR } from '../../modules/nf-core/modules/gatk4/applybqsr/main' include { GATK4_APPLYBQSR_SPARK as APPLYBQSR_SPARK } from '../../modules/local/gatk4/applybqsrspark/main' -include { QUALIMAP_BAMQC_CRAM } from '../../modules/local/qualimap/bamqccram/main' +include { QUALIMAP_BAMQCCRAM } from '../../modules/nf-core/modules/qualimap/bamqccram/main' include { SAMTOOLS_INDEX as INDEX_RECALIBRATE } from '../../modules/local/samtools/index/main' include { SAMTOOLS_MERGE_CRAM } from '../../modules/local/samtools/mergecram/main' include { SAMTOOLS_STATS } from '../../modules/nf-core/modules/samtools/stats/main' @@ -55,18 +55,18 @@ workflow RECALIBRATE { INDEX_RECALIBRATE(cram_recalibrated_no_intervals.mix(SAMTOOLS_MERGE_CRAM.out.cram)) // Reports on recalibrated cram - QUALIMAP_BAMQC_CRAM(INDEX_RECALIBRATE.out.cram_crai, intervals_combined_bed_gz_tbi, fasta, fasta_fai) + QUALIMAP_BAMQCCRAM(INDEX_RECALIBRATE.out.cram_crai, intervals_combined_bed_gz_tbi, fasta, fasta_fai) SAMTOOLS_STATS(INDEX_RECALIBRATE.out.cram_crai, fasta) // Gather all reports generated qc_reports = qc_reports.mix(SAMTOOLS_STATS.out.stats) - qc_reports = qc_reports.mix(QUALIMAP_BAMQC_CRAM.out.results) + qc_reports = qc_reports.mix(QUALIMAP_BAMQCCRAM.out.results) // Gather versions of all tools used ch_versions = ch_versions.mix(APPLYBQSR.out.versions) ch_versions = ch_versions.mix(APPLYBQSR_SPARK.out.versions) ch_versions = ch_versions.mix(INDEX_RECALIBRATE.out.versions) - ch_versions = ch_versions.mix(QUALIMAP_BAMQC_CRAM.out.versions) + ch_versions = ch_versions.mix(QUALIMAP_BAMQCCRAM.out.versions) ch_versions = ch_versions.mix(SAMTOOLS_MERGE_CRAM.out.versions) ch_versions = ch_versions.mix(SAMTOOLS_STATS.out.versions) From 1312f6127575092dd07167da9dc03b92735c31d2 Mon Sep 17 00:00:00 2001 From: Rike Date: Mon, 28 Feb 2022 23:42:10 +0100 Subject: [PATCH 05/10] update modules --- modules.json | 7 +++++-- modules/nf-core/modules/bwa/mem/main.nf | 6 +++--- modules/nf-core/modules/bwamem2/mem/main.nf | 6 +++--- modules/nf-core/modules/qualimap/bamqccram/main.nf | 6 +++--- 4 files changed, 14 insertions(+), 11 deletions(-) diff --git a/modules.json b/modules.json index 23995b92c7..93549e8acb 100644 --- a/modules.json +++ b/modules.json @@ -10,13 +10,13 @@ "git_sha": "e745e167c1020928ef20ea1397b6b4d230681b4d" }, "bwa/mem": { - "git_sha": "e745e167c1020928ef20ea1397b6b4d230681b4d" + "git_sha": "950700bcdc0e9a2b6883d40d2c51c6fc435cd714" }, "bwamem2/index": { "git_sha": "e745e167c1020928ef20ea1397b6b4d230681b4d" }, "bwamem2/mem": { - "git_sha": "e745e167c1020928ef20ea1397b6b4d230681b4d" + "git_sha": "950700bcdc0e9a2b6883d40d2c51c6fc435cd714" }, "cat/fastq": { "git_sha": "e745e167c1020928ef20ea1397b6b4d230681b4d" @@ -129,6 +129,9 @@ "qualimap/bamqc": { "git_sha": "e31f1ff3b1375b30db08637d8937e25cc046f3cc" }, + "qualimap/bamqccram": { + "git_sha": "950700bcdc0e9a2b6883d40d2c51c6fc435cd714" + }, "samblaster": { "git_sha": "e745e167c1020928ef20ea1397b6b4d230681b4d" }, diff --git a/modules/nf-core/modules/bwa/mem/main.nf b/modules/nf-core/modules/bwa/mem/main.nf index 9a91c77f2d..27ea6f42e5 100644 --- a/modules/nf-core/modules/bwa/mem/main.nf +++ b/modules/nf-core/modules/bwa/mem/main.nf @@ -2,10 +2,10 @@ process BWA_MEM { tag "$meta.id" label 'process_high' - conda (params.enable_conda ? "bioconda::bwa=0.7.17 bioconda::samtools=1.12" : null) + conda (params.enable_conda ? "bioconda::bwa=0.7.17 bioconda::samtools=1.15" : null) container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ? - 'https://depot.galaxyproject.org/singularity/mulled-v2-fe8faa35dbf6dc65a0f7f5d4ea12e31a79f73e40:66ed1b38d280722529bb8a0167b0cf02f8a0b488-0' : - 'quay.io/biocontainers/mulled-v2-fe8faa35dbf6dc65a0f7f5d4ea12e31a79f73e40:66ed1b38d280722529bb8a0167b0cf02f8a0b488-0' }" + 'https://depot.galaxyproject.org/singularity/mulled-v2-fe8faa35dbf6dc65a0f7f5d4ea12e31a79f73e40:c56a3aabc8d64e52d5b9da1e8ecec2031668596d-0' : + 'quay.io/biocontainers/mulled-v2-fe8faa35dbf6dc65a0f7f5d4ea12e31a79f73e40:c56a3aabc8d64e52d5b9da1e8ecec2031668596d-0' }" input: tuple val(meta), path(reads) diff --git a/modules/nf-core/modules/bwamem2/mem/main.nf b/modules/nf-core/modules/bwamem2/mem/main.nf index 56f595ec6c..21dfb1d614 100644 --- a/modules/nf-core/modules/bwamem2/mem/main.nf +++ b/modules/nf-core/modules/bwamem2/mem/main.nf @@ -2,10 +2,10 @@ process BWAMEM2_MEM { tag "$meta.id" label 'process_high' - conda (params.enable_conda ? "bioconda::bwa-mem2=2.2.1 bioconda::samtools=1.12" : null) + conda (params.enable_conda ? "bioconda::bwa-mem2=2.2.1 bioconda::samtools=1.15" : null) container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ? - 'https://depot.galaxyproject.org/singularity/mulled-v2-e5d375990341c5aef3c9aff74f96f66f65375ef6:cf603b12db30ec91daa04ba45a8ee0f35bbcd1e2-0' : - 'quay.io/biocontainers/mulled-v2-e5d375990341c5aef3c9aff74f96f66f65375ef6:cf603b12db30ec91daa04ba45a8ee0f35bbcd1e2-0' }" + 'https://depot.galaxyproject.org/singularity/mulled-v2-e5d375990341c5aef3c9aff74f96f66f65375ef6:8ee25ae85d7a2bacac3e3139db209aff3d605a18-0' : + 'quay.io/biocontainers/mulled-v2-e5d375990341c5aef3c9aff74f96f66f65375ef6:8ee25ae85d7a2bacac3e3139db209aff3d605a18-0' }" input: tuple val(meta), path(reads) diff --git a/modules/nf-core/modules/qualimap/bamqccram/main.nf b/modules/nf-core/modules/qualimap/bamqccram/main.nf index b9a5538dab..ab3fd51a17 100644 --- a/modules/nf-core/modules/qualimap/bamqccram/main.nf +++ b/modules/nf-core/modules/qualimap/bamqccram/main.nf @@ -2,10 +2,10 @@ process QUALIMAP_BAMQCCRAM { tag "$meta.id" label 'process_medium' - conda (params.enable_conda ? "bioconda::qualimap=2.2.2d bioconda::samtools=1.12" : null) + conda (params.enable_conda ? "bioconda::qualimap=2.2.2d bioconda::samtools=1.15" : null) container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ? - 'https://depot.galaxyproject.org/singularity/mulled-v2-d3934ca6bb4e61334891ffa2e9a4c87a530e3188:4bf11d12f2c3eccf1eb585097c0b6fd31c18c418-0' : - 'quay.io/biocontainers/mulled-v2-d3934ca6bb4e61334891ffa2e9a4c87a530e3188:4bf11d12f2c3eccf1eb585097c0b6fd31c18c418-0' }" + 'https://depot.galaxyproject.org/singularity/mulled-v2-d3934ca6bb4e61334891ffa2e9a4c87a530e3188:9838874d42d4477d5042782ee019cec9854da7d5-0' : + 'quay.io/biocontainers/mulled-v2-d3934ca6bb4e61334891ffa2e9a4c87a530e3188:9838874d42d4477d5042782ee019cec9854da7d5-0' }" input: tuple val(meta), path(cram), path(crai) From 6a798a07a15b36776b150d8d6422001e7257bd21 Mon Sep 17 00:00:00 2001 From: Rike Date: Tue, 1 Mar 2022 21:12:04 +0100 Subject: [PATCH 06/10] remove local msisensorpro --- modules/local/msisensorpro/msi/main.nf | 46 ------------------- modules/local/msisensorpro/msi/meta.yml | 58 ------------------------ modules/local/msisensorpro/scan/main.nf | 34 -------------- modules/local/msisensorpro/scan/meta.yml | 32 ------------- 4 files changed, 170 deletions(-) delete mode 100644 modules/local/msisensorpro/msi/main.nf delete mode 100644 modules/local/msisensorpro/msi/meta.yml delete mode 100644 modules/local/msisensorpro/scan/main.nf delete mode 100644 modules/local/msisensorpro/scan/meta.yml diff --git a/modules/local/msisensorpro/msi/main.nf b/modules/local/msisensorpro/msi/main.nf deleted file mode 100644 index 2307e08829..0000000000 --- a/modules/local/msisensorpro/msi/main.nf +++ /dev/null @@ -1,46 +0,0 @@ -process MSISENSORPRO_MSI { - tag "$meta.id" - label 'process_high' - - conda (params.enable_conda ? "bioconda::msisensor-pro=1.1.a" : null) - container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ? - 'https://depot.galaxyproject.org/singularity/msisensor-pro:1.1.a--hb3646a4_0' : - 'quay.io/biocontainers/msisensor-pro:1.1.a--hb3646a4_0' }" - - input: - tuple val(meta), path(cram_normal), path(crai_normal), path(cram_tumor), path(crai_tumor) - path msisensorpro_scan - - output: - tuple val(meta), path("${prefix}.list") , emit: output - tuple val(meta), path("${prefix}_dis.list") , emit: output_dis - tuple val(meta), path("${prefix}_germline.list"), emit: output_germline - tuple val(meta), path("${prefix}_somatic.list") , emit: output_somatic - path "versions.yml" , emit: versions - - when: - task.ext.when == null || task.ext.when - - script: - def args = task.ext.args ?: '' - prefix = task.ext.suffix ? "${meta.id}${task.ext.suffix}" : "${meta.id}" - """ - msisensor-pro msi \\ - -d $msisensorpro_scan \\ - -n $bam_normal \\ - -t $bam_tumor \\ - -o $prefix \\ - -b $task.cpus \\ - $args - - mv ${prefix} ${prefix}.list - mv ${prefix}_dis ${prefix}_dis.list - mv ${prefix}_germline ${prefix}_germline.list - mv ${prefix}_somatic ${prefix}_somatic.list - - cat <<-END_VERSIONS > versions.yml - "${task.process}": - msisensor-pro: \$(msisensor-pro 2>&1 | sed -nE 's/Version:\\sv([0-9]\\.[0-9])/\\1/ p') - END_VERSIONS - """ -} diff --git a/modules/local/msisensorpro/msi/meta.yml b/modules/local/msisensorpro/msi/meta.yml deleted file mode 100644 index e1d2220c67..0000000000 --- a/modules/local/msisensorpro/msi/meta.yml +++ /dev/null @@ -1,58 +0,0 @@ -name: msisensorpro_msi - -description: evaluate MSI using paired tumor-normal sequencing data -keywords: - - microsatellite -tools: - - msisensor: - description: MSIsensor-pro is an updated version of msisensor - homepage: https://github.com/xjtu-omics/msisensor-pro - documentation: None - tool_dev_url: None - doi: "doi.org/10.1016/j.gpb.2020.02.001" - licence: ['free for non-commercial use by academic, government, and non-profit/not-for-profit institutions'] - -input: - - meta: - type: map - description: | - Groovy Map containing sample information - e.g. [ id:'test', single_end:false ] - - bam_normal: - type: file - description: | - BAM file from normal tissue - - bai_normal: - type: file - description: | - Index for the BAM file from normal tissue - - bam_tumor: - type: file - description: | - BAM file from tumor tissue - - bai_tumor: - type: file - description: | - Index for the BAM file from tumor tissue - - msisensor_scan: - type: file - description: | - Output file from msisensor-pro scan module - -output: - - meta: - type: map - description: | - Groovy Map containing sample information - e.g. [ id:'test', single_end:false ] - - list: - type: file - description: | - msisensor-pro final report and associated files (dis, germline, somatic) - - version: - type: file - description: File containing software version - pattern: "*.{version.txt}" - -authors: - - "@maxulysse" diff --git a/modules/local/msisensorpro/scan/main.nf b/modules/local/msisensorpro/scan/main.nf deleted file mode 100644 index 0e74fec279..0000000000 --- a/modules/local/msisensorpro/scan/main.nf +++ /dev/null @@ -1,34 +0,0 @@ -process MSISENSORPRO_SCAN { - tag "$fasta" - label 'process_low' - - conda (params.enable_conda ? "bioconda::msisensor-pro=1.1.a" : null) - container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ? - 'https://depot.galaxyproject.org/singularity/msisensor-pro:1.1.a--hb3646a4_0' : - 'quay.io/biocontainers/msisensor-pro:1.1.a--hb3646a4_0' }" - - input: - path fasta - - output: - tuple val(meta), path("*.list"), emit: list - path "versions.yml" , emit: versions - - when: - task.ext.when == null || task.ext.when - - script: - def args = task.ext.args ?: '' - def prefix = task.ext.suffix ? "${meta.id}${task.ext.suffix}" : "${meta.id}" - """ - msisensor-pro scan \\ - -d $fasta \\ - -o ${fasta.baseName}.list \\ - $args - - cat <<-END_VERSIONS > versions.yml - "${task.process}": - msisensor-pro: \$(msisensor-pro 2>&1 | sed -nE 's/Version:\\sv([0-9]\\.[0-9])/\\1/ p') - END_VERSIONS - """ -} diff --git a/modules/local/msisensorpro/scan/meta.yml b/modules/local/msisensorpro/scan/meta.yml deleted file mode 100644 index 5e9261aadb..0000000000 --- a/modules/local/msisensorpro/scan/meta.yml +++ /dev/null @@ -1,32 +0,0 @@ -name: msisensorpro_scan - -description: Scan the reference genome to get microsatellites information -keywords: - - microsatellite -tools: - - msisensor: - description: MSIsensor-pro is an updated version of msisensor - homepage: https://github.com/xjtu-omics/msisensor-pro - documentation: None - tool_dev_url: None - doi: "doi.org/10.1016/j.gpb.2020.02.001" - licence: ['free for non-commercial use by academic, government, and non-profit/not-for-profit institutions'] - -input: - - fasta: - type: file - description: FASTA file - pattern: "*.{fa,fasta}" - -output: - - list: - type: file - description: MSIsensor-pro scan output file of minisatellites - pattern: "*.list" - - version: - type: file - description: File containing software version - pattern: "*.{version.txt}" - -authors: - - "@maxulysse" From dc7fbfc472fefcf2c18aaf06836bec1c6299fd9b Mon Sep 17 00:00:00 2001 From: Rike Date: Tue, 1 Mar 2022 21:24:11 +0100 Subject: [PATCH 07/10] remove unused local modules, replaced by nf-core/modules --- modules/local/index_target_bed/main.nf | 25 ------------------------- 1 file changed, 25 deletions(-) delete mode 100644 modules/local/index_target_bed/main.nf diff --git a/modules/local/index_target_bed/main.nf b/modules/local/index_target_bed/main.nf deleted file mode 100644 index 1388e62de8..0000000000 --- a/modules/local/index_target_bed/main.nf +++ /dev/null @@ -1,25 +0,0 @@ -process INDEX_TARGET_BED { - tag "$target_bed" - label 'process_medium' - - conda (params.enable_conda ? "bioconda::bcftools=1.12" : null) - //TODO: No singularity container at the moment, use docker container for the moment - container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ? - 'quay.io/biocontainers/bcftools:1.12--h45bccc9_1' : - 'quay.io/biocontainers/bcftools:1.12--h45bccc9_1' }" - - input: - path target_bed - - output: - tuple path("*.gz"), path("*.gz.tbi"), emit: gz_tbi - - when: - task.ext.when == null || task.ext.when - - script: - """ - bgzip --threads ${task.cpus} -c ${target_bed} > ${target_bed}.gz - tabix ${target_bed}.gz - """ -} From 3e82649129f0506d44cd0cb6312525c0827dcba8 Mon Sep 17 00:00:00 2001 From: Rike Date: Tue, 1 Mar 2022 21:25:09 +0100 Subject: [PATCH 08/10] remove unused local modules, replaced by nf-core/modules --- modules/local/gatk4/gatherpileupsummaries.nf | 46 ---------------- modules/local/gatk4/intervallisttobed.nf | 41 -------------- modules/local/gatk4/mergemutectstats.nf | 43 --------------- modules/local/qualimap/bamqc/main.nf | 53 ------------------ modules/local/qualimap/bamqc/meta.yml | 50 ----------------- modules/local/qualimap/bamqccram/main.nf | 57 -------------------- modules/local/qualimap/bamqccram/meta.yml | 49 ----------------- 7 files changed, 339 deletions(-) delete mode 100644 modules/local/gatk4/gatherpileupsummaries.nf delete mode 100644 modules/local/gatk4/intervallisttobed.nf delete mode 100644 modules/local/gatk4/mergemutectstats.nf delete mode 100644 modules/local/qualimap/bamqc/main.nf delete mode 100644 modules/local/qualimap/bamqc/meta.yml delete mode 100644 modules/local/qualimap/bamqccram/main.nf delete mode 100644 modules/local/qualimap/bamqccram/meta.yml diff --git a/modules/local/gatk4/gatherpileupsummaries.nf b/modules/local/gatk4/gatherpileupsummaries.nf deleted file mode 100644 index d126c30381..0000000000 --- a/modules/local/gatk4/gatherpileupsummaries.nf +++ /dev/null @@ -1,46 +0,0 @@ - -process GATK4_GATHERPILEUPSUMMARIES { - tag "$meta.id" - label 'process_low' - - conda (params.enable_conda ? "bioconda::gatk4=4.2.4.1" : null) - container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ? - 'https://depot.galaxyproject.org/singularity/gatk4:4.2.4.1--hdfd78af_0': - 'quay.io/biocontainers/gatk4:4.2.4.1--hdfd78af_0' }" - - - input: - tuple val(meta), path(pileup) - path dict - - output: - tuple val(meta), path("*.table"), emit: table - path "versions.yml" , emit: versions - - when: - task.ext.when == null || task.ext.when - - script: - def args = task.ext.args ?: '' - def prefix = task.ext.prefix ?: "${meta.id}" - def input = pileup.collect{ "-I ${it} " }.join(' ') - - def avail_mem = 3 - if (!task.memory) { - log.info '[GATK GatherPileupSummaries] Available memory not known - defaulting to 3GB. Specify process memory requirements to change this.' - } else { - avail_mem = task.memory.giga - } - """ - gatk --java-options "-Xmx${avail_mem}g" \ - GatherPileupSummaries \ - --sequence-dictionary ${dict} \ - ${input} \ - -O ${prefix}.pileupsummaries.table - - cat <<-END_VERSIONS > versions.yml - "${task.process}": - gatk4: \$(echo \$(gatk --version 2>&1) | sed 's/^.*(GATK) v//; s/ .*\$//') - END_VERSIONS - """ -} diff --git a/modules/local/gatk4/intervallisttobed.nf b/modules/local/gatk4/intervallisttobed.nf deleted file mode 100644 index 31e138c310..0000000000 --- a/modules/local/gatk4/intervallisttobed.nf +++ /dev/null @@ -1,41 +0,0 @@ -process GATK4_INTERVALLISTTOBED { - tag "$meta.id" - label 'process_low' - - conda (params.enable_conda ? "bioconda::gatk4=4.2.4.1" : null) - container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ? - 'https://depot.galaxyproject.org/singularity/gatk4:4.2.4.1--hdfd78af_0': - 'quay.io/biocontainers/gatk4:4.2.4.1--hdfd78af_0' }" - - input: - tuple val(meta), path(interval) - - output: - tuple val(meta), path("*.bed"), emit: bed - path "versions.yml" , emit: versions - - when: - task.ext.when == null || task.ext.when - - script: - def args = task.ext.args ?: '' - def prefix = task.ext.prefix ?: "${meta.id}" - - def avail_mem = 3 - if (!task.memory) { - log.info '[GATK IntervalListToBed] Available memory not known - defaulting to 3GB. Specify process memory requirements to change this.' - } else { - avail_mem = task.memory.giga - } - """ - gatk --java-options "-Xmx${avail_mem}g" IntervalListToBed \\ - --INPUT ${interval} \\ - --OUTPUT ${meta.id}.bed \\ - $args - - cat <<-END_VERSIONS > versions.yml - "${task.process}": - gatk4: \$(echo \$(gatk --version 2>&1) | sed 's/^.*(GATK) v//; s/ .*\$//') - END_VERSIONS - """ -} diff --git a/modules/local/gatk4/mergemutectstats.nf b/modules/local/gatk4/mergemutectstats.nf deleted file mode 100644 index 4a54972a2e..0000000000 --- a/modules/local/gatk4/mergemutectstats.nf +++ /dev/null @@ -1,43 +0,0 @@ -process GATK4_MERGEMUTECTSTATS { - tag "$meta.id" - label 'process_low' - - conda (params.enable_conda ? "bioconda::gatk4=4.2.4.1" : null) - container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ? - 'https://depot.galaxyproject.org/singularity/gatk4:4.2.4.1--hdfd78af_0': - 'quay.io/biocontainers/gatk4:4.2.4.1--hdfd78af_0' }" - - input: - tuple val(meta), path(stats) - - - output: - tuple val(meta), path("*.stats"), emit: stats - path "versions.yml" , emit: versions - - when: - task.ext.when == null || task.ext.when - - script: - def args = task.ext.args ?: '' - prefix = task.ext.prefix ?: "${meta.id}" - def input = stats.collect{ " -stats ${it} "}.join() - - def avail_mem = 3 - if (!task.memory) { - log.info '[GATK MergeMutectStats] Available memory not known - defaulting to 3GB. Specify process memory requirements to change this.' - } else { - avail_mem = task.memory.giga - } - """ - gatk --java-options "-Xmx${avail_mem}g" MergeMutectStats \\ - ${input} \\ - -output ${meta.id}.vcf.gz.stats \\ - $args - - cat <<-END_VERSIONS > versions.yml - "${task.process}": - gatk4: \$(echo \$(gatk --version 2>&1) | sed 's/^.*(GATK) v//; s/ .*\$//') - END_VERSIONS - """ -} diff --git a/modules/local/qualimap/bamqc/main.nf b/modules/local/qualimap/bamqc/main.nf deleted file mode 100644 index a24b82d770..0000000000 --- a/modules/local/qualimap/bamqc/main.nf +++ /dev/null @@ -1,53 +0,0 @@ -process QUALIMAP_BAMQC { - tag "$meta.id" - label 'process_medium' - - conda (params.enable_conda ? "bioconda::qualimap=2.2.2d" : null) - container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ? - 'https://depot.galaxyproject.org/singularity/qualimap:2.2.2d--1' : - 'quay.io/biocontainers/qualimap:2.2.2d--1' }" - - input: - tuple val(meta), path(bam), path(index) - path gff - - output: - tuple val(meta), path("${prefix}"), emit: results - path "versions.yml" , emit: versions - - when: - task.ext.when == null || task.ext.when - - script: - def args = task.ext.args ?: '' - prefix = task.ext.prefix ?: "${meta.id}" - def collect_pairs = meta.single_end ? '' : '--collect-overlap-pairs' - def memory = task.memory.toGiga() + "G" - def regions = gff ? "--gff $gff" : '' - def strandedness = 'non-strand-specific' - if (meta.strandedness == 'forward') { - strandedness = 'strand-specific-forward' - } else if (meta.strandedness == 'reverse') { - strandedness = 'strand-specific-reverse' - } - """ - unset DISPLAY - mkdir tmp - export _JAVA_OPTIONS=-Djava.io.tmpdir=./tmp - qualimap \\ - --java-mem-size=$memory \\ - bamqc \\ - $args \\ - -bam $bam \\ - $regions \\ - -p $strandedness \\ - $collect_pairs \\ - -outdir $prefix \\ - -nt $task.cpus - - cat <<-END_VERSIONS > versions.yml - "${task.process}": - qualimap: \$(echo \$(qualimap 2>&1) | sed 's/^.*QualiMap v.//; s/Built.*\$//') - END_VERSIONS - """ -} diff --git a/modules/local/qualimap/bamqc/meta.yml b/modules/local/qualimap/bamqc/meta.yml deleted file mode 100644 index 6888d30e8d..0000000000 --- a/modules/local/qualimap/bamqc/meta.yml +++ /dev/null @@ -1,50 +0,0 @@ -name: qualimap_bamqc -description: Evaluate alignment data -keywords: - - quality control - - qc - - bam -tools: - - qualimap: - description: | - Qualimap 2 is a platform-independent application written in - Java and R that provides both a Graphical User Interface and - a command-line interface to facilitate the quality control of - alignment sequencing data and its derivatives like feature counts. - homepage: http://qualimap.bioinfo.cipf.es/ - documentation: http://qualimap.conesalab.org/doc_html/index.html - doi: 10.1093/bioinformatics/bts503 - licence: ['GPL-2.0-only'] -input: - - meta: - type: map - description: | - Groovy Map containing sample information - e.g. [ id:'test', single_end:false ] - - bam: - type: file - description: BAM file - pattern: "*.{bam}" - - gff: - type: file - description: Feature file with regions of interest - pattern: "*.{gff,gtf,bed}" - - use_gff: - type: boolean - description: Specifies if feature file should be used or not -output: - - meta: - type: map - description: | - Groovy Map containing sample information - e.g. [ id:'test', single_end:false ] - - results: - type: dir - description: Qualimap results dir - pattern: "*/*" - - versions: - type: file - description: File containing software versions - pattern: "versions.yml" -authors: - - "@phue" diff --git a/modules/local/qualimap/bamqccram/main.nf b/modules/local/qualimap/bamqccram/main.nf deleted file mode 100644 index cac9ddeda5..0000000000 --- a/modules/local/qualimap/bamqccram/main.nf +++ /dev/null @@ -1,57 +0,0 @@ -process QUALIMAP_BAMQC_CRAM { - tag "$meta.id" - label 'process_medium' - - conda (params.enable_conda ? "bioconda::qualimap=2.2.2d bioconda::samtools=1.12" : null) - container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ? - 'https://depot.galaxyproject.org/singularity/mulled-v2-d3934ca6bb4e61334891ffa2e9a4c87a530e3188:4bf11d12f2c3eccf1eb585097c0b6fd31c18c418-0' : - 'quay.io/biocontainers/mulled-v2-d3934ca6bb4e61334891ffa2e9a4c87a530e3188:4bf11d12f2c3eccf1eb585097c0b6fd31c18c418-0' }" - - input: - tuple val(meta), path(cram), path(crai) - path gff - path fasta - path fasta_fai - - output: - tuple val(meta), path("${prefix}"), emit: results - path "versions.yml" , emit: versions - - when: - task.ext.when == null || task.ext.when - - script: - def args = task.ext.args ?: '' - prefix = task.ext.prefix ?: "${meta.id}" - def collect_pairs = meta.single_end ? '' : '--collect-overlap-pairs' - def memory = task.memory.toGiga() + "G" - def regions = gff ? "--gff $gff" : '' - def strandedness = 'non-strand-specific' - if (meta.strandedness == 'forward') { - strandedness = 'strand-specific-forward' - } else if (meta.strandedness == 'reverse') { - strandedness = 'strand-specific-reverse' - } - """ - unset DISPLAY - mkdir tmp - export _JAVA_OPTIONS=-Djava.io.tmpdir=./tmp - - samtools view -hb -T ${fasta} ${cram} | - qualimap \\ - --java-mem-size=$memory \\ - bamqc \\ - $args \\ - -bam /dev/stdin \\ - $regions \\ - -p $strandedness \\ - $collect_pairs \\ - -outdir $prefix \\ - -nt $task.cpus - - cat <<-END_VERSIONS > versions.yml - "${task.process}": - qualimap: \$(echo \$(qualimap 2>&1) | sed 's/^.*QualiMap v.//; s/Built.*\$//') - END_VERSIONS - """ -} diff --git a/modules/local/qualimap/bamqccram/meta.yml b/modules/local/qualimap/bamqccram/meta.yml deleted file mode 100644 index 3c608f31a2..0000000000 --- a/modules/local/qualimap/bamqccram/meta.yml +++ /dev/null @@ -1,49 +0,0 @@ -name: qualimap_bamqc -description: Evaluate alignment data -keywords: - - quality control - - qc - - bam -tools: - - qualimap: - description: | - Qualimap 2 is a platform-independent application written in - Java and R that provides both a Graphical User Interface and - a command-line interface to facilitate the quality control of - alignment sequencing data and its derivatives like feature counts. - homepage: http://qualimap.bioinfo.cipf.es/ - documentation: http://qualimap.conesalab.org/doc_html/index.html - doi: 10.1093/bioinformatics/bts503 -input: - - meta: - type: map - description: | - Groovy Map containing sample information - e.g. [ id:'test', single_end:false ] - - bam: - type: file - description: BAM file - pattern: "*.{bam}" - - gff: - type: file - description: Feature file with regions of interest - pattern: "*.{gff,gtf,bed}" - - use_gff: - type: boolean - description: Specifies if feature file should be used or not -output: - - meta: - type: map - description: | - Groovy Map containing sample information - e.g. [ id:'test', single_end:false ] - - results: - type: dir - description: Qualimap results dir - pattern: "*/*" - - version: - type: file - description: File containing software version - pattern: "*.{version.txt}" -authors: - - "@phue" From 3f286e66f530acae5926c2a0caf5d7824ff52f4c Mon Sep 17 00:00:00 2001 From: Rike Date: Thu, 3 Mar 2022 11:55:24 +0100 Subject: [PATCH 09/10] update deepvariant --- modules.json | 2 +- modules/nf-core/modules/deepvariant/main.nf | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/modules.json b/modules.json index 93549e8acb..beabc2378c 100644 --- a/modules.json +++ b/modules.json @@ -31,7 +31,7 @@ "git_sha": "fdb1664885480d9411c24ba45bb4fde4738e5907" }, "deepvariant": { - "git_sha": "e745e167c1020928ef20ea1397b6b4d230681b4d" + "git_sha": "c450b08a75cda8878876ccbbe42493d6774397bd" }, "ensemblvep": { "git_sha": "e745e167c1020928ef20ea1397b6b4d230681b4d" diff --git a/modules/nf-core/modules/deepvariant/main.nf b/modules/nf-core/modules/deepvariant/main.nf index c5e819973c..8e5f10df65 100644 --- a/modules/nf-core/modules/deepvariant/main.nf +++ b/modules/nf-core/modules/deepvariant/main.nf @@ -17,8 +17,8 @@ process DEEPVARIANT { path(fai) output: - tuple val(meta), path("*.vcf.gz") , emit: vcf - tuple val(meta), path("*g.vcf.gz"), emit: gvcf + tuple val(meta), path("${prefix}.vcf.gz") , emit: vcf + tuple val(meta), path("${prefix}.g.vcf.gz"), emit: gvcf path "versions.yml" , emit: versions when: @@ -26,7 +26,7 @@ process DEEPVARIANT { script: def args = task.ext.args ?: '' - def prefix = task.ext.prefix ?: "${meta.id}" + prefix = task.ext.prefix ?: "${meta.id}" def regions = intervals ? "--regions ${intervals}" : "" """ From d7419f662f16cc4cd6c920b6e4b6432325133dab Mon Sep 17 00:00:00 2001 From: Rike Date: Thu, 3 Mar 2022 13:49:44 +0100 Subject: [PATCH 10/10] try to fix spark unsuccessfully, prob something with docker root permissions --- .../local/gatk4/markduplicatesspark/main.nf | 32 +++++++++++-------- nextflow.config | 1 + 2 files changed, 20 insertions(+), 13 deletions(-) diff --git a/modules/local/gatk4/markduplicatesspark/main.nf b/modules/local/gatk4/markduplicatesspark/main.nf index 80a1bf0650..33b51a8611 100644 --- a/modules/local/gatk4/markduplicatesspark/main.nf +++ b/modules/local/gatk4/markduplicatesspark/main.nf @@ -2,13 +2,13 @@ process GATK4_MARKDUPLICATES_SPARK { tag "$meta.id" label 'process_high' - conda (params.enable_conda ? "bioconda::gatk4=4.2.4.1" : null) + conda (params.enable_conda ? "bioconda::gatk4=4.2.5.0" : null) container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ? - 'https://depot.galaxyproject.org/singularity/gatk4:4.2.4.1--hdfd78af_0' : - 'quay.io/biocontainers/gatk4:4.2.4.1--hdfd78af_0' }" + 'https://depot.galaxyproject.org/singularity/gatk4:4.2.5.0--hdfd78af_0' : + 'broadinstitute/gatk:4.2.5.0' }" input: - tuple val(meta), path(bam) + tuple val(meta), path(bams) path fasta path fasta_fai path dict @@ -21,23 +21,23 @@ process GATK4_MARKDUPLICATES_SPARK { task.ext.when == null || task.ext.when script: - def args = task.ext.args ?: '' + def args = task.ext.args ?: '' + prefix = task.ext.prefix ?: "${meta.id}" + def bam_list = bams.collect(){ bam -> "-I ".concat(bam.toString()) }.join(" ") def avail_mem = 3 if (!task.memory) { log.info '[GATK MarkDuplicatesSpark] Available memory not known - defaulting to 3GB. Specify process memory requirements to change this.' } else { avail_mem = task.memory.giga } - prefix = task.ext.prefix ?: "${meta.id}" - def bams = bam.collect(){ x -> "-I ".concat(x.toString()) }.join(" ") """ - gatk \ - MarkDuplicatesSpark \ - $bams \ - -O ${prefix} \ - --reference ${fasta} \ - --tmp-dir . \ + export SPARK_USER=spark3 + gatk --java-options "-Xmx${avail_mem}g" MarkDuplicatesSpark \\ --spark-master local[${task.cpus}] \\ + $bam_list \\ + --reference ${fasta} \\ + --tmp-dir . \\ + --output ${prefix} \\ $args cat <<-END_VERSIONS > versions.yml @@ -46,3 +46,9 @@ process GATK4_MARKDUPLICATES_SPARK { END_VERSIONS """ } + +//export SPARK_LOCAL_IP=127.0.0.1 + // export SPARK_PUBLIC_DNS=127.0.0.1 + // --conf spark.jars.ivy=/tmp/.ivy \\ +// export SPARK_USER=spark3 +//--conf 'spark.kryo.referenceTracking=false' \\ diff --git a/nextflow.config b/nextflow.config index d1cb96ef7d..ff77dbdaae 100644 --- a/nextflow.config +++ b/nextflow.config @@ -146,6 +146,7 @@ profiles { podman.enabled = false shifter.enabled = false charliecloud.enabled = false + fixOwnership = true } singularity { singularity.enabled = true