Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update diff subworkflows #7414

Merged
merged 20 commits into from
Feb 13, 2025
Merged
Show file tree
Hide file tree
Changes from 5 commits
Commits
Show all changes
20 commits
Select commit Hold shift + click to select a range
8c36fae
[gsea] unable default seed option
suzannejin Jan 31, 2025
425d970
[subworkflow] update abundance_differential_filter to output a list o…
suzannejin Jan 31, 2025
2841259
[gsea] add module test config
suzannejin Jan 31, 2025
0aad0e9
update functional subworkflow. Also update gprofiler2 related snapsho…
suzannejin Jan 31, 2025
ed9ecd0
[gprofiler2] add option to specify the database archive
suzannejin Jan 31, 2025
24429b5
[gsea] remove default seed set in gsea module
suzannejin Feb 4, 2025
2d1f174
Merge branch 'master' into update_diff_subworkflows
suzannejin Feb 4, 2025
a227160
change(abundance_differential_filter): use groupTuple for ch_variance…
suzannejin Feb 4, 2025
e77e7fa
change(differential and functional subworkflows): add back mergeMap a…
suzannejin Feb 4, 2025
e882d58
fix(snapshot): update gprofiler2/gost test snapshots
suzannejin Feb 4, 2025
0a0aee1
fix(gprofiler2_gost): set base url to an old archive for reproducibil…
suzannejin Feb 5, 2025
06a5920
Merge branch 'master' into update_diff_subworkflows
suzannejin Feb 5, 2025
e244d04
Merge branch 'master' into update_diff_subworkflows
suzannejin Feb 6, 2025
cb18f41
fix(gprofiler2_gost): update test snapshots to match with the latest …
suzannejin Feb 7, 2025
658dc35
Merge branch 'master' into update_diff_subworkflows
suzannejin Feb 7, 2025
5a2827e
simplify ch_variance_stabilised_matrix with groupTuple()
suzannejin Feb 12, 2025
fab2122
Merge branch 'master' into update_diff_subworkflows
suzannejin Feb 12, 2025
441d5b5
update propd container
suzannejin Feb 13, 2025
efc5e1a
update differential and functional subworkflows by replacing 'method'…
suzannejin Feb 13, 2025
ee7df96
fix: update version snapshots for the new propd container
suzannejin Feb 13, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 5 additions & 2 deletions modules/nf-core/gprofiler2/gost/templates/gprofiler2_gost.R
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,8 @@ opt <- list(
domain_scope = 'annotated',
min_diff = 1,
round_digits = -1,
palette_name = 'Blues'
palette_name = 'Blues',
archive = 'gprofiler'
)

opt_types <- lapply(opt, class)
Expand Down Expand Up @@ -182,6 +183,8 @@ for (file_input in c('de_file')) {
}
}

print(opt)

