2022-02-18 06:55:14 +00:00
|
|
|
/*
|
2022-03-15 21:05:37 +00:00
|
|
|
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
2022-02-18 06:55:14 +00:00
|
|
|
Config file for defining DSL2 per module options and publishing paths
|
2022-03-15 21:05:37 +00:00
|
|
|
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
2022-02-18 06:55:14 +00:00
|
|
|
Available keys to override module options:
|
2022-03-15 21:05:37 +00:00
|
|
|
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.
|
2022-02-18 06:55:14 +00:00
|
|
|
----------------------------------------------------------------------------------------
|
|
|
|
*/
|
|
|
|
|
|
|
|
process {
|
|
|
|
|
|
|
|
publishDir = [
|
|
|
|
path: { "${params.outdir}/${task.process.tokenize(':')[-1].tokenize('_')[0].toLowerCase()}" },
|
2022-03-15 21:05:37 +00:00
|
|
|
mode: params.publish_dir_mode,
|
2022-02-18 06:55:14 +00:00
|
|
|
saveAs: { filename -> filename.equals('versions.yml') ? null : filename }
|
|
|
|
]
|
|
|
|
|
|
|
|
withName: SAMPLESHEET_CHECK {
|
|
|
|
publishDir = [
|
|
|
|
path: { "${params.outdir}/pipeline_info" },
|
2022-03-15 21:05:37 +00:00
|
|
|
mode: params.publish_dir_mode,
|
2022-02-18 06:55:14 +00:00
|
|
|
saveAs: { filename -> filename.equals('versions.yml') ? null : filename }
|
|
|
|
]
|
|
|
|
}
|
|
|
|
|
2022-03-21 19:28:09 +00:00
|
|
|
withName: DATABASE_CHECK {
|
|
|
|
publishDir = [
|
|
|
|
path: { "${params.outdir}/pipeline_info" },
|
|
|
|
mode: params.publish_dir_mode,
|
|
|
|
saveAs: { filename -> filename.equals('versions.yml') ? null : filename }
|
|
|
|
]
|
|
|
|
}
|
|
|
|
|
|
|
|
withName: UNTAR {
|
2022-03-21 19:30:29 +00:00
|
|
|
publishDir = [
|
2022-03-21 19:28:09 +00:00
|
|
|
path: { "${params.outdir}/databases" },
|
|
|
|
mode: params.publish_dir_mode,
|
|
|
|
saveAs: { filename -> filename.equals('versions.yml') ? null : filename }
|
|
|
|
]
|
|
|
|
}
|
|
|
|
|
2022-02-18 06:55:14 +00:00
|
|
|
withName: FASTQC {
|
|
|
|
ext.args = '--quiet'
|
2022-02-18 15:51:01 +00:00
|
|
|
ext.prefix = { "${meta.id}_${meta.run_accession}_raw" }
|
|
|
|
publishDir = [
|
|
|
|
path: { "${params.outdir}/fastqc/raw" },
|
|
|
|
mode: 'copy',
|
|
|
|
pattern: '*.html'
|
|
|
|
]
|
|
|
|
}
|
|
|
|
|
2022-03-25 13:58:06 +00:00
|
|
|
withName: FASTQC_PROCESSED {
|
|
|
|
ext.args = '--quiet'
|
|
|
|
ext.prefix = { "${meta.id}_${meta.run_accession}_processed" }
|
|
|
|
publishDir = [
|
|
|
|
path: { "${params.outdir}/fastqc/processed" },
|
|
|
|
mode: 'copy',
|
|
|
|
pattern: '*.html'
|
|
|
|
]
|
|
|
|
}
|
|
|
|
|
2022-02-18 15:51:01 +00:00
|
|
|
withName: FASTP {
|
|
|
|
ext.prefix = { "${meta.id}_${meta.run_accession}" }
|
|
|
|
ext.args = [
|
2022-03-27 07:30:23 +00:00
|
|
|
// collapsing options - option to retain singletons
|
2022-03-25 13:58:06 +00:00
|
|
|
params.shortread_clipmerge_excludeunmerged ? '' : "--include_unmerged",
|
|
|
|
// trimming options
|
|
|
|
params.shortread_clipmerge_skiptrim ? "--disable_adapter_trimming" : "",
|
2022-03-25 14:01:25 +00:00
|
|
|
params.shortread_clipmerge_adapter1 ? "--adapter_sequence ${params.shortread_clipmerge_adapter1}" : "",
|
|
|
|
!{ ${meta.single_end} } && params.shortread_clipmerge_adapter2 ? "--adapter_sequence_r2 ${params.shortread_clipmerge_adapter2}" : !{ ${meta.single_end} } ? "--detect_adapter_for_pe" : "",
|
2022-03-25 13:58:06 +00:00
|
|
|
// filtering options
|
|
|
|
"--length_required ${params.shortread_clipmerge_minlength}"
|
2022-02-18 15:51:01 +00:00
|
|
|
].join(' ').trim()
|
|
|
|
publishDir = [
|
|
|
|
path: { "${params.outdir}/fastp" },
|
|
|
|
mode: 'copy',
|
|
|
|
pattern: '*.fastq.gz'
|
|
|
|
]
|
|
|
|
}
|
|
|
|
|
2022-03-18 13:34:10 +00:00
|
|
|
withName: PORECHOP {
|
|
|
|
ext.prefix = { "${meta.id}_${meta.run_accession}" }
|
|
|
|
publishDir = [
|
|
|
|
path: { "${params.outdir}/porechop" },
|
|
|
|
mode: 'copy',
|
|
|
|
pattern: '*.fastq.gz'
|
|
|
|
]
|
2022-02-18 15:51:01 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
withName: CAT_FASTQ {
|
|
|
|
publishDir = [
|
|
|
|
path: { "${params.outdir}/prepared_sequences" },
|
|
|
|
mode: 'copy',
|
|
|
|
pattern: '*.fastq.gz'
|
|
|
|
]
|
2022-02-18 06:55:14 +00:00
|
|
|
}
|
|
|
|
|
2022-03-03 16:42:02 +00:00
|
|
|
withName: MALT_RUN {
|
|
|
|
publishDir = [
|
|
|
|
path: { "${params.outdir}/malt/${meta.db_name}" },
|
|
|
|
mode: 'copy',
|
|
|
|
pattern: '*.{rma6,tab,text,sam,log}'
|
|
|
|
]
|
|
|
|
ext.args = { "${meta.db_params}" }
|
2022-03-27 07:30:23 +00:00
|
|
|
ext.prefix = { "${meta.id}-${meta.db_name}" }
|
2022-03-03 16:42:02 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
withName: KRAKEN2_KRAKEN2 {
|
|
|
|
publishDir = [
|
|
|
|
path: { "${params.outdir}/kraken2/${meta.db_name}" },
|
|
|
|
mode: 'copy',
|
2022-03-21 14:58:19 +00:00
|
|
|
pattern: '*.{fastq.gz,txt}'
|
2022-03-03 16:42:02 +00:00
|
|
|
]
|
|
|
|
ext.args = { "${meta.db_params}" }
|
2022-03-27 07:30:23 +00:00
|
|
|
ext.prefix = { "${meta.id}-${meta.db_name}" }
|
2022-02-18 06:55:14 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
withName: CUSTOM_DUMPSOFTWAREVERSIONS {
|
|
|
|
publishDir = [
|
|
|
|
path: { "${params.outdir}/pipeline_info" },
|
2022-03-15 21:05:37 +00:00
|
|
|
mode: params.publish_dir_mode,
|
2022-02-18 06:55:14 +00:00
|
|
|
pattern: '*_versions.yml'
|
|
|
|
]
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|