Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
10 changes: 10 additions & 0 deletions conf/modules.config
Original file line number Diff line number Diff line change
Expand Up @@ -619,6 +619,16 @@ process {
memory = { 36.GB * task.attempt }
}

withName: ".*:FIMO:SELECT_SIGNIFICANT" {
ext.args = {"'NR==1 || \$9 <= ${params.fimo_qvalue_threshold}'"}
ext.prefix = {"${meta.id}_significant"}
publishDir = [
path: { "${params.outdir}/06_fimo/05_significant_results" },
mode: params.publish_dir_mode,
saveAs: { filename -> filename.equals('versions.yml') ? null : filename }
]
}

/*
SNEEP
*/
Expand Down
3 changes: 3 additions & 0 deletions nextflow.config
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,9 @@ params {
// SNEEP options
skip_sneep = false

// FIMO options
fimo_qvalue_threshold = 0.05

dynamite_ofolds = 3
dynamite_ifolds = 6
dynamite_alpha = 0.1
Expand Down
18 changes: 18 additions & 0 deletions nextflow_schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -270,6 +270,21 @@
}
}
},
"fimo_options": {
"title": "FIMO options",
"type": "object",
"fa_icon": "fas fa-search",
"description": "Options for FIMO (Find Individual Motif Occurrences) analysis.",
"properties": {
"fimo_qvalue_threshold": {
"type": "number",
"default": 0.05,
"description": "Q-value threshold for filtering significant FIMO results.",
"fa_icon": "fas fa-filter",
"help_text": "Q-value threshold for filtering significant FIMO results. Only motif occurrences with q-values below this threshold will be kept. The default value is 0.05."
}
}
},
"dynamite_options": {
"title": "DYNAMITE options",
"type": "object",
Expand Down Expand Up @@ -582,6 +597,9 @@
{
"$ref": "#/$defs/optional_steps"
},
{
"$ref": "#/$defs/fimo_options"
},
{
"$ref": "#/$defs/dynamite_options"
},
Expand Down
11 changes: 8 additions & 3 deletions subworkflows/local/fimo/main.nf
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ include { GAWK as CONCAT_FILTER_GFF } from "../../../modules/nf-core
include { GNU_SORT as SORT_GFF } from "../../../modules/nf-core/gnu/sort"
include { GAWK as CONCAT_FILTER_TSV } from "../../../modules/nf-core/gawk"
include { CSVTK_SORT as SORT_TSV } from '../../../modules/nf-core/csvtk/sort'
include { GAWK as SELECT_SIGNIFICANT } from "../../../modules/nf-core/gawk"

workflow FIMO {
take:
Expand Down Expand Up @@ -67,8 +68,12 @@ workflow FIMO {
SORT_TSV(CONCAT_FILTER_TSV.out.output, 'tsv', 'tsv')
ch_versions = ch_versions.mix(SORT_TSV.out.versions)

SELECT_SIGNIFICANT(SORT_TSV.out.sorted, [], false)
ch_versions = ch_versions.mix(SELECT_SIGNIFICANT.out.versions)

emit:
gff = SORT_GFF.out.sorted
tsv = SORT_TSV.out.sorted
versions = ch_versions
gff = SORT_GFF.out.sorted
tsv = SORT_TSV.out.sorted
tsv_significant = SELECT_SIGNIFICANT.out.output
versions = ch_versions
}
48 changes: 42 additions & 6 deletions subworkflows/local/fimo/tests/main.nf.test.snap
Original file line number Diff line number Diff line change
Expand Up @@ -19,13 +19,22 @@
]
],
"2": [
[
{
"id": "L10_chromHMM_promoters"
},
"L10_chromHMM_promoters_significant.tsv:md5,d41d8cd98f00b204e9800998ecf8427e"
]
],
"3": [
"versions.yml:md5,09deaa382cdc983ffad29500b0c47210",
"versions.yml:md5,270cc8fd3cf5da52f09e2bcfb66844d1",
"versions.yml:md5,37d1f45c834fbc3c356023cdfed0918a",
"versions.yml:md5,612da238fbeb03191d349ddc72093946",
"versions.yml:md5,612da238fbeb03191d349ddc72093946",
"versions.yml:md5,612da238fbeb03191d349ddc72093946",
"versions.yml:md5,c1dfd15a1f2163efd0fc318809c8a071",
"versions.yml:md5,d9cf2bc9a6b5f0916586f0b5184b580f",
"versions.yml:md5,def0f65b2a7925e2541586ea7ad06118",
"versions.yml:md5,e50e1883b0220a195e1c520411dcbc63"
],
Expand All @@ -45,6 +54,14 @@
"L10_chromHMM_promoters.tsv:md5,d41d8cd98f00b204e9800998ecf8427e"
]
],
"tsv_significant": [
[
{
"id": "L10_chromHMM_promoters"
},
"L10_chromHMM_promoters_significant.tsv:md5,d41d8cd98f00b204e9800998ecf8427e"
]
],
"versions": [
"versions.yml:md5,09deaa382cdc983ffad29500b0c47210",
"versions.yml:md5,270cc8fd3cf5da52f09e2bcfb66844d1",
Expand All @@ -53,16 +70,17 @@
"versions.yml:md5,612da238fbeb03191d349ddc72093946",
"versions.yml:md5,612da238fbeb03191d349ddc72093946",
"versions.yml:md5,c1dfd15a1f2163efd0fc318809c8a071",
"versions.yml:md5,d9cf2bc9a6b5f0916586f0b5184b580f",
"versions.yml:md5,def0f65b2a7925e2541586ea7ad06118",
"versions.yml:md5,e50e1883b0220a195e1c520411dcbc63"
]
}
],
"meta": {
"nf-test": "0.9.2",
"nextflow": "25.04.2"
"nextflow": "25.10.0"
},
"timestamp": "2025-09-28T13:45:59.335325874"
"timestamp": "2025-11-13T18:36:04.422878191"
},
"Should run without failures": {
"content": [
Expand All @@ -80,16 +98,25 @@
{
"id": "L10_chromHMM_promoters"
},
"L10_chromHMM_promoters.tsv:md5,b9dccc98df70fa127fed3ec9f5d2b0cd"
"L10_chromHMM_promoters.tsv:md5,903892dbd88b1cf1fe69f6e85ede5974"
]
],
"2": [
[
{
"id": "L10_chromHMM_promoters"
},
"L10_chromHMM_promoters_significant.tsv:md5,6ec71314deae3fb80be236a018899406"
]
],
"3": [
"versions.yml:md5,270cc8fd3cf5da52f09e2bcfb66844d1",
"versions.yml:md5,37d1f45c834fbc3c356023cdfed0918a",
"versions.yml:md5,612da238fbeb03191d349ddc72093946",
"versions.yml:md5,612da238fbeb03191d349ddc72093946",
"versions.yml:md5,91d4e73ea846dae7e805279e47204dc7",
"versions.yml:md5,c1dfd15a1f2163efd0fc318809c8a071",
"versions.yml:md5,d9cf2bc9a6b5f0916586f0b5184b580f",
"versions.yml:md5,def0f65b2a7925e2541586ea7ad06118",
"versions.yml:md5,e50e1883b0220a195e1c520411dcbc63"
],
Expand All @@ -106,7 +133,15 @@
{
"id": "L10_chromHMM_promoters"
},
"L10_chromHMM_promoters.tsv:md5,b9dccc98df70fa127fed3ec9f5d2b0cd"
Comment thread
LeonHafner marked this conversation as resolved.
"L10_chromHMM_promoters.tsv:md5,903892dbd88b1cf1fe69f6e85ede5974"
]
],
"tsv_significant": [
[
{
"id": "L10_chromHMM_promoters"
},
"L10_chromHMM_promoters_significant.tsv:md5,6ec71314deae3fb80be236a018899406"
]
],
"versions": [
Expand All @@ -116,15 +151,16 @@
"versions.yml:md5,612da238fbeb03191d349ddc72093946",
"versions.yml:md5,91d4e73ea846dae7e805279e47204dc7",
"versions.yml:md5,c1dfd15a1f2163efd0fc318809c8a071",
"versions.yml:md5,d9cf2bc9a6b5f0916586f0b5184b580f",
"versions.yml:md5,def0f65b2a7925e2541586ea7ad06118",
"versions.yml:md5,e50e1883b0220a195e1c520411dcbc63"
]
}
],
"meta": {
"nf-test": "0.9.2",
"nextflow": "25.04.2"
"nextflow": "25.10.0"
},
"timestamp": "2025-09-28T13:45:35.150219947"
"timestamp": "2025-11-13T18:35:49.650684716"
}
}
7 changes: 6 additions & 1 deletion subworkflows/local/fimo/tests/nextflow.config
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,12 @@ process {
ext.args = "-v HEADER='motif_id\\tmotif_alt_id\\tsequence_name\\tstart\\tstop\\tstrand\\tscore\\tp-value\\tq-value\\tmatched_sequence' 'BEGIN {print HEADER} FNR==1 {next} /^#/ {next} NF==0 {next} {print}'"
}

