Skip to content

Commit 34f9807

Browse files
authored
Merge pull request #63 from nf-core/better_fimo_combine_results
Better fimo combine results
2 parents db5d9fe + 08a52ab commit 34f9807

File tree

19 files changed

+474
-351
lines changed

19 files changed

+474
-351
lines changed

conf/modules.config

Lines changed: 30 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -12,12 +12,6 @@
1212

1313
process {
1414

15-
publishDir = [
16-
path: { "${params.outdir}/all/${task.process.tokenize(':')[-1].tokenize('_')[0].toLowerCase()}" },
17-
mode: params.publish_dir_mode,
18-
saveAs: { filename -> filename.equals('versions.yml') ? null : filename }
19-
]
20-
2115
/*
2216
PREPARE_GENOME
2317
*/
@@ -589,12 +583,40 @@ process {
589583
]
590584
}
591585

592-
withName: ".*:FIMO:COMBINE_RESULTS" {
586+
withName: ".*:FIMO:CONCAT_FILTER_GFF" {
587+
ext.args = "'/^#/ { next } NF==0 { next } { print }'"
588+
publishDir = [
589+
// Unsorted intermediate file, disable publishing
590+
enabled: false
591+
]
592+
}
593+
594+
withName: ".*:FIMO:SORT_GFF" {
595+
ext.args = "-t \$'\\t' -k1,1V -k4,4n -k5,5n"
596+
ext.prefix = {"${meta.id}_sorted"}
597+
publishDir = [
598+
path: { "${params.outdir}/06_fimo/04_combined_results/gff" },
599+
mode: params.publish_dir_mode,
600+
saveAs: { filename -> filename.equals('versions.yml') ? null : filename }
601+
]
602+
}
603+
604+
withName: ".*:FIMO:CONCAT_FILTER_TSV" {
605+
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}'"
606+
publishDir = [
607+
// Unsorted intermediate file, disable publishing
608+
enabled: false
609+
]
610+
}
611+
612+
withName: ".*:FIMO:SORT_TSV" {
613+
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"
593614
publishDir = [
594-
path: { "${params.outdir}/06_fimo/04_combined_results" },
615+
path: { "${params.outdir}/06_fimo/04_combined_results/tsv" },
595616
mode: params.publish_dir_mode,
596617
saveAs: { filename -> filename.equals('versions.yml') ? null : filename }
597618
]
619+
memory = { 36.GB * task.attempt }
598620
}
599621

600622
/*

docs/output.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -315,7 +315,7 @@ FIMO analysis is particularly valuable for users who need detailed binding site
315315
- `*.tsv`, `*.gff`, `*.html`, `*.xml`, `*cisml.xml`, `*best_site.narrowPeak`.
316316
- `04_combined_results/`
317317
- `<condition>_<assay>.tsv`
318-
- `<condition>_<assay>.gff`: Collated FIMO hits across inputs (COMBINE_RESULTS).
318+
- `<condition>_<assay>.gff`: Collated FIMO hits across inputs.
319319

320320
</details>
321321

modules.json

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,11 @@
4646
"git_sha": "41dfa3f7c0ffabb96a6a813fe321c6d1cc5b6e46",
4747
"installed_by": ["modules"]
4848
},
49+
"csvtk/sort": {
50+
"branch": "master",
51+
"git_sha": "d01263b60ce84d777f09819709e94dd17b11ce92",
52+
"installed_by": ["modules"]
53+
},
4954
"deseq2/differential": {
5055
"branch": "master",
5156
"git_sha": "2e24bf8b6b045e1cf56a2907306b008113a686d0",

modules/local/fimo/combine_results/environment.yml

Lines changed: 0 additions & 6 deletions
This file was deleted.

modules/local/fimo/combine_results/main.nf

Lines changed: 0 additions & 32 deletions
This file was deleted.

modules/local/fimo/combine_results/templates/combine_results.py

Lines changed: 0 additions & 54 deletions
This file was deleted.

modules/local/fimo/combine_results/tests/main.nf.test

Lines changed: 0 additions & 63 deletions
This file was deleted.

modules/local/fimo/combine_results/tests/main.nf.test.snap

Lines changed: 0 additions & 100 deletions
This file was deleted.

modules/nf-core/csvtk/sort/environment.yml

Lines changed: 7 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)