Skip to content

Commit

Permalink
Merge pull request #186 from maxulysse/split_configs
Browse files Browse the repository at this point in the history
split up config files to be more modular
  • Loading branch information
maxulysse authored Aug 24, 2023
2 parents e7c2e18 + 011addc commit addfa36
Show file tree
Hide file tree
Showing 6 changed files with 196 additions and 173 deletions.
4 changes: 3 additions & 1 deletion .nf-core.yml
Original file line number Diff line number Diff line change
@@ -1,13 +1,15 @@
repository_type: pipeline
lint:
actions_ci: false
files_exist:
- conf/modules.config
files_unchanged:
- .github/CONTRIBUTING.md
- .github/ISSUE_TEMPLATE/bug_report.yml
- assets/nf-core-fetchngs_logo_light.png
- assets/sendmail_template.txt
- lib/NfcoreTemplate.groovy
- .gitattributes
actions_ci: false
multiqc_config: false
nextflow_config:
- "params.validationShowHiddenParams"
Expand Down
171 changes: 0 additions & 171 deletions conf/modules.config

This file was deleted.

32 changes: 32 additions & 0 deletions conf/modules/base.config
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
/*
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Config file for defining DSL2 per module options and publishing paths
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Available keys to override module options:
ext.args = Additional arguments appended to command in module.
ext.args2 = Second set of arguments appended to command in module (multi-tool modules).
ext.args3 = Third set of arguments appended to command in module (multi-tool modules).
ext.prefix = File name prefix for output files.
----------------------------------------------------------------------------------------
*/

//
// Generic process options for all workflows
//
process {

publishDir = [
path: { "${params.outdir}/${task.process.tokenize(':')[-1].tokenize('_')[0].toLowerCase()}" },
mode: params.publish_dir_mode,
saveAs: { filename -> filename.equals('versions.yml') ? null : filename }
]

withName: CUSTOM_DUMPSOFTWAREVERSIONS {
publishDir = [
path: { "${params.outdir}/pipeline_info" },
mode: params.publish_dir_mode,
pattern: '*_versions.yml'
]
}

}
88 changes: 88 additions & 0 deletions conf/modules/sra.config
Original file line number Diff line number Diff line change
@@ -0,0 +1,88 @@
/*
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Config file for defining DSL2 per module options and publishing paths
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Available keys to override module options:
ext.args = Additional arguments appended to command in module.
ext.args2 = Second set of arguments appended to command in module (multi-tool modules).
ext.args3 = Third set of arguments appended to command in module (multi-tool modules).
ext.prefix = File name prefix for output files.
----------------------------------------------------------------------------------------
*/

//
// Process options for the SRA workflow
//
process {

withName: SRA_IDS_TO_RUNINFO {
publishDir = [
path: { "${params.outdir}/metadata" },
enabled: false
]
}

withName: SRA_RUNINFO_TO_FTP {
publishDir = [
path: { "${params.outdir}/metadata" },
mode: params.publish_dir_mode,
saveAs: { filename -> filename.equals('versions.yml') ? null : filename }
]
}

withName: SRA_FASTQ_FTP {
ext.args = '--retry 5 --continue-at - --max-time 1200'
publishDir = [
[
path: { "${params.outdir}/fastq" },
mode: params.publish_dir_mode,
pattern: "*.fastq.gz"
],
[
path: { "${params.outdir}/fastq/md5" },
mode: params.publish_dir_mode,
pattern: "*.md5"
]
]
}

withName: SRATOOLS_PREFETCH {
publishDir = [
path: { "${params.outdir}/sra" },
enabled: false
]
}

withName: SRATOOLS_FASTERQDUMP {
ext.args = '--split-files --include-technical'
publishDir = [
path: { "${params.outdir}/fastq" },
mode: params.publish_dir_mode,
pattern: "*.fastq.gz"
]
}

withName: SRA_TO_SAMPLESHEET {
publishDir = [
path: { "${params.outdir}/samplesheet" },
enabled: false
]
}

withName: SRA_MERGE_SAMPLESHEET {
publishDir = [
path: { "${params.outdir}/samplesheet" },
mode: params.publish_dir_mode,
saveAs: { filename -> filename.equals('versions.yml') ? null : filename }
]
}

withName: MULTIQC_MAPPINGS_CONFIG {
publishDir = [
path: { "${params.outdir}/samplesheet" },
mode: params.publish_dir_mode,
saveAs: { filename -> filename.equals('versions.yml') ? null : filename }
]
}

}
66 changes: 66 additions & 0 deletions conf/modules/synapse.config
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
/*
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Config file for defining DSL2 per module options and publishing paths
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Available keys to override module options:
ext.args = Additional arguments appended to command in module.
ext.args2 = Second set of arguments appended to command in module (multi-tool modules).
ext.args3 = Third set of arguments appended to command in module (multi-tool modules).
ext.prefix = File name prefix for output files.
----------------------------------------------------------------------------------------
*/

//
// Process options for the Synapse workflow
//

process {

withName: SYNAPSE_LIST {
ext.args = '--long'
publishDir = [
path: { "${params.outdir}/metadata" },
mode: params.publish_dir_mode,
saveAs: { filename -> filename.equals('versions.yml') ? null : filename }
]
}

withName: SYNAPSE_GET {
publishDir = [
[
path: { "${params.outdir}/fastq" },
mode: params.publish_dir_mode,
pattern: "*.fastq.gz"
],
[
path: { "${params.outdir}/fastq/md5" },
mode: params.publish_dir_mode,
pattern: "*.md5"
]
]
}

withName: SYNAPSE_SHOW {
publishDir = [
path: { "${params.outdir}/metadata" },
mode: params.publish_dir_mode,
saveAs: { filename -> filename.equals('versions.yml') ? null : filename }
]
}

withName: SYNAPSE_TO_SAMPLESHEET {
publishDir = [
path: { "${params.outdir}/samplesheet" },
enabled: false
]
}

withName: SYNAPSE_MERGE_SAMPLESHEET {
publishDir = [
path: { "${params.outdir}/samplesheet" },
mode: params.publish_dir_mode,
saveAs: { filename -> filename.equals('versions.yml') ? null : filename }
]
}

}
8 changes: 7 additions & 1 deletion nextflow.config
Original file line number Diff line number Diff line change
Expand Up @@ -217,7 +217,13 @@ manifest {
}

// Load modules.config for DSL2 module specific options
includeConfig 'conf/modules.config'
includeConfig 'conf/modules/base.config'
if ( params.input_type == 'sra' ) {
includeConfig 'conf/modules/sra.config'
}
if ( params.input_type == 'synapse' ) {
includeConfig 'conf/modules/synapse.config'
}

// Function to ensure that resource requirements don't go beyond
// a maximum limit
Expand Down

0 comments on commit addfa36

Please sign in to comment.