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 {
|
|
|
|
|
|
|
|
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 }
|
|
|
|
]
|
|
|
|
}
|
|
|
|
|
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" },
|
2022-04-05 10:16:26 +00:00
|
|
|
mode: params.publish_dir_mode,
|
2022-02-18 15:51:01 +00:00
|
|
|
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" },
|
2022-04-05 10:16:26 +00:00
|
|
|
mode: params.publish_dir_mode,
|
2022-03-25 13:58:06 +00:00
|
|
|
pattern: '*.html'
|
|
|
|
]
|
|
|
|
}
|
|
|
|
|
2022-04-01 07:50:08 +00:00
|
|
|
withName: FASTP_SINGLE {
|
|
|
|
ext.args = [
|
|
|
|
// trimming options
|
|
|
|
params.shortread_clipmerge_skipadaptertrim ? "--disable_adapter_trimming" : "",
|
|
|
|
params.shortread_clipmerge_adapter1 ? "--adapter_sequence ${params.shortread_clipmerge_adapter1}" : "",
|
|
|
|
// filtering options
|
|
|
|
"--length_required ${params.shortread_clipmerge_minlength}"
|
|
|
|
].join(' ').trim()
|
2022-02-18 15:51:01 +00:00
|
|
|
ext.prefix = { "${meta.id}_${meta.run_accession}" }
|
2022-04-01 07:50:08 +00:00
|
|
|
publishDir = [
|
|
|
|
path: { "${params.outdir}/fastp" },
|
2022-04-05 10:16:26 +00:00
|
|
|
mode: params.publish_dir_mode,
|
2022-04-06 08:27:11 +00:00
|
|
|
pattern: '*.fastq.gz',
|
|
|
|
enabled: params.save_preprocessed_reads
|
2022-04-01 07:50:08 +00:00
|
|
|
]
|
|
|
|
}
|
|
|
|
|
|
|
|
withName: FASTP_PAIRED {
|
2022-02-18 15:51:01 +00:00
|
|
|
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
|
2022-03-30 09:31:37 +00:00
|
|
|
params.shortread_clipmerge_skipadaptertrim ? "--disable_adapter_trimming" : "",
|
2022-03-25 14:01:25 +00:00
|
|
|
params.shortread_clipmerge_adapter1 ? "--adapter_sequence ${params.shortread_clipmerge_adapter1}" : "",
|
2022-04-01 07:50:08 +00:00
|
|
|
params.shortread_clipmerge_adapter2 ? "--adapter_sequence_r2 ${params.shortread_clipmerge_adapter2}" : "--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()
|
2022-04-01 07:50:08 +00:00
|
|
|
ext.prefix = { "${meta.id}_${meta.run_accession}" }
|
2022-02-18 15:51:01 +00:00
|
|
|
publishDir = [
|
|
|
|
path: { "${params.outdir}/fastp" },
|
2022-04-05 10:16:26 +00:00
|
|
|
mode: params.publish_dir_mode,
|
2022-04-06 08:27:11 +00:00
|
|
|
pattern: '*.fastq.gz',
|
|
|
|
enabled: params.save_preprocessed_reads
|
2022-02-18 15:51:01 +00:00
|
|
|
]
|
|
|
|
}
|
|
|
|
|
2022-04-01 07:50:08 +00:00
|
|
|
withName: ADAPTERREMOVAL_SINGLE {
|
|
|
|
ext.args = [
|
|
|
|
// trimming options
|
|
|
|
params.shortread_clipmerge_skipadaptertrim ? "--adapter1 '' --adapter2 ''" : "",
|
|
|
|
params.shortread_clipmerge_adapter1 ? "--adapter1 ${params.shortread_clipmerge_adapter1}" : "",
|
|
|
|
// filtering options
|
|
|
|
"--minlength ${params.shortread_clipmerge_minlength}"
|
|
|
|
].join(' ').trim()
|
|
|
|
ext.prefix = { "${meta.id}_${meta.run_accession}" }
|
|
|
|
publishDir = [
|
|
|
|
path: { "${params.outdir}/adapterremoval" },
|
2022-04-05 10:16:26 +00:00
|
|
|
mode: params.publish_dir_mode,
|
2022-04-06 08:27:11 +00:00
|
|
|
pattern: '*.fastq.gz',
|
|
|
|
enabled: params.save_preprocessed_reads
|
2022-04-01 07:50:08 +00:00
|
|
|
]
|
|
|
|
}
|
|
|
|
|
|
|
|
withName: ADAPTERREMOVAL_PAIRED {
|
|
|
|
ext.args = [
|
|
|
|
// collapsing options
|
|
|
|
params.shortread_clipmerge_mergepairs ? "--collapse" : "",
|
|
|
|
// trimming options
|
|
|
|
params.shortread_clipmerge_skipadaptertrim ? "--adapter1 '' --adapter2 ''" : "",
|
|
|
|
params.shortread_clipmerge_adapter1 ? "--adapter1 ${params.shortread_clipmerge_adapter1}" : "",
|
|
|
|
params.shortread_clipmerge_adapter2 ? "--adapter2 ${params.shortread_clipmerge_adapter2}" : "",
|
|
|
|
// filtering options
|
|
|
|
"--minlength ${params.shortread_clipmerge_minlength}"
|
|
|
|
].join(' ').trim()
|
|
|
|
ext.prefix = { "${meta.id}_${meta.run_accession}" }
|
|
|
|
publishDir = [
|
|
|
|
path: { "${params.outdir}/adapterremoval" },
|
2022-04-05 10:16:26 +00:00
|
|
|
mode: params.publish_dir_mode,
|
2022-04-06 08:27:11 +00:00
|
|
|
pattern: '*.fastq.gz',
|
|
|
|
enabled: params.save_preprocessed_reads
|
2022-04-01 07:50:08 +00:00
|
|
|
]
|
|
|
|
}
|
|
|
|
|
2022-03-18 13:34:10 +00:00
|
|
|
withName: PORECHOP {
|
|
|
|
ext.prefix = { "${meta.id}_${meta.run_accession}" }
|
|
|
|
publishDir = [
|
|
|
|
path: { "${params.outdir}/porechop" },
|
2022-04-05 10:16:26 +00:00
|
|
|
mode: params.publish_dir_mode,
|
2022-04-06 08:27:11 +00:00
|
|
|
pattern: '*.fastq.gz',
|
|
|
|
enabled: params.save_preprocessed_reads
|
2022-03-18 13:34:10 +00:00
|
|
|
]
|
2022-02-18 15:51:01 +00:00
|
|
|
}
|
|
|
|
|
2022-04-03 15:23:14 +00:00
|
|
|
withName: BOWTIE2_BUILD {
|
|
|
|
publishDir = [
|
|
|
|
path: { "${params.outdir}/bowtie2/build" },
|
2022-04-07 12:00:10 +00:00
|
|
|
mode: params.publish_dir_mode,
|
2022-04-17 20:27:04 +00:00
|
|
|
enabled: params.save_hostremoval_index,
|
2022-04-18 04:37:23 +00:00
|
|
|
pattern: 'bowtie2'
|
2022-04-03 15:23:14 +00:00
|
|
|
]
|
|
|
|
}
|
|
|
|
|
|
|
|
withName: BOWTIE2_ALIGN {
|
|
|
|
ext.prefix = { "${meta.id}_${meta.run_accession}" }
|
2022-04-18 04:37:23 +00:00
|
|
|
publishDir = [
|
|
|
|
[
|
2022-04-17 20:27:04 +00:00
|
|
|
path: { "${params.outdir}/bowtie2/align" },
|
|
|
|
mode: params.publish_dir_mode,
|
|
|
|
pattern: '*.log'
|
2022-04-18 04:37:23 +00:00
|
|
|
],
|
|
|
|
[
|
2022-04-17 20:27:04 +00:00
|
|
|
path: { "${params.outdir}/bowtie2/align" },
|
|
|
|
mode: params.publish_dir_mode,
|
|
|
|
enabled: params.save_hostremoval_mapped,
|
|
|
|
pattern: '*.bam'
|
2022-04-18 04:37:23 +00:00
|
|
|
],
|
|
|
|
[
|
2022-04-03 15:23:14 +00:00
|
|
|
path: { "${params.outdir}/bowtie2/align" },
|
2022-04-07 12:00:10 +00:00
|
|
|
mode: params.publish_dir_mode,
|
2022-04-17 20:27:04 +00:00
|
|
|
enabled: params.save_hostremoval_unmapped,
|
|
|
|
pattern: '*.fastq.gz'
|
2022-04-18 04:37:23 +00:00
|
|
|
]
|
|
|
|
]
|
2022-04-03 15:23:14 +00:00
|
|
|
}
|
|
|
|
|
2022-04-02 15:02:05 +00:00
|
|
|
withName: BBMAP_BBDUK {
|
|
|
|
ext.args = [
|
2022-04-04 19:16:51 +00:00
|
|
|
"entropy=${params.shortread_complexityfilter_entropy}",
|
2022-04-02 15:02:05 +00:00
|
|
|
"entropywindow=${params.shortread_complexityfilter_bbduk_windowsize}",
|
|
|
|
params.shortread_complexityfilter_bbduk_mask ? "entropymask=t" : "entropymask=f"
|
|
|
|
].join(' ').trim()
|
|
|
|
ext.prefix = { "${meta.id}-${meta.run_accession}" }
|
2022-02-18 15:51:01 +00:00
|
|
|
publishDir = [
|
2022-04-02 15:02:05 +00:00
|
|
|
path: { "${params.outdir}/bbduk/" },
|
|
|
|
mode: params.publish_dir_mode,
|
2022-04-06 08:27:11 +00:00
|
|
|
pattern: '*.{fastq.gz,log}',
|
|
|
|
enabled: params.save_complexityfiltered_reads
|
2022-02-18 15:51:01 +00:00
|
|
|
]
|
2022-02-18 06:55:14 +00:00
|
|
|
}
|
|
|
|
|
2022-04-04 19:16:51 +00:00
|
|
|
withName: PRINSEQPLUSPLUS {
|
|
|
|
ext.args = [
|
|
|
|
params.shortread_complexityfilter_prinseqplusplus_mode == 'dust' ? "-lc_dust=${params.shortread_complexityfilter_prinseqplusplus_dustscore}" : "-lc_entropy=${params.shortread_complexityfilter_entropy}",
|
|
|
|
"-trim_qual_left=0 -trim_qual_left=0 -trim_qual_window=0 -trim_qual_step=0"
|
|
|
|
].join(' ').trim()
|
|
|
|
ext.prefix = { "${meta.id}-${meta.run_accession}" }
|
2022-02-18 15:51:01 +00:00
|
|
|
publishDir = [
|
2022-04-04 19:16:51 +00:00
|
|
|
path: { "${params.outdir}/prinseqplusplus/" },
|
|
|
|
mode: params.publish_dir_mode,
|
2022-04-06 08:27:11 +00:00
|
|
|
pattern: '*{_good_out.fastq.gz,_good_out_R1.fastq.gz,_good_out_R2.fastq.gz,log}',
|
|
|
|
enabled: params.save_complexityfiltered_reads
|
2022-02-18 15:51:01 +00:00
|
|
|
]
|
2022-02-18 06:55:14 +00:00
|
|
|
}
|
|
|
|
|
2022-04-08 11:28:37 +00:00
|
|
|
withName: CAT_FASTQ {
|
2022-04-12 07:25:27 +00:00
|
|
|
ext.prefix = { "${meta.id}" }
|
2022-04-08 11:28:37 +00:00
|
|
|
publishDir = [
|
|
|
|
path: { "${params.outdir}/run_merging/" },
|
|
|
|
mode: params.publish_dir_mode,
|
|
|
|
pattern: '*.fastq.gz',
|
|
|
|
enabled: params.save_runmerged_reads
|
|
|
|
]
|
|
|
|
}
|
|
|
|
|
2022-03-03 16:42:02 +00:00
|
|
|
withName: MALT_RUN {
|
2022-04-01 07:50:08 +00:00
|
|
|
ext.args = { "${meta.db_params}" }
|
2022-04-13 10:00:28 +00:00
|
|
|
ext.prefix = params.perform_runmerging ? { "${meta.id}-${meta.db_name}" } : { "${meta.id}-${meta.run_accession}-${meta.db_name}" }
|
2022-03-03 16:42:02 +00:00
|
|
|
publishDir = [
|
|
|
|
path: { "${params.outdir}/malt/${meta.db_name}" },
|
2022-04-05 10:16:26 +00:00
|
|
|
mode: params.publish_dir_mode,
|
2022-04-10 04:43:30 +00:00
|
|
|
pattern: '*.{log}'
|
2022-03-03 16:42:02 +00:00
|
|
|
]
|
|
|
|
}
|
|
|
|
|
|
|
|
withName: KRAKEN2_KRAKEN2 {
|
2022-04-01 07:50:08 +00:00
|
|
|
ext.args = { "${meta.db_params}" }
|
2022-04-13 10:00:28 +00:00
|
|
|
ext.prefix = params.perform_runmerging ? { "${meta.id}-${meta.db_name}" } : { "${meta.id}-${meta.run_accession}-${meta.db_name}" }
|
2022-03-03 16:42:02 +00:00
|
|
|
publishDir = [
|
|
|
|
path: { "${params.outdir}/kraken2/${meta.db_name}" },
|
2022-04-05 10:16:26 +00:00
|
|
|
mode: params.publish_dir_mode,
|
2022-04-10 04:43:30 +00:00
|
|
|
pattern: '*.{txt}'
|
2022-03-03 16:42:02 +00:00
|
|
|
]
|
2022-02-18 06:55:14 +00:00
|
|
|
}
|
|
|
|
|
2022-04-02 12:44:27 +00:00
|
|
|
withName: METAPHLAN3 {
|
2022-04-08 11:28:37 +00:00
|
|
|
ext.args = { "${meta.db_params}" }
|
2022-04-13 10:00:28 +00:00
|
|
|
ext.prefix = params.perform_runmerging ? { "${meta.id}-${meta.db_name}" } : { "${meta.id}-${meta.run_accession}-${meta.db_name}" }
|
2022-04-02 12:44:27 +00:00
|
|
|
publishDir = [
|
2022-04-02 12:58:07 +00:00
|
|
|
path: { "${params.outdir}/metaphlan3/${meta.db_name}" },
|
2022-04-02 12:44:27 +00:00
|
|
|
mode: params.publish_dir_mode,
|
|
|
|
pattern: '*.{biom,txt}'
|
|
|
|
]
|
|
|
|
}
|
|
|
|
|
2022-04-10 04:43:30 +00:00
|
|
|
withName: CENTRIFUGE_CENTRIFUGE {
|
2022-02-18 06:55:14 +00:00
|
|
|
publishDir = [
|
2022-04-10 04:43:30 +00:00
|
|
|
path: { "${params.outdir}/centrifuge/${meta.db_name}" },
|
2022-03-15 21:05:37 +00:00
|
|
|
mode: params.publish_dir_mode,
|
2022-04-10 04:43:30 +00:00
|
|
|
pattern: '*.txt'
|
2022-02-18 06:55:14 +00:00
|
|
|
]
|
2022-04-10 04:43:30 +00:00
|
|
|
ext.args = { "${meta.db_params}" }
|
|
|
|
ext.prefix = { "${meta.id}-${meta.run_accession}-${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'
|
|
|
|
]
|
|
|
|
}
|
|
|
|
|
2022-04-10 04:44:10 +00:00
|
|
|
withName: MULTIQC {
|
|
|
|
publishDir = [
|
|
|
|
path: { "${params.outdir}/${task.process.tokenize(':')[-1].tokenize('_')[0].toLowerCase()}" },
|
|
|
|
mode: params.publish_dir_mode,
|
|
|
|
saveAs: { filename -> filename.equals('versions.yml') ? null : filename }
|
|
|
|
]
|
|
|
|
}
|
|
|
|
|
2022-02-18 06:55:14 +00:00
|
|
|
}
|