From 3e357df54bb81d3437fdd1203ffe18ee96769399 Mon Sep 17 00:00:00 2001 From: Matthias De Smet <11850640+matthdsm@users.noreply.github.com> Date: Tue, 19 Nov 2024 16:08:32 +0100 Subject: [PATCH 1/7] fix module language server errors --- modules/nf-core/bowtie2/align/main.nf | 1 - modules/nf-core/bwa/index/main.nf | 2 +- modules/nf-core/bwa/mem/main.nf | 2 -- modules/nf-core/bwamem2/mem/main.nf | 3 --- modules/nf-core/dragmap/align/main.nf | 4 ---- modules/nf-core/md5sum/main.nf | 1 - modules/nf-core/samtools/coverage/main.nf | 1 - modules/nf-core/samtools/flagstat/main.nf | 1 - modules/nf-core/samtools/getrg/main.nf | 1 - modules/nf-core/samtools/idxstats/main.nf | 1 - modules/nf-core/samtools/import/main.nf | 1 - modules/nf-core/samtools/mpileup/main.nf | 2 +- modules/nf-core/samtools/reheader/main.nf | 1 - modules/nf-core/samtools/stats/main.nf | 1 - modules/nf-core/samtools/view/main.nf | 2 +- 15 files changed, 3 insertions(+), 21 deletions(-) diff --git a/modules/nf-core/bowtie2/align/main.nf b/modules/nf-core/bowtie2/align/main.nf index 809525ad36c..7b2f25eb4e3 100644 --- a/modules/nf-core/bowtie2/align/main.nf +++ b/modules/nf-core/bowtie2/align/main.nf @@ -90,7 +90,6 @@ process BOWTIE2_ALIGN { } else { create_unmapped = save_unaligned ? "touch ${prefix}.unmapped_1.fastq.gz && touch ${prefix}.unmapped_2.fastq.gz" : "" } - def reference = fasta && extension=="cram" ? "--reference ${fasta}" : "" if (!fasta && extension=="cram") error "Fasta reference is required for CRAM output" def create_index = "" diff --git a/modules/nf-core/bwa/index/main.nf b/modules/nf-core/bwa/index/main.nf index 2e48b6caae3..515efbeb736 100644 --- a/modules/nf-core/bwa/index/main.nf +++ b/modules/nf-core/bwa/index/main.nf @@ -11,7 +11,7 @@ process BWA_INDEX { tuple val(meta), path(fasta) output: - tuple val(meta), path(bwa) , emit: index + tuple val(meta), path("./bwa") , emit: index path "versions.yml" , emit: versions when: diff --git a/modules/nf-core/bwa/mem/main.nf b/modules/nf-core/bwa/mem/main.nf index 9c815f0c8e7..d18cd9363d0 100644 --- a/modules/nf-core/bwa/mem/main.nf +++ b/modules/nf-core/bwa/mem/main.nf @@ -53,10 +53,8 @@ process BWA_MEM { """ stub: - def args = task.ext.args ?: '' def args2 = task.ext.args2 ?: '' def prefix = task.ext.prefix ?: "${meta.id}" - def samtools_command = sort_bam ? 'sort' : 'view' def extension = args2.contains("--output-fmt sam") ? "sam" : args2.contains("--output-fmt cram") ? "cram": sort_bam && args2.contains("-O cram")? "cram": diff --git a/modules/nf-core/bwamem2/mem/main.nf b/modules/nf-core/bwamem2/mem/main.nf index 729428c4e07..2a993b41ac9 100644 --- a/modules/nf-core/bwamem2/mem/main.nf +++ b/modules/nf-core/bwamem2/mem/main.nf @@ -56,14 +56,11 @@ process BWAMEM2_MEM { stub: - def args = task.ext.args ?: '' def args2 = task.ext.args2 ?: '' def prefix = task.ext.prefix ?: "${meta.id}" - def samtools_command = sort_bam ? 'sort' : 'view' def extension_pattern = /(--output-fmt|-O)+\s+(\S+)/ def extension_matcher = (args2 =~ extension_pattern) def extension = extension_matcher.getCount() > 0 ? extension_matcher[0][2].toLowerCase() : "bam" - def reference = fasta && extension=="cram" ? "--reference ${fasta}" : "" if (!fasta && extension=="cram") error "Fasta reference is required for CRAM output" def create_index = "" diff --git a/modules/nf-core/dragmap/align/main.nf b/modules/nf-core/dragmap/align/main.nf index 3af939c4c62..760c2dfbad0 100644 --- a/modules/nf-core/dragmap/align/main.nf +++ b/modules/nf-core/dragmap/align/main.nf @@ -55,15 +55,11 @@ process DRAGMAP_ALIGN { """ stub: - def args = task.ext.args ?: '' def args2 = task.ext.args2 ?: '' def prefix = task.ext.prefix ?: "${meta.id}" - def reads_command = meta.single_end ? "-1 $reads" : "-1 ${reads[0]} -2 ${reads[1]}" - def samtools_command = sort_bam ? 'sort' : 'view' def extension_pattern = /(--output-fmt|-O)+\s+(\S+)/ def extension_matcher = (args2 =~ extension_pattern) def extension = extension_matcher.getCount() > 0 ? extension_matcher[0][2].toLowerCase() : "bam" - def reference = fasta && extension=="cram" ? "--reference ${fasta}" : "" if (!fasta && extension=="cram") error "Fasta reference is required for CRAM output" def create_index = "" diff --git a/modules/nf-core/md5sum/main.nf b/modules/nf-core/md5sum/main.nf index d77bb8ce84c..5340e4d497a 100644 --- a/modules/nf-core/md5sum/main.nf +++ b/modules/nf-core/md5sum/main.nf @@ -47,7 +47,6 @@ process MD5SUM { } stub: - def args = task.ext.args ?: '' def prefix = task.ext.prefix ?: "${meta.id}" if ( as_separate_files ) { """ diff --git a/modules/nf-core/samtools/coverage/main.nf b/modules/nf-core/samtools/coverage/main.nf index e386132fd84..a6d8a2e5a8e 100644 --- a/modules/nf-core/samtools/coverage/main.nf +++ b/modules/nf-core/samtools/coverage/main.nf @@ -37,7 +37,6 @@ process SAMTOOLS_COVERAGE { """ stub: - def args = task.ext.args ?: '' def prefix = task.ext.prefix ?: "${meta.id}" """ touch ${prefix}.txt diff --git a/modules/nf-core/samtools/flagstat/main.nf b/modules/nf-core/samtools/flagstat/main.nf index 4a49972747d..c23f3a5cf8a 100644 --- a/modules/nf-core/samtools/flagstat/main.nf +++ b/modules/nf-core/samtools/flagstat/main.nf @@ -18,7 +18,6 @@ process SAMTOOLS_FLAGSTAT { task.ext.when == null || task.ext.when script: - def args = task.ext.args ?: '' def prefix = task.ext.prefix ?: "${meta.id}" """ samtools \\ diff --git a/modules/nf-core/samtools/getrg/main.nf b/modules/nf-core/samtools/getrg/main.nf index fdd29470543..2741d71fc8f 100644 --- a/modules/nf-core/samtools/getrg/main.nf +++ b/modules/nf-core/samtools/getrg/main.nf @@ -19,7 +19,6 @@ process SAMTOOLS_GETRG { script: def args = task.ext.args ?: '' - def prefix = task.ext.prefix ?: "${meta.id}" """ samtools \\ view \\ diff --git a/modules/nf-core/samtools/idxstats/main.nf b/modules/nf-core/samtools/idxstats/main.nf index c4b5a0a3f53..e2bb6b20cb4 100644 --- a/modules/nf-core/samtools/idxstats/main.nf +++ b/modules/nf-core/samtools/idxstats/main.nf @@ -18,7 +18,6 @@ process SAMTOOLS_IDXSTATS { task.ext.when == null || task.ext.when script: - def args = task.ext.args ?: '' def prefix = task.ext.prefix ?: "${meta.id}" """ diff --git a/modules/nf-core/samtools/import/main.nf b/modules/nf-core/samtools/import/main.nf index e0a51c03371..b6927949491 100644 --- a/modules/nf-core/samtools/import/main.nf +++ b/modules/nf-core/samtools/import/main.nf @@ -46,7 +46,6 @@ process SAMTOOLS_IMPORT { """ stub: - def args = task.ext.args ?: '' def prefix = task.ext.prefix ?: "${meta.id}" """ diff --git a/modules/nf-core/samtools/mpileup/main.nf b/modules/nf-core/samtools/mpileup/main.nf index a45c6045b19..8a3ff75eb4a 100644 --- a/modules/nf-core/samtools/mpileup/main.nf +++ b/modules/nf-core/samtools/mpileup/main.nf @@ -20,7 +20,7 @@ process SAMTOOLS_MPILEUP { script: def args = task.ext.args ?: '' def prefix = task.ext.prefix ?: "${meta.id}" - def intervals = intervals ? "-l ${intervals}" : "" + intervals = intervals ? "-l ${intervals}" : "" """ samtools mpileup \\ --fasta-ref $fasta \\ diff --git a/modules/nf-core/samtools/reheader/main.nf b/modules/nf-core/samtools/reheader/main.nf index 063854206f2..e4d8dd3a470 100644 --- a/modules/nf-core/samtools/reheader/main.nf +++ b/modules/nf-core/samtools/reheader/main.nf @@ -36,7 +36,6 @@ process SAMTOOLS_REHEADER { """ stub: - def args = task.ext.args ?: '' def prefix = task.ext.prefix ?: "${meta.id}" """ touch ${prefix}.bam diff --git a/modules/nf-core/samtools/stats/main.nf b/modules/nf-core/samtools/stats/main.nf index 493525a9e0e..4443948b72a 100644 --- a/modules/nf-core/samtools/stats/main.nf +++ b/modules/nf-core/samtools/stats/main.nf @@ -19,7 +19,6 @@ process SAMTOOLS_STATS { task.ext.when == null || task.ext.when script: - def args = task.ext.args ?: '' def prefix = task.ext.prefix ?: "${meta.id}" def reference = fasta ? "--reference ${fasta}" : "" """ diff --git a/modules/nf-core/samtools/view/main.nf b/modules/nf-core/samtools/view/main.nf index 41fa3d6a0b9..424d84c3bd4 100644 --- a/modules/nf-core/samtools/view/main.nf +++ b/modules/nf-core/samtools/view/main.nf @@ -63,7 +63,7 @@ process SAMTOOLS_VIEW { input.getExtension() if ("$input" == "${prefix}.${file_type}") error "Input and output names are the same, use \"task.ext.prefix\" to disambiguate!" - def index = args.contains("--write-index") ? "touch ${prefix}.${file_type}.csi" : "" + index = args.contains("--write-index") ? "touch ${prefix}.${file_type}.csi" : "" """ touch ${prefix}.${file_type} From caed339e736b9b70d59f231038811921ba729122 Mon Sep 17 00:00:00 2001 From: Matthias De Smet <11850640+matthdsm@users.noreply.github.com> Date: Tue, 19 Nov 2024 16:11:59 +0100 Subject: [PATCH 2/7] fix subwf language server errors --- subworkflows/nf-core/bcl_demultiplex/main.nf | 22 ++++++++++---------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/subworkflows/nf-core/bcl_demultiplex/main.nf b/subworkflows/nf-core/bcl_demultiplex/main.nf index 129b2f1b554..5526fc411c1 100644 --- a/subworkflows/nf-core/bcl_demultiplex/main.nf +++ b/subworkflows/nf-core/bcl_demultiplex/main.nf @@ -22,7 +22,7 @@ workflow BCL_DEMULTIPLEX { // Split flowcells into separate channels containing run as tar and run as path // https://nextflow.slack.com/archives/C02T98A23U7/p1650963988498929 ch_flowcell - .branch { meta, samplesheet, run -> + .branch { _meta, _samplesheet, run -> tar: run.toString().endsWith(".tar.gz") dir: true }.set { ch_flowcells } @@ -88,18 +88,18 @@ workflow BCL_DEMULTIPLEX { line = line.substring(1) // expected format is like: // xx:yy:FLOWCELLID:LANE:... (seven fields) - fields = line.split(':') + def fields = line.split(':') // CASAVA 1.8+ format, from https://support.illumina.com/help/BaseSpace_OLH_009008/Content/Source/Informatics/BS/FileFormat_FASTQ-files_swBS.htm // "@::::::: :::" - sequencer_serial = fields[0] - run_nubmer = fields[1] - fcid = fields[2] - lane = fields[3] - index = fields[-1] =~ /[GATC+-]/ ? fields[-1] : "" - ID = [fcid, lane].join(".") - PU = [fcid, lane, index].findAll().join(".") - PL = "ILLUMINA" - SM = fastq.getSimpleName().toString() - ~/_S[0-9]+.*$/ + //def sequencer_serial = fields[0] + //def run_nubmer = fields[1] + def fcid = fields[2] + def lane = fields[3] + def index = fields[-1] =~ /[GATC+-]/ ? fields[-1] : "" + def ID = [fcid, lane].join(".") + def PU = [fcid, lane, index].findAll().join(".") + def PL = "ILLUMINA" + def SM = fastq.getSimpleName().toString() - ~/_S[0-9]+.*$/ meta.readgroup = [ "ID": ID, "SM": SM, From a086194fe65ccfc06439bb486268e99205571cea Mon Sep 17 00:00:00 2001 From: Matthias De Smet <11850640+matthdsm@users.noreply.github.com> Date: Wed, 20 Nov 2024 08:48:18 +0100 Subject: [PATCH 3/7] fix fastq_align_dna logic --- subworkflows/nf-core/fastq_align_dna/main.nf | 33 ++++++++++---------- 1 file changed, 16 insertions(+), 17 deletions(-) diff --git a/subworkflows/nf-core/fastq_align_dna/main.nf b/subworkflows/nf-core/fastq_align_dna/main.nf index f064852e3a0..f3ee73d442a 100644 --- a/subworkflows/nf-core/fastq_align_dna/main.nf +++ b/subworkflows/nf-core/fastq_align_dna/main.nf @@ -29,37 +29,36 @@ workflow FASTQ_ALIGN_DNA { ch_versions = Channel.empty() // Align fastq files to reference genome and (optionally) sort - switch (aligner) { - case 'bowtie2': + if (aligner == 'bowtie2') { BOWTIE2_ALIGN(ch_reads, ch_aligner_index, ch_fasta, false, sort) // if aligner is bowtie2 ch_bam = ch_bam.mix(BOWTIE2_ALIGN.out.bam) ch_versions = ch_versions.mix(BOWTIE2_ALIGN.out.versions) - break - case 'bwamem': + } + else if (aligner == 'bwamem'){ BWAMEM1_MEM (ch_reads, ch_aligner_index, ch_fasta, sort) // If aligner is bwa-mem ch_bam = ch_bam.mix(BWAMEM1_MEM.out.bam) ch_bam_index = ch_bam_index.mix(BWAMEM1_MEM.out.csi) ch_versions = ch_versions.mix(BWAMEM1_MEM.out.versions) - break - case 'bwamem2': + } + else if (aligner == 'bwamem2'){ BWAMEM2_MEM (ch_reads, ch_aligner_index, ch_fasta, sort) // If aligner is bwa-mem2 ch_bam = ch_bam.mix(BWAMEM2_MEM.out.bam) ch_versions = ch_versions.mix(BWAMEM2_MEM.out.versions) - break - case 'dragmap': + } + else if (aligner == 'dragmap'){ DRAGMAP_ALIGN(ch_reads, ch_aligner_index, ch_fasta, sort) // If aligner is dragmap ch_bam = ch_bam.mix(DRAGMAP_ALIGN.out.bam) ch_reports = ch_reports.mix(DRAGMAP_ALIGN.out.log) ch_versions = ch_versions.mix(DRAGMAP_ALIGN.out.versions) - break - case 'snap': - SNAP_ALIGN (ch_reads, ch_aligner_index) // If aligner is snap - ch_bam = ch_bam.mix(SNAP_ALIGN.out.bam) - ch_bam_index.mix(SNAP_ALIGN.out.bai) - ch_versions = ch_versions.mix(SNAP_ALIGN.out.versions) - break - default: - error "Unknown aligner: ${aligner}" + } + else if (aligner == 'snap'){ + SNAP_ALIGN (ch_reads, ch_aligner_index) // If aligner is snap + ch_bam = ch_bam.mix(SNAP_ALIGN.out.bam) + ch_bam_index.mix(SNAP_ALIGN.out.bai) + ch_versions = ch_versions.mix(SNAP_ALIGN.out.versions) + } + else { + error "Unknown aligner: ${aligner}" } emit: From dba9a8b74260ed963f24f2e754981320be57d69b Mon Sep 17 00:00:00 2001 From: Matthias De Smet <11850640+matthdsm@users.noreply.github.com> Date: Wed, 20 Nov 2024 11:01:36 +0100 Subject: [PATCH 4/7] fix alignment --- modules/nf-core/bwa/index/main.nf | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/modules/nf-core/bwa/index/main.nf b/modules/nf-core/bwa/index/main.nf index 515efbeb736..a01b94890af 100644 --- a/modules/nf-core/bwa/index/main.nf +++ b/modules/nf-core/bwa/index/main.nf @@ -11,8 +11,8 @@ process BWA_INDEX { tuple val(meta), path(fasta) output: - tuple val(meta), path("./bwa") , emit: index - path "versions.yml" , emit: versions + tuple val(meta), path("./bwa") , emit: index + path "versions.yml" , emit: versions when: task.ext.when == null || task.ext.when From d9b4bab3e4395c1d9e7bf3cb26e10d6bce26598a Mon Sep 17 00:00:00 2001 From: Matthias De Smet <11850640+matthdsm@users.noreply.github.com> Date: Wed, 20 Nov 2024 11:02:29 +0100 Subject: [PATCH 5/7] drop obsolete snapshot --- .../nf-core/gridss/gridss/tests/main.nf.test.snap | 14 +------------- 1 file changed, 1 insertion(+), 13 deletions(-) diff --git a/modules/nf-core/gridss/gridss/tests/main.nf.test.snap b/modules/nf-core/gridss/gridss/tests/main.nf.test.snap index 3ccf4f6d74b..1041705abee 100644 --- a/modules/nf-core/gridss/gridss/tests/main.nf.test.snap +++ b/modules/nf-core/gridss/gridss/tests/main.nf.test.snap @@ -67,17 +67,5 @@ "nextflow": "24.04.2" }, "timestamp": "2024-07-10T11:48:45.270441" - }, - "human - bam - assembly": { - "content": [ - [ - "versions.yml:md5,139867df5d7eaf22a89ae574f08e8d80" - ] - ], - "meta": { - "nf-test": "0.8.4", - "nextflow": "24.04.2" - }, - "timestamp": "2024-07-09T14:13:21.550069" } -} \ No newline at end of file +} From c881deeb9d6c379e3af881da1d632c99dc2c30f5 Mon Sep 17 00:00:00 2001 From: Matthias De Smet <11850640+matthdsm@users.noreply.github.com> Date: Wed, 20 Nov 2024 13:52:07 +0100 Subject: [PATCH 6/7] CI fix --- .github/workflows/nf-test.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/nf-test.yml b/.github/workflows/nf-test.yml index e89c7afcc44..45711fbe5c9 100644 --- a/.github/workflows/nf-test.yml +++ b/.github/workflows/nf-test.yml @@ -62,6 +62,8 @@ jobs: SENTIEON_LICENSE_MESSAGE: ${{ secrets.SENTIEON_LICENSE_MESSAGE }} SENTIEON_ENCRYPTION_KEY: ${{ secrets.SENTIEON_ENCRYPTION_KEY }} steps: + - name: Clean Workspace # Purge the workspace in case it's running on a self-hosted runner + uses: AutoModality/action-clean@v1.1.0 - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4 with: fetch-depth: 0 From 463028f708057ce069cf0bc17f7a7d468110db61 Mon Sep 17 00:00:00 2001 From: Matthias De Smet <11850640+matthdsm@users.noreply.github.com> Date: Thu, 21 Nov 2024 06:55:36 +0100 Subject: [PATCH 7/7] fix linting --- modules/nf-core/bwa/index/main.nf | 2 +- modules/nf-core/bwa/index/meta.yml | 7 +++++-- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/modules/nf-core/bwa/index/main.nf b/modules/nf-core/bwa/index/main.nf index a01b94890af..29d995774c0 100644 --- a/modules/nf-core/bwa/index/main.nf +++ b/modules/nf-core/bwa/index/main.nf @@ -11,7 +11,7 @@ process BWA_INDEX { tuple val(meta), path(fasta) output: - tuple val(meta), path("./bwa") , emit: index + tuple val(meta), path("bwa") , emit: index path "versions.yml" , emit: versions when: diff --git a/modules/nf-core/bwa/index/meta.yml b/modules/nf-core/bwa/index/meta.yml index 4884bca2ab9..ce5cb8ffa23 100644 --- a/modules/nf-core/bwa/index/meta.yml +++ b/modules/nf-core/bwa/index/meta.yml @@ -31,9 +31,12 @@ output: description: | Groovy Map containing reference information. e.g. [ id:'test', single_end:false ] + pattern: "*.{amb,ann,bwt,pac,sa}" - bwa: - type: file - description: BWA genome index files + type: map + description: | + Groovy Map containing reference information. + e.g. [ id:'test', single_end:false ] pattern: "*.{amb,ann,bwt,pac,sa}" - versions: - versions.yml: