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

split up config files to be more modular #186

Merged
merged 4 commits into from
Aug 24, 2023
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
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'
]
}

}
79 changes: 0 additions & 79 deletions conf/modules.config → conf/modules/sra.config
Original file line number Diff line number Diff line change
Expand Up @@ -10,27 +10,6 @@
----------------------------------------------------------------------------------------
*/

//
// 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'
]
}

}

//
// Process options for the SRA workflow
//
Expand Down Expand Up @@ -111,61 +90,3 @@ if (params.input_type == 'sra') {
}

}

//
// Process options for the Synapse workflow
//
if (params.input_type == 'synapse') {

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 }
]
}

}

}
69 changes: 69 additions & 0 deletions conf/modules/synapse.config
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
/*
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
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
//
if (params.input_type == 'synapse') {

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 }
]
}

}

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

// Load modules.config for DSL2 module specific options
includeConfig 'conf/modules.config'
includeConfig 'conf/modules/base.config'
includeConfig 'conf/modules/sra.config'
includeConfig 'conf/modules/synapse.config'
maxulysse marked this conversation as resolved.
Show resolved Hide resolved

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