################################################
################################################
## Finish loading libraries ##
Expand Down Expand Up @@ -235,7 +238,7 @@ if (nrow(de.genes) > 0) {
} else if (!is.null(opt\$organism)) {

# Next, check if organism was provided. Get the GMT file from gprofiler and save both the full file as well as the filtered one to metadata
gmt_url <- paste0("https://biit.cs.ut.ee/gprofiler//static/gprofiler_full_", opt\$organism, ".ENSG.gmt")
gmt_url <- paste0("https://biit.cs.ut.ee/", opt\$archive, "//static/gprofiler_full_", opt\$organism, ".ENSG.gmt")
tryCatch(
{
gmt_path <- paste0("gprofiler_full_", opt\$organism, ".ENSG.gmt")
Expand Down
3 changes: 2 additions & 1 deletion modules/nf-core/gprofiler2/gost/tests/main.nf.test
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,8 @@ nextflow_process {
((params.gprofiler2_token == null) ? '' : "--token \"${params.gprofiler2_token}\""),
((params.gprofiler2_organism == null) ? '' : "--organism \"${params.gprofiler2_organism}\""),
((params.gprofiler2_background_column == null) ? '' : "--background_column \"${params.gprofiler2_background_column}\""),
((params.gprofiler2_sources == null) ? '' : "--sources \"${params.gprofiler2_sources}\"")
((params.gprofiler2_sources == null) ? '' : "--sources \"${params.gprofiler2_sources}\""),
"--archive gprofiler_archive3/e111_eg58_p18"
].join(' ').trim()
}
process {
Expand Down
28 changes: 13 additions & 15 deletions modules/nf-core/gprofiler2/gost/tests/main.nf.test.snap
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
"target": "KO",
"blocking": "batch"
},
"Condition_genotype_WT_KO.gprofiler2.all_enriched_pathways.tsv:md5,1134a02ca061c463bcbff277eefbfb19"
"Condition_genotype_WT_KO.gprofiler2.all_enriched_pathways.tsv:md5,396712577c32213078d1604b1ba247de"
]
],
[
Expand All @@ -23,15 +23,14 @@
"blocking": "batch"
},
[
"Condition_genotype_WT_KO.gprofiler2.GO:BP.sub_enriched_pathways.tsv:md5,d527b94cdb160070bcaa0bfb0cecf914",
"Condition_genotype_WT_KO.gprofiler2.GO:CC.sub_enriched_pathways.tsv:md5,ef418c3f06d50446317928e37ec8ddfb",
"Condition_genotype_WT_KO.gprofiler2.GO:MF.sub_enriched_pathways.tsv:md5,e460d4917feb0b64d334a528f59e0731",
"Condition_genotype_WT_KO.gprofiler2.HP.sub_enriched_pathways.tsv:md5,865d8f092503552831c51d775a98c6eb",
"Condition_genotype_WT_KO.gprofiler2.KEGG.sub_enriched_pathways.tsv:md5,413724002abe683f376ea914d4f21ade",
"Condition_genotype_WT_KO.gprofiler2.MIRNA.sub_enriched_pathways.tsv:md5,fce81051d7af955ddb2925ba2da9ff57",
"Condition_genotype_WT_KO.gprofiler2.REAC.sub_enriched_pathways.tsv:md5,e89e1876698ea644671a0720c85f4dbb",
"Condition_genotype_WT_KO.gprofiler2.TF.sub_enriched_pathways.tsv:md5,e272217ec7fcf01ea463ab8bcc8335cf",
"Condition_genotype_WT_KO.gprofiler2.WP.sub_enriched_pathways.tsv:md5,fdd1efa836d85bb127e933e925290cba"
"Condition_genotype_WT_KO.gprofiler2.GO:BP.sub_enriched_pathways.tsv:md5,d6bebdcb2401a7f7de0ec42ad2f4521d",
"Condition_genotype_WT_KO.gprofiler2.GO:CC.sub_enriched_pathways.tsv:md5,98a49b69f8b724d88d6367dea494ca53",
"Condition_genotype_WT_KO.gprofiler2.GO:MF.sub_enriched_pathways.tsv:md5,39ce8238319df47708df78b1c461a89d",
"Condition_genotype_WT_KO.gprofiler2.HP.sub_enriched_pathways.tsv:md5,616f3a5d19844001bb8aac38049e987a",
"Condition_genotype_WT_KO.gprofiler2.MIRNA.sub_enriched_pathways.tsv:md5,486ed1510dc8bba867686b021d6e6339",
"Condition_genotype_WT_KO.gprofiler2.REAC.sub_enriched_pathways.tsv:md5,3571ac765c47e1c38c63c463465f2a1e",
"Condition_genotype_WT_KO.gprofiler2.TF.sub_enriched_pathways.tsv:md5,032491e63bb381cc9a4d7740473efc5b",
"Condition_genotype_WT_KO.gprofiler2.WP.sub_enriched_pathways.tsv:md5,e99c42df912a9ee75c7197f92d615979"
]
]
],
Expand All @@ -41,14 +40,13 @@
"Condition_genotype_WT_KO.gprofiler2.GO:CC.sub_enriched_pathways.png",
"Condition_genotype_WT_KO.gprofiler2.GO:MF.sub_enriched_pathways.png",
"Condition_genotype_WT_KO.gprofiler2.HP.sub_enriched_pathways.png",
"Condition_genotype_WT_KO.gprofiler2.KEGG.sub_enriched_pathways.png",
"Condition_genotype_WT_KO.gprofiler2.MIRNA.sub_enriched_pathways.png",
"Condition_genotype_WT_KO.gprofiler2.REAC.sub_enriched_pathways.png",
"Condition_genotype_WT_KO.gprofiler2.TF.sub_enriched_pathways.png",
"Condition_genotype_WT_KO.gprofiler2.WP.sub_enriched_pathways.png"
],
[

],
[
"R_sessionInfo.log"
Expand All @@ -65,9 +63,9 @@
],
"meta": {
"nf-test": "0.9.2",
"nextflow": "24.10.3"
"nextflow": "24.10.4"
},
"timestamp": "2025-01-21T11:29:54.746689985"
"timestamp": "2025-01-31T15:16:54.617930264"
},
"stub": {
"content": [
Expand Down Expand Up @@ -278,4 +276,4 @@
},
"timestamp": "2025-01-21T11:31:33.394855046"
}
}
}
2 changes: 1 addition & 1 deletion modules/nf-core/gprofiler2/gost/tests/nextflow.config
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
process {
ext.args = params.module_args
}
}
2 changes: 1 addition & 1 deletion modules/nf-core/gsea/gsea/main.nf
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ process GSEA_GSEA {
def rpt_label = prefix.replaceAll('\\.$', '') // Remove any trailing dots from prefix when passed as report label, so GSEA doesn't produce double-dotted top-level outputs
def chip_command = chip ? "-chip $chip -collapse true" : ''
def VERSION = '4.3.2' // WARN: Version information not provided by tool on CLI. Please update this string when bumping container versions.
if (!(args ==~ /.*-rnd_seed.*/)) {args += " -rnd_seed 10"}
// if (!(args ==~ /.*-rnd_seed.*/)) {args += " -rnd_seed 10"} // unable this for the moment, until a global seed option is set for differentialabundance pipeline

"""
# Run GSEA
Expand Down
2 changes: 2 additions & 0 deletions modules/nf-core/gsea/gsea/tests/main.nf.test
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@ nextflow_process {

test("test") {

config "./nextflow.config"

when {
process {
"""
Expand Down
5 changes: 5 additions & 0 deletions modules/nf-core/gsea/gsea/tests/nextflow.config
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
process {
withName: 'GSEA_GSEA' {
ext.args = { "-rnd_seed 10" }
}
}
22 changes: 14 additions & 8 deletions subworkflows/nf-core/abundance_differential_filter/main.nf
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,6 @@ include { DESEQ2_DIFFERENTIAL as DESEQ2_NORM } from '../../../modules/nf-core/d
include { PROPR_PROPD } from '../../../modules/nf-core/propr/propd/main'
include { CUSTOM_FILTERDIFFERENTIALTABLE } from '../../../modules/nf-core/custom/filterdifferentialtable/main'

// Combine meta maps, including merging non-identical values of shared keys (e.g. 'id')
def mergeMaps(meta, meta2){
(meta + meta2).collectEntries { k, v ->
meta[k] && meta[k] != v ? [k, "${meta[k]}_${v}"] : [k, v]
}
}

workflow ABUNDANCE_DIFFERENTIAL_FILTER {
take:
Expand All @@ -31,7 +25,7 @@ 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_for_diff = meta_input + meta_contrasts + [ 'method': analysis_method ]
def meta_input_new = meta_input + [ 'method': analysis_method ]
samples_and_matrix:
[ meta_input_new, samplesheet, abundance ]
Expand Down Expand Up @@ -131,6 +125,18 @@ workflow ABUNDANCE_DIFFERENTIAL_FILTER {
ch_model = DESEQ2_DIFFERENTIAL.out.model
.mix(LIMMA_DIFFERENTIAL.out.model)

ch_variance_stabilised_matrix = DESEQ2_NORM.out.rlog_counts.ifEmpty([[],[]])
.combine(DESEQ2_NORM.out.vst_counts.ifEmpty([[],[]]))
.map { meta_rlog, rlog, meta_vst, vst ->
if (meta_rlog == meta_vst && meta_rlog != []) {
return [meta_rlog, [rlog, vst]]
} else if (meta_rlog != [] && meta_vst == []) {
return [meta_rlog, [rlog]]
} else if (meta_rlog == [] && meta_vst != []) {
return [meta_vst, [vst]]
}
}

ch_versions = DESEQ2_DIFFERENTIAL.out.versions
.mix(LIMMA_DIFFERENTIAL.out.versions)
.mix(PROPR_PROPD.out.versions)
Expand Down Expand Up @@ -186,7 +192,7 @@ workflow ABUNDANCE_DIFFERENTIAL_FILTER {

// other
normalised_matrix = ch_normalised_matrix
variance_stabilised_matrix = DESEQ2_NORM.out.rlog_counts.mix(DESEQ2_NORM.out.vst_counts)
variance_stabilised_matrix = ch_variance_stabilised_matrix
model = ch_model
versions = ch_versions
}
7 changes: 4 additions & 3 deletions subworkflows/nf-core/abundance_differential_filter/meta.yml
Original file line number Diff line number Diff line change
Expand Up @@ -116,10 +116,11 @@ output:
- meta:
type: map
description: Metadata map
- matrix:
type: file
description: Variance stabilised count matrix file
- matrices:
type: list
description: A list of variance stabilised count matrix files
pattern: "*.{csv,tsv}"

- model:
description: Channel containing statistical model object from differential analysis
structure:
Expand Down
Loading
Loading