diff --git a/subworkflows/nf-core/abundance_differential_filter/main.nf b/subworkflows/nf-core/abundance_differential_filter/main.nf index ba2304a2739..8d9469e579f 100644 --- a/subworkflows/nf-core/abundance_differential_filter/main.nf +++ b/subworkflows/nf-core/abundance_differential_filter/main.nf @@ -31,18 +31,16 @@ workflow ABUNDANCE_DIFFERENTIAL_FILTER { // Set up how the channels crossed below will be used to generate channels for processing def criteria = multiMapCriteria { meta_input, abundance, analysis_method, fc_threshold, stat_threshold, meta_exp, samplesheet, meta_contrasts, variable, reference, target -> + def meta_for_diff = mergeMaps(meta_contrasts, meta_input) + [ 'method': analysis_method ] + def meta_input_new = meta_input + [ 'method': analysis_method ] samples_and_matrix: - meta_map = meta_input + [ 'method': analysis_method ] - [meta_map, samplesheet, abundance] - contrasts: - meta_map = mergeMaps(meta_contrasts, meta_input) + [ 'method': analysis_method ] - [ meta_map, variable, reference, target ] + [ meta_input_new, samplesheet, abundance ] + contrasts_for_diff: + [ meta_for_diff, variable, reference, target ] filter_params: - meta_map = mergeMaps(meta_contrasts, meta_input) + [ 'method': analysis_method ] - [meta_map, [ 'fc_threshold': fc_threshold, 'stat_threshold': stat_threshold ]] + [ meta_for_diff, [ 'fc_threshold': fc_threshold, 'stat_threshold': stat_threshold ]] contrasts_for_norm: - meta_map = meta_input + [ 'method': analysis_method ] - [ meta_map, variable, reference, target ] + [ meta_input_new, variable, reference, target ] } // For DIFFERENTIAL modules we need to cross the things we're iterating so we @@ -61,13 +59,13 @@ workflow ABUNDANCE_DIFFERENTIAL_FILTER { // depending on the contrast setting etc, these modules may subset matrices, // hence not returning the full normalized matrix as NORM modules would do. LIMMA_NORM( - inputs.contrasts_for_norm.filter{it[0].method == 'limma'}.unique(), - inputs.samples_and_matrix.filter{it[0].method == 'limma'}.unique() + norm_inputs.contrasts_for_norm.filter{it[0].method == 'limma'}, + norm_inputs.samples_and_matrix.filter{it[0].method == 'limma'} ) LIMMA_DIFFERENTIAL( - inputs.contrasts.filter{it[0].method == 'limma'}, - inputs.samples_and_matrix.filter { it[0].method == 'limma' } + inputs.contrasts_for_diff.filter{ it[0].method == 'limma' }, + inputs.samples_and_matrix.filter{ it[0].method == 'limma' } ) // ---------------------------------------------------- @@ -79,14 +77,14 @@ workflow ABUNDANCE_DIFFERENTIAL_FILTER { // depending on the contrast setting etc, these modules may subset matrices, // hence not returning the full normalized matrix as NORM modules would do. DESEQ2_NORM( - inputs.contrasts_for_norm.filter{it[0].method == 'deseq2'}.unique(), - inputs.samples_and_matrix.filter{it[0].method == 'deseq2'}.unique(), + norm_inputs.contrasts_for_norm.filter{it[0].method == 'deseq2'}, + norm_inputs.samples_and_matrix.filter{it[0].method == 'deseq2'}, ch_control_features.first(), ch_transcript_lengths.first() ) DESEQ2_DIFFERENTIAL( - inputs.contrasts.filter{it[0].method == 'deseq2'}, + inputs.contrasts_for_diff.filter{it[0].method == 'deseq2'}, inputs.samples_and_matrix.filter{it[0].method == 'deseq2'}, ch_control_features.first(), ch_transcript_lengths.first() @@ -99,7 +97,7 @@ workflow ABUNDANCE_DIFFERENTIAL_FILTER { // NOTE that this method don't rely on normalization, hence it does // not produce a normalized matrix. PROPR_PROPD( - inputs.contrasts.filter{it[0].method == 'propd'}, + inputs.contrasts_for_diff.filter{it[0].method == 'propd'}, inputs.samples_and_matrix.filter { it[0].method == 'propd' } ) diff --git a/subworkflows/nf-core/abundance_differential_filter/tests/main.nf.test.snap b/subworkflows/nf-core/abundance_differential_filter/tests/main.nf.test.snap index 8e248536e8e..6795359ae88 100644 --- a/subworkflows/nf-core/abundance_differential_filter/tests/main.nf.test.snap +++ b/subworkflows/nf-core/abundance_differential_filter/tests/main.nf.test.snap @@ -28,7 +28,7 @@ ] ], [ - + ], [ [ @@ -48,9 +48,9 @@ ], "meta": { "nf-test": "0.9.2", - "nextflow": "24.10.2" + "nextflow": "24.10.3" }, - "timestamp": "2024-12-07T16:33:03.091762783" + "timestamp": "2025-01-14T16:51:17.162826924" }, "deseq2 and limma - mouse - basic": { "content": [ @@ -234,9 +234,9 @@ ], "meta": { "nf-test": "0.9.2", - "nextflow": "24.10.2" + "nextflow": "24.10.3" }, - "timestamp": "2024-12-07T16:34:54.548033825" + "timestamp": "2025-01-14T16:53:11.245100955" }, "limma - voom": { "content": [ @@ -308,9 +308,9 @@ ], "meta": { "nf-test": "0.9.2", - "nextflow": "24.10.2" + "nextflow": "24.10.3" }, - "timestamp": "2024-12-07T16:33:26.97858478" + "timestamp": "2025-01-14T16:51:32.460857013" }, "deseq2 + limma-voom + propd - mouse - basic": { "content": [ @@ -568,9 +568,9 @@ ], "meta": { "nf-test": "0.9.2", - "nextflow": "24.10.2" + "nextflow": "24.10.3" }, - "timestamp": "2024-12-13T16:07:08.941008861" + "timestamp": "2025-01-14T16:53:54.80697542" }, "stub": { "content": [ @@ -628,7 +628,7 @@ ] ], "2": [ - + ], "3": [ [ @@ -677,7 +677,7 @@ "versions.yml:md5,05e3901f6d78f8839a7e07f422e9bc03" ], "adjacency": [ - + ], "model": [ [ @@ -781,9 +781,9 @@ ], "meta": { "nf-test": "0.9.2", - "nextflow": "24.10.2" + "nextflow": "24.10.3" }, - "timestamp": "2024-12-13T15:08:45.989521056" + "timestamp": "2025-01-14T16:54:12.823125892" }, "deseq2 - mouse - basic": { "content": [ @@ -888,9 +888,9 @@ ], "meta": { "nf-test": "0.9.2", - "nextflow": "24.10.2" + "nextflow": "24.10.3" }, - "timestamp": "2024-12-07T16:32:17.301539736" + "timestamp": "2025-01-14T16:50:35.085607799" }, "deseq2 - with transcript lengths": { "content": [ @@ -995,9 +995,9 @@ ], "meta": { "nf-test": "0.9.2", - "nextflow": "24.10.2" + "nextflow": "24.10.3" }, - "timestamp": "2024-12-07T16:34:05.584119298" + "timestamp": "2025-01-14T16:52:07.822745077" }, "propd - mouse - basic": { "content": [ @@ -1084,8 +1084,8 @@ ], "meta": { "nf-test": "0.9.2", - "nextflow": "24.10.2" + "nextflow": "24.10.3" }, - "timestamp": "2024-12-13T15:02:45.903371649" + "timestamp": "2025-01-14T16:52:25.336720308" } -} +} \ No newline at end of file