withName: ".*:FIMO:SORT_TSV" {
withName: "FIMO:SORT_TSV" {
ext.args = "-k motif_id:N -k sequence_name:N -k start:n -k stop:n -k strand -k score:nr -k p-value:n -k q-value:n -k matched_sequence"
Comment thread
LeonHafner marked this conversation as resolved.
}

withName: "FIMO:SELECT_SIGNIFICANT" {
ext.args = {"'NR==1 || \$9 <= 0.4'"}
ext.prefix = {"${meta.id}_significant"}
}
}
52 changes: 46 additions & 6 deletions tests/default.nf.test.snap
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"Should run with bed only": {
"content": [
174,
179,
{
"AFFINITY_MEAN": {
"numpy": "2.2.6",
Expand Down Expand Up @@ -143,6 +143,9 @@
"RUN_FIMO": {
"fimo": "5.5.8"
},
"SELECT_SIGNIFICANT": {
"gawk": "5.3.0"
},
"SORT_BED": {
"coreutils": 9.3
},
Expand Down Expand Up @@ -599,6 +602,12 @@
"06_fimo/04_combined_results/tsv/L1_H3K4me3.tsv",
"06_fimo/04_combined_results/tsv/p6_H3K27ac.tsv",
"06_fimo/04_combined_results/tsv/p6_H3K4me3.tsv",
"06_fimo/05_significant_results",
"06_fimo/05_significant_results/L10_H3K27ac_significant.tsv",
"06_fimo/05_significant_results/L1_H3K27ac_significant.tsv",
"06_fimo/05_significant_results/L1_H3K4me3_significant.tsv",
"06_fimo/05_significant_results/p6_H3K27ac_significant.tsv",
"06_fimo/05_significant_results/p6_H3K4me3_significant.tsv",
"07_sneep",
"07_sneep/01_filtered_scales_motifs",
"07_sneep/01_filtered_scales_motifs/filtered_sneep_scale_mouse_218.txt",
Expand Down Expand Up @@ -3949,6 +3958,11 @@
"L1_H3K4me3.tsv:md5,234fdab4f7c07b423f8f022b6c3d0d8a",
"p6_H3K27ac.tsv:md5,d75f51f8af229ad6082a3bbe38f94f14",
"p6_H3K4me3.tsv:md5,b1004c2222c3b0e75062dbb0083d46eb",
"L10_H3K27ac_significant.tsv:md5,cd7825b546b90fc8e7a8eb1cc8533ca3",
"L1_H3K27ac_significant.tsv:md5,0700a8ce866a2ca40795461eecf1bdf6",
"L1_H3K4me3_significant.tsv:md5,a2b971328c33a981678d90d16849c272",
"p6_H3K27ac_significant.tsv:md5,cd7825b546b90fc8e7a8eb1cc8533ca3",
"p6_H3K4me3_significant.tsv:md5,cd7825b546b90fc8e7a8eb1cc8533ca3",
"filtered_sneep_scale_mouse_218.txt:md5,26199aaf8103de723163c03bfa8b88b2",
"filtered_sneep_transfac_mouse_218.txt:md5,d41d8cd98f00b204e9800998ecf8427e",
"L10_H3K27ac.bed:md5,4e48a06e991fdd12712c25823eebc5be",
Expand All @@ -3975,13 +3989,13 @@
],
"meta": {
"nf-test": "0.9.2",
"nextflow": "25.04.2"
"nextflow": "25.10.0"
},
"timestamp": "2025-09-28T13:58:48.753999494"
"timestamp": "2025-11-13T19:36:12.666238946"
},
"Should run with both bed and bam input": {
"content": [
396,
407,
{
"AFFINITY_MEAN": {
"numpy": "2.2.6",
Expand Down Expand Up @@ -4148,6 +4162,9 @@
"RUN_FIMO": {
"fimo": "5.5.8"
},
"SELECT_SIGNIFICANT": {
"gawk": "5.3.0"
},
"SORT_BED": {
"coreutils": 9.3
},
Expand Down Expand Up @@ -5163,6 +5180,18 @@
"06_fimo/04_combined_results/tsv/p6_H3K4me3.tsv",
"06_fimo/04_combined_results/tsv/p6_chromHMM_enhancers.tsv",
"06_fimo/04_combined_results/tsv/p6_chromHMM_promoters.tsv",
"06_fimo/05_significant_results",
"06_fimo/05_significant_results/L10_H3K27ac_significant.tsv",
"06_fimo/05_significant_results/L10_chromHMM_enhancers_significant.tsv",
"06_fimo/05_significant_results/L10_chromHMM_promoters_significant.tsv",
"06_fimo/05_significant_results/L1_H3K27ac_significant.tsv",
"06_fimo/05_significant_results/L1_H3K4me3_significant.tsv",
"06_fimo/05_significant_results/L1_chromHMM_enhancers_significant.tsv",
"06_fimo/05_significant_results/L1_chromHMM_promoters_significant.tsv",
"06_fimo/05_significant_results/p6_H3K27ac_significant.tsv",
"06_fimo/05_significant_results/p6_H3K4me3_significant.tsv",
"06_fimo/05_significant_results/p6_chromHMM_enhancers_significant.tsv",
"06_fimo/05_significant_results/p6_chromHMM_promoters_significant.tsv",
"07_sneep",
"07_sneep/01_filtered_scales_motifs",
"07_sneep/01_filtered_scales_motifs/filtered_sneep_scale_mouse_218.txt",
Expand Down Expand Up @@ -10054,6 +10083,17 @@
"p6_H3K4me3.tsv:md5,264817038ac5cd1062b224364c96a451",
"p6_chromHMM_enhancers.tsv:md5,38f7bdbc36fbe617905a88934d402630",
"p6_chromHMM_promoters.tsv:md5,95a3cfa56a471160f6d1d2b35ddd5362",
"L10_H3K27ac_significant.tsv:md5,cd7825b546b90fc8e7a8eb1cc8533ca3",
"L10_chromHMM_enhancers_significant.tsv:md5,cd7825b546b90fc8e7a8eb1cc8533ca3",
"L10_chromHMM_promoters_significant.tsv:md5,8a21488440735b59233f13af69d9d387",
"L1_H3K27ac_significant.tsv:md5,0700a8ce866a2ca40795461eecf1bdf6",
"L1_H3K4me3_significant.tsv:md5,a2b971328c33a981678d90d16849c272",
"L1_chromHMM_enhancers_significant.tsv:md5,cd7825b546b90fc8e7a8eb1cc8533ca3",
"L1_chromHMM_promoters_significant.tsv:md5,4695ea8aec0374345d4276338add6d75",
"p6_H3K27ac_significant.tsv:md5,cd7825b546b90fc8e7a8eb1cc8533ca3",
"p6_H3K4me3_significant.tsv:md5,cd7825b546b90fc8e7a8eb1cc8533ca3",
"p6_chromHMM_enhancers_significant.tsv:md5,cd7825b546b90fc8e7a8eb1cc8533ca3",
"p6_chromHMM_promoters_significant.tsv:md5,188507b513f0016ecb82965de3b58bd7",
"filtered_sneep_scale_mouse_218.txt:md5,26199aaf8103de723163c03bfa8b88b2",
"filtered_sneep_transfac_mouse_218.txt:md5,d41d8cd98f00b204e9800998ecf8427e",
"L10_H3K27ac.bed:md5,59f68dd95564876b3fe43e9af1195bfa",
Expand Down Expand Up @@ -10104,8 +10144,8 @@
],
"meta": {
"nf-test": "0.9.2",
"nextflow": "25.04.2"
"nextflow": "25.10.0"
},
"timestamp": "2025-09-28T13:53:09.941876368"
"timestamp": "2025-11-13T19:32:43.987079271"
}
}
2 changes: 1 addition & 1 deletion workflows/tfactivity.nf
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,7 @@ workflow TFACTIVITY {
MOTIFS.out.meme,
)
ch_versions = ch_versions.mix(FIMO.out.versions)
ch_fimo_binding_sites = FIMO.out.tsv
ch_fimo_binding_sites = FIMO.out.tsv_significant
}

if (!params.skip_sneep) {
Expand Down