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: 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,
|
2023-02-02 12:58:48 +00:00
|
|
|
pattern: '*.{html,zip}'
|
2022-02-18 15:51:01 +00:00
|
|
|
]
|
|
|
|
}
|
|
|
|
|
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,
|
2023-02-02 12:58:48 +00:00
|
|
|
pattern: '*.{html,zip}'
|
2022-03-25 13:58:06 +00:00
|
|
|
]
|
|
|
|
}
|
|
|
|
|
2022-10-18 15:43:16 +00:00
|
|
|
withName: FALCO {
|
2022-12-15 11:57:49 +00:00
|
|
|
ext.prefix = { "${meta.id}_${meta.run_accession}_raw_falco" }
|
2022-10-18 15:43:16 +00:00
|
|
|
publishDir = [
|
|
|
|
path: { "${params.outdir}/falco/raw" },
|
|
|
|
mode: params.publish_dir_mode,
|
2023-02-02 12:58:48 +00:00
|
|
|
pattern: '*.{html,txt,zip}'
|
2022-10-18 15:43:16 +00:00
|
|
|
]
|
|
|
|
}
|
|
|
|
|
|
|
|
withName: FALCO_PROCESSED {
|
2022-12-15 11:57:49 +00:00
|
|
|
ext.prefix = { "${meta.id}_${meta.run_accession}_processed_falco" }
|
2022-10-18 15:43:16 +00:00
|
|
|
publishDir = [
|
|
|
|
path: { "${params.outdir}/falco/processed" },
|
|
|
|
mode: params.publish_dir_mode,
|
2023-02-02 12:58:48 +00:00
|
|
|
pattern: '*.{html,txt,zip}'
|
2022-10-18 15:43:16 +00:00
|
|
|
]
|
|
|
|
}
|
|
|
|
|
2022-04-01 07:50:08 +00:00
|
|
|
withName: FASTP_SINGLE {
|
|
|
|
ext.args = [
|
|
|
|
// trimming options
|
2022-05-01 05:18:14 +00:00
|
|
|
params.shortread_qc_skipadaptertrim ? "--disable_adapter_trimming" : "",
|
2022-11-02 11:39:34 +00:00
|
|
|
params.shortread_qc_adapterlist ? "" : params.shortread_qc_adapter1 ? "--adapter_sequence ${params.shortread_qc_adapter1}" : "",
|
2022-04-01 07:50:08 +00:00
|
|
|
// filtering options
|
2022-05-31 18:11:19 +00:00
|
|
|
"--length_required ${params.shortread_qc_minlength}",
|
2022-05-07 11:15:21 +00:00
|
|
|
(params.perform_shortread_complexityfilter && params.shortread_complexityfilter_tool == 'fastp') ? "--low_complexity_filter --complexity_threshold ${params.shortread_complexityfilter_fastp_threshold}" : ''
|
2022-04-01 07:50:08 +00:00
|
|
|
].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 = [
|
2022-12-15 09:35:06 +00:00
|
|
|
[
|
|
|
|
path: { "${params.outdir}/fastp" },
|
|
|
|
mode: params.publish_dir_mode,
|
|
|
|
pattern: '*.fastq.gz',
|
|
|
|
enabled: params.save_preprocessed_reads
|
|
|
|
],
|
|
|
|
[
|
|
|
|
path: { "${params.outdir}/fastp" },
|
|
|
|
mode: params.publish_dir_mode,
|
|
|
|
pattern: '*.{log,html,json}'
|
|
|
|
]
|
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-12-01 16:25:25 +00:00
|
|
|
params.shortread_qc_includeunmerged ? '--include_unmerged' : '',
|
2022-03-25 13:58:06 +00:00
|
|
|
// trimming options
|
2022-05-01 05:18:14 +00:00
|
|
|
params.shortread_qc_skipadaptertrim ? "--disable_adapter_trimming" : "",
|
2022-11-02 11:39:34 +00:00
|
|
|
params.shortread_qc_adapterlist ? "" : params.shortread_qc_adapter1 ? "--adapter_sequence ${params.shortread_qc_adapter1}" : "",
|
|
|
|
params.shortread_qc_adapterlist ? "" : params.shortread_qc_adapter2 ? "--adapter_sequence_r2 ${params.shortread_qc_adapter2}" : "--detect_adapter_for_pe",
|
2022-03-25 13:58:06 +00:00
|
|
|
// filtering options
|
2022-05-31 18:11:19 +00:00
|
|
|
"--length_required ${params.shortread_qc_minlength}",
|
2022-05-07 04:12:24 +00:00
|
|
|
params.perform_shortread_complexityfilter && params.shortread_complexityfilter_tool == 'fastp' ? "--low_complexity_filter --complexity_threshold ${params.shortread_complexityfilter_fastp_threshold}" : ''
|
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 = [
|
2022-12-15 09:35:06 +00:00
|
|
|
[
|
|
|
|
path: { "${params.outdir}/fastp" },
|
|
|
|
mode: params.publish_dir_mode,
|
|
|
|
pattern: '*.fastq.gz',
|
|
|
|
enabled: params.save_preprocessed_reads
|
|
|
|
],
|
|
|
|
[
|
|
|
|
path: { "${params.outdir}/fastp" },
|
|
|
|
mode: params.publish_dir_mode,
|
|
|
|
pattern: '*.{log,html,json}'
|
|
|
|
]
|
2022-02-18 15:51:01 +00:00
|
|
|
]
|
|
|
|
}
|
|
|
|
|
2022-04-01 07:50:08 +00:00
|
|
|
withName: ADAPTERREMOVAL_SINGLE {
|
|
|
|
ext.args = [
|
|
|
|
// trimming options
|
2022-10-27 12:17:19 +00:00
|
|
|
params.shortread_qc_skipadaptertrim ? "--adapter1 ''" : params.shortread_qc_adapterlist ? "" : params.shortread_qc_adapter1 ? "--adapter1 ${params.shortread_qc_adapter1}" : "",
|
2022-04-01 07:50:08 +00:00
|
|
|
// filtering options
|
2022-05-01 05:18:14 +00:00
|
|
|
"--minlength ${params.shortread_qc_minlength}"
|
2022-04-01 07:50:08 +00:00
|
|
|
].join(' ').trim()
|
|
|
|
ext.prefix = { "${meta.id}_${meta.run_accession}" }
|
|
|
|
publishDir = [
|
2022-12-15 09:35:06 +00:00
|
|
|
[
|
|
|
|
path: { "${params.outdir}/adapterremoval" },
|
|
|
|
mode: params.publish_dir_mode,
|
|
|
|
pattern: '*.fastq.gz',
|
|
|
|
enabled: params.save_preprocessed_reads
|
|
|
|
],
|
|
|
|
[
|
|
|
|
path: { "${params.outdir}/adapterremoval" },
|
|
|
|
mode: params.publish_dir_mode,
|
|
|
|
pattern: '*.settings'
|
|
|
|
]
|
2022-04-01 07:50:08 +00:00
|
|
|
]
|
|
|
|
}
|
|
|
|
|
|
|
|
withName: ADAPTERREMOVAL_PAIRED {
|
|
|
|
ext.args = [
|
|
|
|
// collapsing options
|
2022-05-01 05:18:14 +00:00
|
|
|
params.shortread_qc_mergepairs ? "--collapse" : "",
|
2022-04-01 07:50:08 +00:00
|
|
|
// trimming options
|
2022-10-27 12:17:19 +00:00
|
|
|
params.shortread_qc_skipadaptertrim ? "--adapter1 ''" : params.shortread_qc_adapterlist ? "" : params.shortread_qc_adapter1 ? "--adapter1 ${params.shortread_qc_adapter1}" : "", // adding adapter list happens at module input channel level
|
|
|
|
params.shortread_qc_skipadaptertrim ? "--adapter2 ''" : params.shortread_qc_adapterlist ? "" : params.shortread_qc_adapter2 ? "--adapter2 ${params.shortread_qc_adapter2}" : "",
|
2022-04-01 07:50:08 +00:00
|
|
|
// filtering options
|
2022-05-01 05:18:14 +00:00
|
|
|
"--minlength ${params.shortread_qc_minlength}"
|
2022-04-01 07:50:08 +00:00
|
|
|
].join(' ').trim()
|
|
|
|
ext.prefix = { "${meta.id}_${meta.run_accession}" }
|
|
|
|
publishDir = [
|
2022-12-15 09:35:06 +00:00
|
|
|
[
|
|
|
|
path: { "${params.outdir}/adapterremoval" },
|
|
|
|
mode: params.publish_dir_mode,
|
|
|
|
pattern: '*.fastq.gz',
|
|
|
|
enabled: params.save_preprocessed_reads
|
|
|
|
],
|
|
|
|
[
|
|
|
|
path: { "${params.outdir}/adapterremoval" },
|
|
|
|
mode: params.publish_dir_mode,
|
|
|
|
pattern: '*.settings'
|
|
|
|
]
|
2022-04-01 07:50:08 +00:00
|
|
|
]
|
|
|
|
}
|
|
|
|
|
2022-11-01 19:50:42 +00:00
|
|
|
withName: PORECHOP_PORECHOP {
|
2022-03-18 13:34:10 +00:00
|
|
|
ext.prefix = { "${meta.id}_${meta.run_accession}" }
|
|
|
|
publishDir = [
|
2022-12-15 09:35:06 +00:00
|
|
|
[
|
|
|
|
path: { "${params.outdir}/porechop" },
|
|
|
|
mode: params.publish_dir_mode,
|
2023-01-24 14:06:42 +00:00
|
|
|
pattern: '*_porechopped.fastq.gz',
|
2022-12-15 09:35:06 +00:00
|
|
|
enabled: params.save_preprocessed_reads
|
|
|
|
],
|
|
|
|
[
|
|
|
|
path: { "${params.outdir}/porechop" },
|
|
|
|
mode: params.publish_dir_mode,
|
|
|
|
pattern: '*.log'
|
|
|
|
]
|
2022-03-18 13:34:10 +00:00
|
|
|
]
|
2022-02-18 15:51:01 +00:00
|
|
|
}
|
|
|
|
|
2022-05-01 05:18:14 +00:00
|
|
|
withName: FILTLONG {
|
|
|
|
ext.args = [
|
2022-08-30 11:58:58 +00:00
|
|
|
"--min_length ${params.longread_qc_qualityfilter_minlength}",
|
|
|
|
"--keep_percent ${params.longread_qc_qualityfilter_keeppercent}",
|
|
|
|
"--target_bases ${params.longread_qc_qualityfilter_targetbases}"
|
2022-05-01 05:18:14 +00:00
|
|
|
]
|
|
|
|
.join(' ').trim()
|
2022-05-31 18:11:19 +00:00
|
|
|
ext.prefix = { "${meta.id}_${meta.run_accession}_filtered" }
|
2022-05-01 05:18:14 +00:00
|
|
|
publishDir = [
|
2022-12-15 09:35:06 +00:00
|
|
|
[
|
|
|
|
path: { "${params.outdir}/filtlong" },
|
|
|
|
mode: params.publish_dir_mode,
|
|
|
|
pattern: '*.fastq.gz',
|
|
|
|
enabled: params.save_preprocessed_reads
|
|
|
|
],
|
|
|
|
[
|
|
|
|
path: { "${params.outdir}/filtlong" },
|
|
|
|
mode: params.publish_dir_mode,
|
|
|
|
pattern: '*.log'
|
|
|
|
]
|
2022-05-01 05:18:14 +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
|
|
|
]
|
|
|
|
}
|
|
|
|
|
2023-02-07 10:43:40 +00:00
|
|
|
// Saving unmapped reads as FQ comes via input channel!
|
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-12-15 09:35:06 +00:00
|
|
|
path: { "${params.outdir}/bowtie2/align" },
|
|
|
|
mode: params.publish_dir_mode,
|
|
|
|
pattern: '*.log'
|
2022-04-18 04:37:23 +00:00
|
|
|
],
|
|
|
|
[
|
2022-12-15 09:35:06 +00:00
|
|
|
path: { "${params.outdir}/bowtie2/align" },
|
|
|
|
mode: params.publish_dir_mode,
|
2023-02-07 10:43:40 +00:00
|
|
|
enabled: params.save_hostremoval_bam,
|
2022-12-15 09:35:06 +00:00
|
|
|
pattern: '*.bam'
|
2022-04-18 04:37:23 +00:00
|
|
|
],
|
|
|
|
[
|
2022-12-15 09:35:06 +00:00
|
|
|
path: { "${params.outdir}/bowtie2/align" },
|
|
|
|
mode: params.publish_dir_mode,
|
|
|
|
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-05-03 07:28:46 +00:00
|
|
|
withName: MINIMAP2_INDEX {
|
|
|
|
ext.args = '-x map-ont'
|
|
|
|
publishDir = [
|
|
|
|
path: { "${params.outdir}/minimap2/index" },
|
|
|
|
mode: params.publish_dir_mode,
|
2022-05-05 07:07:33 +00:00
|
|
|
enabled: params.save_hostremoval_index,
|
2023-01-24 13:15:51 +00:00
|
|
|
pattern: '*.mmi'
|
2022-05-03 07:28:46 +00:00
|
|
|
]
|
|
|
|
}
|
|
|
|
|
|
|
|
withName: MINIMAP2_ALIGN {
|
|
|
|
ext.prefix = { "${meta.id}_${meta.run_accession}" }
|
|
|
|
publishDir = [
|
|
|
|
path: { "${params.outdir}/minimap2/align" },
|
|
|
|
mode: params.publish_dir_mode,
|
2023-02-07 10:43:40 +00:00
|
|
|
enabled: params.save_hostremoval_bam,
|
2022-05-03 07:28:46 +00:00
|
|
|
pattern: '*.bam'
|
|
|
|
]
|
|
|
|
}
|
|
|
|
|
|
|
|
withName: SAMTOOLS_VIEW {
|
|
|
|
ext.args = '-f 4'
|
2023-02-07 10:43:40 +00:00
|
|
|
ext.prefix = { "${meta.id}_${meta.run_accession}.unmapped" }
|
2022-05-03 07:28:46 +00:00
|
|
|
}
|
2022-10-31 11:35:51 +00:00
|
|
|
|
2022-05-03 07:28:46 +00:00
|
|
|
withName: SAMTOOLS_BAM2FQ {
|
2023-02-07 10:43:40 +00:00
|
|
|
ext.prefix = { "${meta.id}_${meta.run_accession}.unmapped" }
|
2022-05-03 07:28:46 +00:00
|
|
|
publishDir = [
|
|
|
|
path: { "${params.outdir}/samtools/bam2fq" },
|
|
|
|
mode: params.publish_dir_mode,
|
2022-05-05 07:07:33 +00:00
|
|
|
enabled: params.save_hostremoval_unmapped,
|
2022-05-03 07:28:46 +00:00
|
|
|
pattern: '*.fq.gz'
|
|
|
|
]
|
|
|
|
}
|
|
|
|
|
2022-10-31 11:17:49 +00:00
|
|
|
withName: SAMTOOLS_STATS {
|
2022-10-28 12:24:33 +00:00
|
|
|
ext.prefix = { "${meta.id}_${meta.run_accession}" }
|
|
|
|
publishDir = [
|
|
|
|
path: { "${params.outdir}/samtools/stats" },
|
|
|
|
mode: params.publish_dir_mode,
|
|
|
|
pattern: '*stats'
|
|
|
|
]
|
|
|
|
}
|
|
|
|
|
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()
|
2023-01-17 09:58:30 +00:00
|
|
|
ext.prefix = { "${meta.id}_${meta.run_accession}" }
|
2022-02-18 15:51:01 +00:00
|
|
|
publishDir = [
|
2022-12-15 09:35:06 +00:00
|
|
|
[
|
|
|
|
path: { "${params.outdir}/bbduk/" },
|
|
|
|
mode: params.publish_dir_mode,
|
|
|
|
pattern: '*.{fastq.gz,log}',
|
|
|
|
enabled: params.save_complexityfiltered_reads
|
|
|
|
],
|
|
|
|
[
|
|
|
|
path: { "${params.outdir}/bbduk/" },
|
|
|
|
mode: params.publish_dir_mode,
|
|
|
|
pattern: '*.log'
|
|
|
|
]
|
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}",
|
2022-08-23 12:24:57 +00:00
|
|
|
"-trim_qual_left=0 -trim_qual_left=0 -trim_qual_window=0 -trim_qual_step=0",
|
2022-04-04 19:16:51 +00:00
|
|
|
].join(' ').trim()
|
2023-01-17 09:58:30 +00:00
|
|
|
ext.prefix = { "${meta.id}_${meta.run_accession}" }
|
2022-02-18 15:51:01 +00:00
|
|
|
publishDir = [
|
2022-12-15 09:35:06 +00:00
|
|
|
[
|
|
|
|
path: { "${params.outdir}/prinseqplusplus/" },
|
|
|
|
mode: params.publish_dir_mode,
|
|
|
|
pattern: '*{_good_out.fastq.gz,_good_out_R1.fastq.gz,_good_out_R2.fastq.gz}',
|
|
|
|
enabled: params.save_complexityfiltered_reads
|
|
|
|
],
|
|
|
|
[
|
|
|
|
path: { "${params.outdir}/prinseqplusplus/" },
|
|
|
|
mode: params.publish_dir_mode,
|
|
|
|
pattern: '*.log'
|
|
|
|
]
|
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-11-24 13:44:04 +00:00
|
|
|
ext.args = { "${meta.db_params} -m ${params.malt_mode}" }
|
2022-04-16 05:42:30 +00:00
|
|
|
// one run with multiple samples, so fix ID to just db name to ensure clean log name
|
|
|
|
ext.prefix = { "${meta.db_name}" }
|
|
|
|
publishDir = [
|
2022-09-07 10:22:17 +00:00
|
|
|
path: { "${params.outdir}/malt/${meta.db_name}/" },
|
2022-04-16 05:42:30 +00:00
|
|
|
mode: params.publish_dir_mode,
|
|
|
|
pattern: '*.{rma6,log,sam}'
|
|
|
|
]
|
|
|
|
}
|
|
|
|
|
2022-09-02 06:03:05 +00:00
|
|
|
withName: 'MEGAN_RMA2INFO_TSV' {
|
2022-04-16 05:42:30 +00:00
|
|
|
ext.args = "-c2c Taxonomy"
|
|
|
|
ext.prefix = { "${meta.id}" }
|
2022-03-03 16:42:02 +00:00
|
|
|
publishDir = [
|
2022-09-07 10:22:17 +00:00
|
|
|
path: { "${params.outdir}/malt/${meta.db_name}/" },
|
2022-04-05 10:16:26 +00:00
|
|
|
mode: params.publish_dir_mode,
|
2022-04-16 05:42:30 +00:00
|
|
|
pattern: '*.{txt.gz,megan}'
|
2022-03-03 16:42:02 +00:00
|
|
|
]
|
|
|
|
}
|
|
|
|
|
|
|
|
withName: KRAKEN2_KRAKEN2 {
|
2022-10-14 10:18:07 +00:00
|
|
|
ext.args = params.kraken2_save_minimizers ? { "${meta.db_params} --report-minimizer-data" } : { "${meta.db_params}" }
|
2023-01-24 13:44:14 +00:00
|
|
|
ext.prefix = params.perform_runmerging ? { meta.tool == "bracken" ? "${meta.id}_${meta.db_name}.bracken" : "${meta.id}_${meta.db_name}.kraken2" } : { meta.tool == "bracken" ? "${meta.id}_${meta.run_accession}_${meta.db_name}.bracken" : "${meta.id}_${meta.run_accession}_${meta.db_name}.kraken2" }
|
2022-03-03 16:42:02 +00:00
|
|
|
publishDir = [
|
2022-09-07 10:22:17 +00:00
|
|
|
path: { "${params.outdir}/kraken2/${meta.db_name}/" },
|
2022-04-05 10:16:26 +00:00
|
|
|
mode: params.publish_dir_mode,
|
2023-02-02 12:58:48 +00:00
|
|
|
pattern: '*.{txt,fastq.gz}'
|
2022-03-03 16:42:02 +00:00
|
|
|
]
|
2022-02-18 06:55:14 +00:00
|
|
|
}
|
|
|
|
|
2022-10-14 10:18:07 +00:00
|
|
|
withName: BRACKEN_BRACKEN {
|
|
|
|
errorStrategy = 'ignore'
|
2023-02-07 14:51:25 +00:00
|
|
|
ext.args = { "${meta.db_params}" }
|
2023-01-17 09:58:30 +00:00
|
|
|
ext.prefix = params.perform_runmerging ? { "${meta.id}_${meta.db_name}.bracken" } : { "${meta.id}_${meta.run_accession}_${meta.db_name}.bracken" }
|
2022-10-14 10:18:07 +00:00
|
|
|
publishDir = [
|
|
|
|
path: { "${params.outdir}/bracken/${meta.db_name}/" },
|
|
|
|
mode: params.publish_dir_mode,
|
|
|
|
pattern: '*.tsv'
|
|
|
|
]
|
|
|
|
}
|
|
|
|
|
2022-12-11 15:52:34 +00:00
|
|
|
withName: BRACKEN_COMBINEBRACKENOUTPUTS {
|
|
|
|
ext.prefix = { "bracken_${meta.id}_combined_reports" }
|
|
|
|
publishDir = [
|
|
|
|
path: { "${params.outdir}/bracken/" },
|
|
|
|
mode: params.publish_dir_mode,
|
2022-12-15 09:35:06 +00:00
|
|
|
pattern: '*.txt'
|
2022-12-11 15:52:34 +00:00
|
|
|
]
|
|
|
|
}
|
|
|
|
|
2022-12-12 09:10:24 +00:00
|
|
|
withName: KRAKENTOOLS_COMBINEKREPORTS_KRAKEN {
|
2022-09-13 14:47:19 +00:00
|
|
|
ext.prefix = { "kraken2_${meta.id}_combined_reports" }
|
2022-09-13 13:47:28 +00:00
|
|
|
publishDir = [
|
|
|
|
path: { "${params.outdir}/kraken2/" },
|
|
|
|
mode: params.publish_dir_mode,
|
2022-12-12 09:10:24 +00:00
|
|
|
pattern: '*.txt'
|
2022-09-13 13:47:28 +00:00
|
|
|
]
|
|
|
|
}
|
|
|
|
|
2022-10-25 09:50:44 +00:00
|
|
|
withName: KRAKENUNIQ_PRELOADEDKRAKENUNIQ {
|
|
|
|
ext.args = { "${meta.db_params}" }
|
2022-10-31 16:07:53 +00:00
|
|
|
// one run with multiple samples, so fix ID to just db name to ensure clean log name
|
2023-01-16 13:49:44 +00:00
|
|
|
ext.prefix = { "${meta.db_name}.krakenuniq" }
|
2022-10-25 09:50:44 +00:00
|
|
|
publishDir = [
|
|
|
|
path: { "${params.outdir}/krakenuniq/${meta.db_name}/" },
|
|
|
|
mode: params.publish_dir_mode,
|
2023-02-02 12:58:48 +00:00
|
|
|
pattern: '*.{txt,fastq.gz}'
|
2022-10-25 09:50:44 +00:00
|
|
|
]
|
|
|
|
}
|
|
|
|
|
2022-06-30 16:33:11 +00:00
|
|
|
withName: KRONA_CLEANUP {
|
2023-01-17 09:58:30 +00:00
|
|
|
ext.prefix = params.perform_runmerging ? { "${meta.id}_${meta.db_name}" } : { "${meta.id}_${meta.run_accession}_${meta.db_name}" }
|
2022-06-30 16:33:11 +00:00
|
|
|
publishDir = [
|
2022-09-07 10:22:17 +00:00
|
|
|
path: { "${params.outdir}/krona/" },
|
2022-06-30 16:33:11 +00:00
|
|
|
mode: params.publish_dir_mode,
|
|
|
|
pattern: '*.{html}'
|
|
|
|
]
|
|
|
|
}
|
|
|
|
|
2022-06-14 13:48:16 +00:00
|
|
|
withName: KRONA_KTIMPORTTEXT {
|
2023-01-17 09:58:30 +00:00
|
|
|
ext.prefix = { "${meta.tool}_${meta.id}" }
|
2022-06-30 16:33:11 +00:00
|
|
|
publishDir = [
|
2022-09-07 10:22:17 +00:00
|
|
|
path: { "${params.outdir}/krona/" },
|
2022-06-30 16:33:11 +00:00
|
|
|
mode: params.publish_dir_mode,
|
|
|
|
pattern: '*.{html}'
|
|
|
|
]
|
|
|
|
}
|
|
|
|
|
2022-09-02 06:03:05 +00:00
|
|
|
withName: 'MEGAN_RMA2INFO_KRONA' {
|
2022-06-30 16:33:11 +00:00
|
|
|
ext.args = { "--read2class Taxonomy" }
|
2023-01-17 09:58:30 +00:00
|
|
|
ext.prefix = { "${meta.id}_${meta.db_name}" }
|
2022-06-30 16:33:11 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
withName: KRONA_KTIMPORTTAXONOMY {
|
|
|
|
ext.args = "-i"
|
2023-01-17 09:58:30 +00:00
|
|
|
ext.prefix = { "${meta.tool}_${meta.id}" }
|
2022-06-14 13:48:16 +00:00
|
|
|
publishDir = [
|
2022-09-07 10:22:17 +00:00
|
|
|
path: { "${params.outdir}/krona/" },
|
2022-06-14 13:48:16 +00:00
|
|
|
mode: params.publish_dir_mode,
|
|
|
|
pattern: '*.{html}'
|
2022-03-03 16:42:02 +00:00
|
|
|
]
|
2022-02-18 06:55:14 +00:00
|
|
|
}
|
|
|
|
|
2022-09-09 11:57:06 +00:00
|
|
|
withName: METAPHLAN3_METAPHLAN3 {
|
2022-04-08 11:28:37 +00:00
|
|
|
ext.args = { "${meta.db_params}" }
|
2023-01-17 09:58:30 +00:00
|
|
|
ext.prefix = params.perform_runmerging ? { "${meta.id}_${meta.db_name}.metaphlan3" } : { "${meta.id}_${meta.run_accession}_${meta.db_name}.metaphlan3" }
|
2022-04-02 12:44:27 +00:00
|
|
|
publishDir = [
|
2022-09-07 10:22:17 +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-09-09 11:57:06 +00:00
|
|
|
]
|
|
|
|
}
|
|
|
|
|
|
|
|
withName: METAPHLAN3_MERGEMETAPHLANTABLES {
|
2022-09-15 10:30:39 +00:00
|
|
|
ext.prefix = { "metaphlan3_${meta.id}_combined_reports" }
|
2022-09-09 11:57:06 +00:00
|
|
|
publishDir = [
|
|
|
|
path: { "${params.outdir}/metaphlan3/" },
|
|
|
|
mode: params.publish_dir_mode,
|
|
|
|
pattern: '*.{txt}'
|
2022-04-02 12:44:27 +00:00
|
|
|
]
|
|
|
|
}
|
|
|
|
|
2022-04-10 04:43:30 +00:00
|
|
|
withName: CENTRIFUGE_CENTRIFUGE {
|
2022-02-18 06:55:14 +00:00
|
|
|
publishDir = [
|
2022-09-07 10:22:17 +00:00
|
|
|
path: { "${params.outdir}/centrifuge/${meta.db_name}/" },
|
2022-03-15 21:05:37 +00:00
|
|
|
mode: params.publish_dir_mode,
|
2022-05-07 03:22:35 +00:00
|
|
|
pattern: '*.{txt,sam,gz}'
|
2022-02-18 06:55:14 +00:00
|
|
|
]
|
2022-04-10 04:43:30 +00:00
|
|
|
ext.args = { "${meta.db_params}" }
|
2023-01-17 09:58:30 +00:00
|
|
|
ext.prefix = params.perform_runmerging ? { "${meta.id}_${meta.db_name}.centrifuge" } : { "${meta.id}_${meta.run_accession}_${meta.db_name}.centrifuge" }
|
2022-02-18 06:55:14 +00:00
|
|
|
}
|
|
|
|
|
2022-04-22 13:24:10 +00:00
|
|
|
withName: CENTRIFUGE_KREPORT {
|
2022-07-28 06:54:32 +00:00
|
|
|
errorStrategy = {task.exitStatus == 255 ? 'ignore' : 'retry'}
|
2022-04-22 13:24:10 +00:00
|
|
|
ext.args = { "${meta.db_params}" }
|
2023-01-17 09:58:30 +00:00
|
|
|
ext.prefix = params.perform_runmerging ? { "${meta.id}_${meta.db_name}.centrifuge" } : { "${meta.id}_${meta.run_accession}_${meta.db_name}.centrifuge" }
|
2022-04-22 13:24:10 +00:00
|
|
|
publishDir = [
|
2022-09-07 10:22:17 +00:00
|
|
|
path: { "${params.outdir}/centrifuge/${meta.db_name}/" },
|
2022-04-22 13:24:10 +00:00
|
|
|
mode: params.publish_dir_mode,
|
|
|
|
pattern: '*.{txt}'
|
|
|
|
]
|
|
|
|
}
|
|
|
|
|
2022-09-13 14:47:19 +00:00
|
|
|
withName: KRAKENTOOLS_COMBINEKREPORTS_CENTRIFUGE {
|
2023-01-20 16:53:55 +00:00
|
|
|
errorStrategy = { task.exitStatus in [255,1] ? 'ignore' : 'retry' }
|
2022-09-13 14:47:19 +00:00
|
|
|
ext.prefix = { "centrifuge_${meta.id}_combined_reports" }
|
|
|
|
publishDir = [
|
|
|
|
path: { "${params.outdir}/centrifuge/" },
|
|
|
|
mode: params.publish_dir_mode,
|
|
|
|
pattern: '*.{txt}'
|
|
|
|
]
|
|
|
|
}
|
|
|
|
|
2022-04-29 19:59:42 +00:00
|
|
|
withName: KAIJU_KAIJU {
|
2023-01-17 09:58:30 +00:00
|
|
|
ext.prefix = params.perform_runmerging ? { "${meta.id}_${meta.db_name}.kaiju" } : { "${meta.id}_${meta.run_accession}_${meta.db_name}.kaiju" }
|
2022-02-18 06:55:14 +00:00
|
|
|
publishDir = [
|
2022-09-07 10:22:17 +00:00
|
|
|
path: { "${params.outdir}/kaiju/${meta.db_name}/" },
|
2022-03-15 21:05:37 +00:00
|
|
|
mode: params.publish_dir_mode,
|
2022-04-29 19:59:42 +00:00
|
|
|
pattern: '*.tsv'
|
2022-02-18 06:55:14 +00:00
|
|
|
]
|
2022-04-29 19:59:42 +00:00
|
|
|
ext.args = { "${meta.db_params}" }
|
2022-02-18 06:55:14 +00:00
|
|
|
}
|
|
|
|
|
2023-02-16 13:02:13 +00:00
|
|
|
withName: '.*PROFILING:KAIJU_KAIJU2TABLE' {
|
2023-02-16 12:39:05 +00:00
|
|
|
ext.prefix = params.perform_runmerging ? { "${meta.id}_${meta.db_name}.kaijutable" } : { "${meta.id}_${meta.run_accession}_${meta.db_name}.kaijutable" }
|
2022-04-10 04:44:10 +00:00
|
|
|
publishDir = [
|
2023-02-16 12:39:05 +00:00
|
|
|
path: { "${params.outdir}/kaiju/${meta.db_name}/" },
|
2022-04-10 04:44:10 +00:00
|
|
|
mode: params.publish_dir_mode,
|
2022-04-29 19:59:42 +00:00
|
|
|
pattern: '*.{txt}'
|
2022-04-10 04:44:10 +00:00
|
|
|
]
|
|
|
|
}
|
|
|
|
|
2023-02-16 13:02:13 +00:00
|
|
|
withName: '.*STANDARDISATION_PROFILES:KAIJU_KAIJU2TABLE' {
|
2022-09-13 14:47:19 +00:00
|
|
|
ext.prefix = { "kaiju_${meta.id}_combined_reports" }
|
2022-04-10 04:44:10 +00:00
|
|
|
publishDir = [
|
2022-09-06 15:34:45 +00:00
|
|
|
path: { "${params.outdir}/kaiju/" },
|
2022-04-10 04:44:10 +00:00
|
|
|
mode: params.publish_dir_mode,
|
2022-04-29 19:59:42 +00:00
|
|
|
pattern: '*.{txt}'
|
2022-04-10 04:44:10 +00:00
|
|
|
]
|
|
|
|
}
|
|
|
|
|
2022-06-27 18:39:42 +00:00
|
|
|
withName: KAIJU_KAIJU2KRONA {
|
|
|
|
ext.args = '-v -u'
|
|
|
|
}
|
|
|
|
|
2022-04-29 20:02:44 +00:00
|
|
|
withName: DIAMOND_BLASTX {
|
2022-04-29 19:59:42 +00:00
|
|
|
ext.args = { "${meta.db_params}" }
|
2023-01-17 09:58:30 +00:00
|
|
|
ext.prefix = params.perform_runmerging ? { "${meta.id}_${meta.db_name}.diamond" } : { "${meta.id}_${meta.run_accession}_${meta.db_name}.diamond" }
|
2022-04-13 16:51:56 +00:00
|
|
|
publishDir = [
|
2022-09-07 10:22:17 +00:00
|
|
|
path: { "${params.outdir}/diamond/${meta.db_name}/" },
|
2022-04-13 16:51:56 +00:00
|
|
|
mode: params.publish_dir_mode,
|
2022-07-28 13:52:31 +00:00
|
|
|
pattern: '*.{blast,xml,txt,daa,sam,tsv,paf,log}'
|
2022-04-13 16:51:56 +00:00
|
|
|
]
|
|
|
|
}
|
2022-04-25 15:36:29 +00:00
|
|
|
|
2022-05-31 12:57:00 +00:00
|
|
|
withName: MOTUS_PROFILE {
|
2022-11-29 12:28:04 +00:00
|
|
|
ext.args = {
|
2022-11-29 12:31:00 +00:00
|
|
|
[
|
2022-12-01 12:42:21 +00:00
|
|
|
params.motus_remove_ncbi_ids ? "" : "-p",
|
|
|
|
params.motus_use_relative_abundance ? "" : "-c",
|
|
|
|
params.motus_save_mgc_read_counts ? "-M ${task.ext.prefix}.mgc" : ""
|
2022-11-29 12:28:04 +00:00
|
|
|
].join(',').replaceAll(','," ")
|
2022-11-29 12:31:00 +00:00
|
|
|
}
|
2023-01-17 09:58:30 +00:00
|
|
|
ext.prefix = params.perform_runmerging ? { "${meta.id}_${meta.db_name}" } : { "${meta.id}_${meta.run_accession}_${meta.db_name}" }
|
2022-05-31 12:57:00 +00:00
|
|
|
publishDir = [
|
2022-09-07 10:22:17 +00:00
|
|
|
path: { "${params.outdir}/motus/${meta.db_name}/" },
|
2022-05-31 12:57:00 +00:00
|
|
|
mode: params.publish_dir_mode
|
|
|
|
]
|
|
|
|
}
|
|
|
|
|
2022-07-12 09:39:26 +00:00
|
|
|
withName: MOTUS_MERGE {
|
2023-02-17 13:47:29 +00:00
|
|
|
ext.args = { params.standardisation_motus_generatebiom ? "-B" : "" }
|
2022-09-16 06:36:34 +00:00
|
|
|
ext.prefix = { "motus_${meta.id}_combined_reports" }
|
2022-07-12 09:39:26 +00:00
|
|
|
publishDir = [
|
|
|
|
path: { "${params.outdir}/motus/" },
|
|
|
|
mode: params.publish_dir_mode
|
|
|
|
]
|
|
|
|
}
|
|
|
|
|
2023-02-16 13:29:52 +00:00
|
|
|
withName: TAXPASTA_MERGE {
|
|
|
|
ext.args = {
|
|
|
|
[
|
2023-02-17 13:47:29 +00:00
|
|
|
"-p ${meta.tool} -o ${meta.tool}_${meta.id}.${params.standardisation_taxpasta_format}",
|
|
|
|
params.standardisation_taxpasta_addtaxonomy ? "-p" : ""
|
2023-02-17 08:16:58 +00:00
|
|
|
].join(' ').trim()
|
2023-02-16 13:29:52 +00:00
|
|
|
}
|
|
|
|
publishDir = [
|
|
|
|
path: { "${params.outdir}/taxpasta/" },
|
|
|
|
mode: params.publish_dir_mode,
|
|
|
|
pattern: '*.{tsv,csv,arrow,parquet,biom}'
|
|
|
|
]
|
|
|
|
}
|
|
|
|
|
2022-04-29 19:59:42 +00:00
|
|
|
withName: CUSTOM_DUMPSOFTWAREVERSIONS {
|
2022-04-25 15:36:29 +00:00
|
|
|
publishDir = [
|
2022-04-29 19:59:42 +00:00
|
|
|
path: { "${params.outdir}/pipeline_info" },
|
2022-04-25 15:36:29 +00:00
|
|
|
mode: params.publish_dir_mode,
|
2022-04-29 19:59:42 +00:00
|
|
|
pattern: '*_versions.yml'
|
|
|
|
]
|
|
|
|
}
|
|
|
|
|
|
|
|
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-04-25 15:36:29 +00:00
|
|
|
]
|
|
|
|
}
|
2022-02-18 06:55:14 +00:00
|
|
|
}
|