From 62d4987f645966c0aa049dd53f355e5a2b956249 Mon Sep 17 00:00:00 2001 From: Nicolas Vannieuwkerke Date: Mon, 6 Jul 2026 16:29:50 +0200 Subject: [PATCH 1/6] implement support for multiple fastqs --- .../plugin/samplesheets/OutputEntry.groovy | 24 +++- .../samplesheets/PipelineObserver.groovy | 4 +- .../samplesheets/PreprocessingObserver.groovy | 120 +++++++++++++----- tests/preprocessing_mock/main.nf | 1 - 4 files changed, 107 insertions(+), 42 deletions(-) diff --git a/src/main/groovy/nfcmgg/plugin/samplesheets/OutputEntry.groovy b/src/main/groovy/nfcmgg/plugin/samplesheets/OutputEntry.groovy index 17a659c..ac9b4dc 100644 --- a/src/main/groovy/nfcmgg/plugin/samplesheets/OutputEntry.groovy +++ b/src/main/groovy/nfcmgg/plugin/samplesheets/OutputEntry.groovy @@ -29,9 +29,9 @@ import groovy.util.logging.Slf4j @CompileDynamic class OutputEntry { - final private Map values + final private Map values - OutputEntry(Map defaultValues = [:]) { + OutputEntry(Map defaultValues = [:]) { this.values = defaultValues } @@ -63,20 +63,32 @@ class OutputEntry { return newEntry } - OutputEntry add(String key, String value) { + OutputEntry append(String key, String value) { + if (!this.values.containsKey(key)) { + this.values[key] = [] + } + this.values[key] << value + return this + } + + OutputEntry add(String key, Object value) { this.values[key] = value return this } - String get(String key) { + String getAsString(String key) { + return this.values.get(key)?.toString() + } + + Object get(String key) { return this.values.get(key) } - String get(String key, String defaultValue) { + Object get(String key, Object defaultValue) { return this.values.get(key, defaultValue) } - Map getValues() { + Map getValues() { return this.values } diff --git a/src/main/groovy/nfcmgg/plugin/samplesheets/PipelineObserver.groovy b/src/main/groovy/nfcmgg/plugin/samplesheets/PipelineObserver.groovy index 1bb9857..e0f22f0 100644 --- a/src/main/groovy/nfcmgg/plugin/samplesheets/PipelineObserver.groovy +++ b/src/main/groovy/nfcmgg/plugin/samplesheets/PipelineObserver.groovy @@ -78,7 +78,7 @@ class PipelineObserver implements TraceObserverV2 { * @return a map of key-value pairs to be added to the sample entry when it is first created */ /* groovylint-disable-next-line UnusedMethodParameter */ - Map getDefaultValuesForSample(String sample) { + Map getDefaultValuesForSample(String sample) { return [:] } @@ -120,7 +120,7 @@ class PipelineObserver implements TraceObserverV2 { "Multiple possible samples found for path '$basePath': $possibleSamples, using '$sample' as sample name, because it is the longest match" ) } - entries.putIfAbsent(sample, new OutputEntry(['id': sample] + getDefaultValuesForSample(sample))) + entries.putIfAbsent(sample, new OutputEntry(['id': sample] as Map + getDefaultValuesForSample(sample))) return sample } diff --git a/src/main/groovy/nfcmgg/plugin/samplesheets/PreprocessingObserver.groovy b/src/main/groovy/nfcmgg/plugin/samplesheets/PreprocessingObserver.groovy index 7eebdf5..e4b54ae 100644 --- a/src/main/groovy/nfcmgg/plugin/samplesheets/PreprocessingObserver.groovy +++ b/src/main/groovy/nfcmgg/plugin/samplesheets/PreprocessingObserver.groovy @@ -19,6 +19,7 @@ import groovy.util.logging.Slf4j import groovy.transform.CompileStatic import java.nio.file.Path +import java.util.regex.Matcher import nextflow.trace.event.FilePublishEvent @@ -47,7 +48,10 @@ class PreprocessingObserver extends PipelineObserver { sampleMetrics.each { metric -> String sample = metric['Sample'] String yield = metric['yield_'] - entries.putIfAbsent(sample, new OutputEntry(['id': sample] + getDefaultValuesForSample(sample))) + entries.putIfAbsent( + sample, + new OutputEntry(['id': sample] as Map + getDefaultValuesForSample(sample)) + ) entries[sample].add('yield', yield) } } @@ -67,11 +71,11 @@ class PreprocessingObserver extends PipelineObserver { case ~/^.*\.crai$/: entries[safeGetSample(targetName)].add('crai', targetPath) break - case ~/^.*R1_00.\.fastq\.gz$/: - entries[safeGetSample(targetName)].add('fastq_1', targetPath) + case ~/^.*R1_\d\d\d\.fastq\.gz$/: + entries[safeGetSample(targetName)].append('fastq_1', targetPath) break - case ~/^.*R2_00.\.fastq\.gz$/: - entries[safeGetSample(targetName)].add('fastq_2', targetPath) + case ~/^.*R2_\d\d\d\.fastq\.gz$/: + entries[safeGetSample(targetName)].append('fastq_2', targetPath) break case ~/^.*\.per-base\.bed\.gz$/: entries[safeGetSample(targetName)].add('per_base_bed', targetPath) @@ -89,14 +93,14 @@ class PreprocessingObserver extends PipelineObserver { entries = entries.sort() Map humanEntries = entries.findAll { entry -> // Only retain samples of human data for the samplesheets - entry.value.get('organism')?.toLowerCase() == 'homo sapiens' || - entry.value.get('genome')?.toLowerCase() == 'grch38' + entry.value.getAsString('organism')?.toLowerCase() == 'homo sapiens' || + entry.value.getAsString('genome')?.toLowerCase() == 'grch38' } Map mouseEntries = entries.findAll { entry -> - // Only retain samples of human data for the samplesheets - entry.value.get('organism')?.toLowerCase() == 'mus musculus' || - entry.value.get('genome')?.toLowerCase() == 'mm10' + // Only retain samples of mouse data for the samplesheets + entry.value.getAsString('organism')?.toLowerCase() == 'mus musculus' || + entry.value.getAsString('genome')?.toLowerCase() == 'mm10' } // @@ -106,8 +110,8 @@ class PreprocessingObserver extends PipelineObserver { humanEntries .findAll { entry -> // Only create samplesheet for WES and WGS runs of DNA samples - entry.value.get('sample_type')?.toLowerCase() == 'dna' && - entry.value.get('tag')?.toLowerCase() in ['wes', 'wgs'] + entry.value.getAsString('sample_type')?.toLowerCase() == 'dna' && + entry.value.getAsString('tag')?.toLowerCase() in ['wes', 'wgs'] } .values() *.subKeys([ @@ -129,9 +133,9 @@ class PreprocessingObserver extends PipelineObserver { Map rnafusionEntries = humanEntries .findAll { entry -> // Only create samplesheet for RNAseqMDG runs of RNA samples that have FASTQ output - entry.value.get('sample_type')?.toLowerCase() == 'rna' && - entry.value.get('tag')?.toLowerCase() == 'rnaseqmdg' && - entry.value.get('fastq_1') + entry.value.getAsString('sample_type')?.toLowerCase() == 'rna' && + entry.value.getAsString('tag')?.toLowerCase() == 'rnaseqmdg' && + entry.value.getAsString('fastq_1') } List rnafusionKeys = [ ['id', 'sample'], @@ -142,24 +146,74 @@ class PreprocessingObserver extends PipelineObserver { ] // Passed data - creator.dump( - rnafusionEntries - .findAll { entry -> - entry.value.get('yield').toLong() >= 1000000L + List passedEntries = [] + rnafusionEntries + .findAll { entry -> + entry.value.getAsString('yield').toLong() >= 1000000L + } + .values() + *.subKeys(rnafusionKeys) + .each { OutputEntry entry -> + Map fastq2Lanes = (entry.get('fastq_2', []) as List).collectEntries { fastq2 -> + Matcher match = fastq2 =~ ~/^.*R2_(\d\d\d)\.fastq\.gz$/ + if (!match.find()) { + log.warn("Could not find lane for fastq2 file '$fastq2', skipping this file") + return + } + String lane = match.group(1) + [lane, fastq2] } - .values() - *.subKeys(rnafusionKeys), + + entry.get('fastq_1').each { fastq1 -> + Matcher match = fastq1 =~ ~/^.*R1_(\d\d\d)\.fastq\.gz$/ + if (!match.find()) { + log.warn("Could not find lane for fastq1 file '$fastq1', skipping this file") + return + } + String lane = match.group(1) + String fastq2 = fastq2Lanes.get(lane, "") + passedEntries << new OutputEntry(entry.values).add('fastq_1', fastq1).add('fastq_2', fastq2) + } + } + + creator.dump( + passedEntries, location.resolve('nfcore_rnafusion_samplesheet.yaml') ) // Failed data - creator.dump( - rnafusionEntries - .findAll { entry -> - entry.value.get('yield').toLong() < 1000000L + List failedEntries = [] + rnafusionEntries + .findAll { entry -> + entry.value.getAsString('yield').toLong() < 1000000L + } + .values() + *.subKeys(rnafusionKeys) + .each { OutputEntry entry -> + Map fastq2Lanes = (entry.get('fastq_2', []) as List).collectEntries { fastq2 -> + Matcher match = fastq2 =~ ~/^.*R2_(\d\d\d)\.fastq\.gz$/ + if (!match.find()) { + log.warn("Could not find lane for fastq2 file '$fastq2', skipping this file") + return + } + String lane = match.group(1) + [lane, fastq2] } - .values() - *.subKeys(rnafusionKeys), + + entry.get('fastq_1').each { fastq1 -> + Matcher match = fastq1 =~ ~/^.*R1_(\d\d\d)\.fastq\.gz$/ + if (!match.find()) { + log.warn("Could not find lane for fastq1 file '$fastq1', skipping this file") + return + } + String lane = match.group(1) + String fastq2 = fastq2Lanes.get(lane, "") + failedEntries << new OutputEntry(entry.values).add('fastq_1', fastq1).add('fastq_2', fastq2) + } + } + + creator.dump( + failedEntries, location.resolve('nfcore_rnafusion_samplesheet_failed.yaml') ) @@ -169,9 +223,9 @@ class PreprocessingObserver extends PipelineObserver { creator.dump( (humanEntries + mouseEntries) .findAll { entry -> - String type = entry.value.get('sample_type')?.toLowerCase() + String type = entry.value.getAsString('sample_type')?.toLowerCase() // Only create samplesheet for DNA and tissue samples that are not mitochondrial - (type == 'dna' || type == 'tissue') && !entry.value.get('id')?.startsWith('mtD') + (type == 'dna' || type == 'tissue') && !entry.value.getAsString('id')?.startsWith('mtD') } .values() *.subKeys([ @@ -196,8 +250,8 @@ class PreprocessingObserver extends PipelineObserver { humanEntries .findAll { entry -> // Only create samplesheet for WES runs of DNA samples - entry.value.get('sample_type')?.toLowerCase() == 'dna' && - entry.value.get('tag')?.toLowerCase() in ['wes'] + entry.value.getAsString('sample_type')?.toLowerCase() == 'dna' && + entry.value.getAsString('tag')?.toLowerCase() in ['wes'] } .values() *.subKeys([ @@ -219,8 +273,8 @@ class PreprocessingObserver extends PipelineObserver { humanEntries .findAll { entry -> // Only create samplesheet for DNA samples - entry.value.get('sample_type')?.toLowerCase() == 'dna' && - entry.value.get('tag')?.toLowerCase() in ['wes', 'wgs'] + entry.value.getAsString('sample_type')?.toLowerCase() == 'dna' && + entry.value.getAsString('tag')?.toLowerCase() in ['wes', 'wgs'] } .values() *.subKeys([ diff --git a/tests/preprocessing_mock/main.nf b/tests/preprocessing_mock/main.nf index 1358c67..7ae186d 100644 --- a/tests/preprocessing_mock/main.nf +++ b/tests/preprocessing_mock/main.nf @@ -12,7 +12,6 @@ workflow { input.addAll(new groovy.yaml.YamlSlurper().parseText(file(entry.sample_info).text)) } } - println input.findAll { entry -> entry.sample_type == 'RNA'} MOCK_OUTPUT(input) publish: From 16708f473fa3325a984cec3d3b26e8a2bc36e468 Mon Sep 17 00:00:00 2001 From: Nicolas Vannieuwkerke Date: Mon, 6 Jul 2026 16:54:25 +0200 Subject: [PATCH 2/6] add tests + fix cloning issue --- .../samplesheets/PreprocessingObserver.groovy | 8 +++-- tests/preprocessing_mock/input.yaml | 22 +++++++++++++ tests/preprocessing_mock/main.nf | 10 +++++- tests/preprocessing_mock/main.nf.test.snap | 32 ++++++++++++++++++- 4 files changed, 68 insertions(+), 4 deletions(-) diff --git a/src/main/groovy/nfcmgg/plugin/samplesheets/PreprocessingObserver.groovy b/src/main/groovy/nfcmgg/plugin/samplesheets/PreprocessingObserver.groovy index e4b54ae..871f913 100644 --- a/src/main/groovy/nfcmgg/plugin/samplesheets/PreprocessingObserver.groovy +++ b/src/main/groovy/nfcmgg/plugin/samplesheets/PreprocessingObserver.groovy @@ -172,7 +172,9 @@ class PreprocessingObserver extends PipelineObserver { } String lane = match.group(1) String fastq2 = fastq2Lanes.get(lane, "") - passedEntries << new OutputEntry(entry.values).add('fastq_1', fastq1).add('fastq_2', fastq2) + passedEntries << new OutputEntry(entry.values.clone() as Map) + .add('fastq_1', fastq1) + .add('fastq_2', fastq2) } } @@ -208,7 +210,9 @@ class PreprocessingObserver extends PipelineObserver { } String lane = match.group(1) String fastq2 = fastq2Lanes.get(lane, "") - failedEntries << new OutputEntry(entry.values).add('fastq_1', fastq1).add('fastq_2', fastq2) + failedEntries << new OutputEntry(entry.values.clone() as Map) + .add('fastq_1', fastq1) + .add('fastq_2', fastq2) } } diff --git a/tests/preprocessing_mock/input.yaml b/tests/preprocessing_mock/input.yaml index d432fdb..5564649 100644 --- a/tests/preprocessing_mock/input.yaml +++ b/tests/preprocessing_mock/input.yaml @@ -45,6 +45,17 @@ family_number: Proband_123456 library: RNA_prep reads_to_use_in_test: 1200000 +## An RNA sample with multiple lanes (rnafusion) - passed +- id: R56789 + samplename: R56789 + genome: GRCh38 + tag: RNAseqMDG + aligner: false + sample_type: RNA + family_number: Proband_123456 + library: RNA_prep + reads_to_use_in_test: 1200000 + lanes: 3 ## A standard RNA sample (rnafusion) - failed - id: R654321 samplename: R654321 @@ -55,6 +66,17 @@ family_number: Proband_123456 library: RNA_prep reads_to_use_in_test: 150 +## An RNA sample with multiple lanes (rnafusion) - failed +- id: R654322 + samplename: R654322 + genome: GRCh38 + tag: RNAseqMDG + aligner: false + sample_type: RNA + family_number: Proband_123456 + library: RNA_prep + reads_to_use_in_test: 150 + lanes: 3 ## Flowcell - id: flowcell sample_info: ../../../tests/preprocessing_mock/sampleinfo.yaml diff --git a/tests/preprocessing_mock/main.nf b/tests/preprocessing_mock/main.nf index 7ae186d..bac3cf0 100644 --- a/tests/preprocessing_mock/main.nf +++ b/tests/preprocessing_mock/main.nf @@ -34,7 +34,15 @@ process MOCK_OUTPUT { script: def fastqs = input_list .findAll { entry -> entry.aligner == false } - .collect { entry -> "echo '' | gzip > ${entry.samplename}_R1_001.fastq.gz && echo '' | gzip > ${entry.samplename}_R2_001.fastq.gz"} + .collect { entry -> + def lanes = entry.lanes?.toInteger() ?: 1 + def fastq_echos = (lanes > 1 ? 1..lanes : [1]) + .collect { lane -> + "echo '' | gzip > ${entry.samplename}_R1_00${lane}.fastq.gz && echo '' | gzip > ${entry.samplename}_R2_00${lane}.fastq.gz" + } + return fastq_echos + } + .flatten() .join("\n ") def crams = input_list .findAll { entry -> entry.aligner instanceof String } diff --git a/tests/preprocessing_mock/main.nf.test.snap b/tests/preprocessing_mock/main.nf.test.snap index 666713e..a3d75a1 100644 --- a/tests/preprocessing_mock/main.nf.test.snap +++ b/tests/preprocessing_mock/main.nf.test.snap @@ -86,6 +86,21 @@ " fastq_1: R123456_R1_001.fastq.gz", " fastq_2: R123456_R2_001.fastq.gz", " strandedness: unknown", + " reads: '1200000'", + "- sample: R56789", + " fastq_1: R56789_R1_002.fastq.gz", + " fastq_2: R56789_R2_002.fastq.gz", + " strandedness: unknown", + " reads: '1200000'", + "- sample: R56789", + " fastq_1: R56789_R1_003.fastq.gz", + " fastq_2: R56789_R2_003.fastq.gz", + " strandedness: unknown", + " reads: '1200000'", + "- sample: R56789", + " fastq_1: R56789_R1_001.fastq.gz", + " fastq_2: R56789_R2_001.fastq.gz", + " strandedness: unknown", " reads: '1200000'" ], "nfcore_rnafusion_samplesheet_failed.yaml": [ @@ -93,11 +108,26 @@ " fastq_1: R654321_R1_001.fastq.gz", " fastq_2: R654321_R2_001.fastq.gz", " strandedness: unknown", + " reads: '150'", + "- sample: R654322", + " fastq_1: R654322_R1_003.fastq.gz", + " fastq_2: R654322_R2_003.fastq.gz", + " strandedness: unknown", + " reads: '150'", + "- sample: R654322", + " fastq_1: R654322_R1_001.fastq.gz", + " fastq_2: R654322_R2_001.fastq.gz", + " strandedness: unknown", + " reads: '150'", + "- sample: R654322", + " fastq_1: R654322_R1_002.fastq.gz", + " fastq_2: R654322_R2_002.fastq.gz", + " strandedness: unknown", " reads: '150'" ] } ], - "timestamp": "2026-05-28T17:12:46.996334438", + "timestamp": "2026-07-06T16:53:39.60987321", "meta": { "nf-test": "0.9.5", "nextflow": "26.04.0" From c8b2354fc06d857ee77b595f74ef43b6fdde7d81 Mon Sep 17 00:00:00 2001 From: Nicolas Vannieuwkerke Date: Mon, 6 Jul 2026 16:56:36 +0200 Subject: [PATCH 3/6] bump version + changelog --- CHANGELOG.md | 4 ++++ build.gradle | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 5a1323b..aed5c62 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,7 @@ +## 0.2.7 + +1. Rnafusion samplesheets will now contain multiple entries of the same sample when fastq files from multiple lanes are created by nf-cmgg/preprocessing + ## 0.2.6 1. Convert the fastq yield to a Long type instead of Integer to prevent integer overflows diff --git a/build.gradle b/build.gradle index ee61d25..1b956ea 100644 --- a/build.gradle +++ b/build.gradle @@ -6,7 +6,7 @@ dependencies { implementation 'com.squareup.okhttp3:okhttp:5.3.2' } -version = '0.2.6' +version = '0.2.7' nextflowPlugin { nextflowVersion = '25.10.0' From 772ef3d9c80b2aaf934536db5a09a1da5f657d5c Mon Sep 17 00:00:00 2001 From: Nicolas Vannieuwkerke Date: Mon, 6 Jul 2026 17:04:36 +0200 Subject: [PATCH 4/6] prek + sort order of fastq entries --- .vscode/settings.json | 4 ++-- .../samplesheets/PreprocessingObserver.groovy | 8 +++---- tests/preprocessing_mock/main.nf.test.snap | 22 +++++++++---------- 3 files changed, 17 insertions(+), 17 deletions(-) diff --git a/.vscode/settings.json b/.vscode/settings.json index e59a799..269b540 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -1,3 +1,3 @@ { - "nextflow.telemetry.enabled": false -} \ No newline at end of file + "nextflow.telemetry.enabled": false +} diff --git a/src/main/groovy/nfcmgg/plugin/samplesheets/PreprocessingObserver.groovy b/src/main/groovy/nfcmgg/plugin/samplesheets/PreprocessingObserver.groovy index 871f913..472f233 100644 --- a/src/main/groovy/nfcmgg/plugin/samplesheets/PreprocessingObserver.groovy +++ b/src/main/groovy/nfcmgg/plugin/samplesheets/PreprocessingObserver.groovy @@ -164,14 +164,14 @@ class PreprocessingObserver extends PipelineObserver { [lane, fastq2] } - entry.get('fastq_1').each { fastq1 -> + (entry.get('fastq_1') as List).sort().each { fastq1 -> Matcher match = fastq1 =~ ~/^.*R1_(\d\d\d)\.fastq\.gz$/ if (!match.find()) { log.warn("Could not find lane for fastq1 file '$fastq1', skipping this file") return } String lane = match.group(1) - String fastq2 = fastq2Lanes.get(lane, "") + String fastq2 = fastq2Lanes.get(lane, '') passedEntries << new OutputEntry(entry.values.clone() as Map) .add('fastq_1', fastq1) .add('fastq_2', fastq2) @@ -202,14 +202,14 @@ class PreprocessingObserver extends PipelineObserver { [lane, fastq2] } - entry.get('fastq_1').each { fastq1 -> + (entry.get('fastq_1') as List).sort().each { fastq1 -> Matcher match = fastq1 =~ ~/^.*R1_(\d\d\d)\.fastq\.gz$/ if (!match.find()) { log.warn("Could not find lane for fastq1 file '$fastq1', skipping this file") return } String lane = match.group(1) - String fastq2 = fastq2Lanes.get(lane, "") + String fastq2 = fastq2Lanes.get(lane, '') failedEntries << new OutputEntry(entry.values.clone() as Map) .add('fastq_1', fastq1) .add('fastq_2', fastq2) diff --git a/tests/preprocessing_mock/main.nf.test.snap b/tests/preprocessing_mock/main.nf.test.snap index a3d75a1..d32626f 100644 --- a/tests/preprocessing_mock/main.nf.test.snap +++ b/tests/preprocessing_mock/main.nf.test.snap @@ -88,6 +88,11 @@ " strandedness: unknown", " reads: '1200000'", "- sample: R56789", + " fastq_1: R56789_R1_001.fastq.gz", + " fastq_2: R56789_R2_001.fastq.gz", + " strandedness: unknown", + " reads: '1200000'", + "- sample: R56789", " fastq_1: R56789_R1_002.fastq.gz", " fastq_2: R56789_R2_002.fastq.gz", " strandedness: unknown", @@ -96,11 +101,6 @@ " fastq_1: R56789_R1_003.fastq.gz", " fastq_2: R56789_R2_003.fastq.gz", " strandedness: unknown", - " reads: '1200000'", - "- sample: R56789", - " fastq_1: R56789_R1_001.fastq.gz", - " fastq_2: R56789_R2_001.fastq.gz", - " strandedness: unknown", " reads: '1200000'" ], "nfcore_rnafusion_samplesheet_failed.yaml": [ @@ -110,11 +110,6 @@ " strandedness: unknown", " reads: '150'", "- sample: R654322", - " fastq_1: R654322_R1_003.fastq.gz", - " fastq_2: R654322_R2_003.fastq.gz", - " strandedness: unknown", - " reads: '150'", - "- sample: R654322", " fastq_1: R654322_R1_001.fastq.gz", " fastq_2: R654322_R2_001.fastq.gz", " strandedness: unknown", @@ -123,11 +118,16 @@ " fastq_1: R654322_R1_002.fastq.gz", " fastq_2: R654322_R2_002.fastq.gz", " strandedness: unknown", + " reads: '150'", + "- sample: R654322", + " fastq_1: R654322_R1_003.fastq.gz", + " fastq_2: R654322_R2_003.fastq.gz", + " strandedness: unknown", " reads: '150'" ] } ], - "timestamp": "2026-07-06T16:53:39.60987321", + "timestamp": "2026-07-06T17:03:47.52897533", "meta": { "nf-test": "0.9.5", "nextflow": "26.04.0" From f5d46c890f64eaf51c2339585b8835ade9a62eaf Mon Sep 17 00:00:00 2001 From: Nicolas Vannieuwkerke Date: Mon, 6 Jul 2026 17:06:45 +0200 Subject: [PATCH 5/6] prek (again) --- .../groovy/nfcmgg/plugin/samplesheets/PipelineObserver.groovy | 2 +- .../nfcmgg/plugin/samplesheets/PreprocessingObserver.groovy | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/main/groovy/nfcmgg/plugin/samplesheets/PipelineObserver.groovy b/src/main/groovy/nfcmgg/plugin/samplesheets/PipelineObserver.groovy index e0f22f0..94a6be6 100644 --- a/src/main/groovy/nfcmgg/plugin/samplesheets/PipelineObserver.groovy +++ b/src/main/groovy/nfcmgg/plugin/samplesheets/PipelineObserver.groovy @@ -120,7 +120,7 @@ class PipelineObserver implements TraceObserverV2 { "Multiple possible samples found for path '$basePath': $possibleSamples, using '$sample' as sample name, because it is the longest match" ) } - entries.putIfAbsent(sample, new OutputEntry(['id': sample] as Map + getDefaultValuesForSample(sample))) + entries.putIfAbsent(sample, new OutputEntry(['id': sample] + getDefaultValuesForSample(sample))) return sample } diff --git a/src/main/groovy/nfcmgg/plugin/samplesheets/PreprocessingObserver.groovy b/src/main/groovy/nfcmgg/plugin/samplesheets/PreprocessingObserver.groovy index 472f233..df86dfc 100644 --- a/src/main/groovy/nfcmgg/plugin/samplesheets/PreprocessingObserver.groovy +++ b/src/main/groovy/nfcmgg/plugin/samplesheets/PreprocessingObserver.groovy @@ -50,7 +50,7 @@ class PreprocessingObserver extends PipelineObserver { String yield = metric['yield_'] entries.putIfAbsent( sample, - new OutputEntry(['id': sample] as Map + getDefaultValuesForSample(sample)) + new OutputEntry(['id': sample] + getDefaultValuesForSample(sample)) ) entries[sample].add('yield', yield) } From 9b6252a7b8a4cbc4f0e87c91e05bc945df5c74f1 Mon Sep 17 00:00:00 2001 From: Nicolas Vannieuwkerke Date: Mon, 6 Jul 2026 17:10:54 +0200 Subject: [PATCH 6/6] revert last commit and apply ignore rule --- .../nfcmgg/plugin/samplesheets/PipelineObserver.groovy | 6 +++++- .../nfcmgg/plugin/samplesheets/PreprocessingObserver.groovy | 3 ++- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/src/main/groovy/nfcmgg/plugin/samplesheets/PipelineObserver.groovy b/src/main/groovy/nfcmgg/plugin/samplesheets/PipelineObserver.groovy index 94a6be6..3c777f7 100644 --- a/src/main/groovy/nfcmgg/plugin/samplesheets/PipelineObserver.groovy +++ b/src/main/groovy/nfcmgg/plugin/samplesheets/PipelineObserver.groovy @@ -120,7 +120,11 @@ class PipelineObserver implements TraceObserverV2 { "Multiple possible samples found for path '$basePath': $possibleSamples, using '$sample' as sample name, because it is the longest match" ) } - entries.putIfAbsent(sample, new OutputEntry(['id': sample] + getDefaultValuesForSample(sample))) + entries.putIfAbsent( + sample, + /* groovylint-disable-next-line UnnecessaryCast */ + new OutputEntry(['id': sample] as Map + getDefaultValuesForSample(sample)) + ) return sample } diff --git a/src/main/groovy/nfcmgg/plugin/samplesheets/PreprocessingObserver.groovy b/src/main/groovy/nfcmgg/plugin/samplesheets/PreprocessingObserver.groovy index df86dfc..1d10c98 100644 --- a/src/main/groovy/nfcmgg/plugin/samplesheets/PreprocessingObserver.groovy +++ b/src/main/groovy/nfcmgg/plugin/samplesheets/PreprocessingObserver.groovy @@ -50,7 +50,8 @@ class PreprocessingObserver extends PipelineObserver { String yield = metric['yield_'] entries.putIfAbsent( sample, - new OutputEntry(['id': sample] + getDefaultValuesForSample(sample)) + /* groovylint-disable-next-line UnnecessaryCast */ + new OutputEntry(['id': sample] as Map + getDefaultValuesForSample(sample)) ) entries[sample].add('yield', yield) }