1
0
Fork 0
mirror of https://github.com/MillironX/taxprofiler.git synced 2024-11-28 00:59:54 +00:00
taxprofiler/conf/modules.config

380 lines
14 KiB
Text
Raw Normal View History

/*
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
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 {
withName: SAMPLESHEET_CHECK {
publishDir = [
path: { "${params.outdir}/pipeline_info" },
mode: params.publish_dir_mode,
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: FASTQC {
ext.args = '--quiet'
ext.prefix = { "${meta.id}_${meta.run_accession}_raw" }
publishDir = [
path: { "${params.outdir}/fastqc/raw" },
mode: params.publish_dir_mode,
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: params.publish_dir_mode,
2022-03-25 13:58:06 +00:00
pattern: '*.html'
]
}
withName: FASTP_SINGLE {
ext.args = [
// trimming options
params.shortread_qc_skipadaptertrim ? "--disable_adapter_trimming" : "",
params.shortread_qc_adapter1 ? "--adapter_sequence ${params.shortread_qc_adapter1}" : "",
// filtering options
2022-05-31 18:11:19 +00:00
"--length_required ${params.shortread_qc_minlength}",
(params.perform_shortread_complexityfilter && params.shortread_complexityfilter_tool == 'fastp') ? "--low_complexity_filter --complexity_threshold ${params.shortread_complexityfilter_fastp_threshold}" : ''
].join(' ').trim()
ext.prefix = { "${meta.id}_${meta.run_accession}" }
publishDir = [
path: { "${params.outdir}/fastp" },
mode: params.publish_dir_mode,
2022-04-06 08:27:11 +00:00
pattern: '*.fastq.gz',
enabled: params.save_preprocessed_reads
]
}
withName: FASTP_PAIRED {
ext.args = [
2022-03-27 07:30:23 +00:00
// collapsing options - option to retain singletons
params.shortread_qc_excludeunmerged ? '' : "--include_unmerged",
2022-03-25 13:58:06 +00:00
// trimming options
params.shortread_qc_skipadaptertrim ? "--disable_adapter_trimming" : "",
params.shortread_qc_adapter1 ? "--adapter_sequence ${params.shortread_qc_adapter1}" : "",
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}" : ''
].join(' ').trim()
ext.prefix = { "${meta.id}_${meta.run_accession}" }
publishDir = [
path: { "${params.outdir}/fastp" },
mode: params.publish_dir_mode,
2022-04-06 08:27:11 +00:00
pattern: '*.fastq.gz',
enabled: params.save_preprocessed_reads
]
}
withName: ADAPTERREMOVAL_SINGLE {
ext.args = [
// trimming options
params.shortread_qc_skipadaptertrim ? "--adapter1 '' --adapter2 ''" : "",
params.shortread_qc_adapter1 ? "--adapter1 ${params.shortread_qc_adapter1}" : "",
// filtering options
"--minlength ${params.shortread_qc_minlength}"
].join(' ').trim()
ext.prefix = { "${meta.id}_${meta.run_accession}" }
publishDir = [
path: { "${params.outdir}/adapterremoval" },
mode: params.publish_dir_mode,
2022-04-06 08:27:11 +00:00
pattern: '*.fastq.gz',
enabled: params.save_preprocessed_reads
]
}
withName: ADAPTERREMOVAL_PAIRED {
ext.args = [
// collapsing options
params.shortread_qc_mergepairs ? "--collapse" : "",
// trimming options
params.shortread_qc_skipadaptertrim ? "--adapter1 '' --adapter2 ''" : "",
params.shortread_qc_adapter1 ? "--adapter1 ${params.shortread_qc_adapter1}" : "",
params.shortread_qc_adapter2 ? "--adapter2 ${params.shortread_qc_adapter2}" : "",
// filtering options
"--minlength ${params.shortread_qc_minlength}"
].join(' ').trim()
ext.prefix = { "${meta.id}_${meta.run_accession}" }
publishDir = [
path: { "${params.outdir}/adapterremoval" },
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
withName: PORECHOP {
ext.prefix = { "${meta.id}_${meta.run_accession}" }
publishDir = [
path: { "${params.outdir}/porechop" },
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
]
}
withName: FILTLONG {
ext.args = [
"--min_length ${params.longread_qc_minlength}",
2022-06-02 09:53:53 +00:00
"--keep_percent ${params.longread_qc_keep_percent}",
"--target_bases ${params.longread_qc_target_bases}"
]
.join(' ').trim()
2022-05-31 18:11:19 +00:00
ext.prefix = { "${meta.id}_${meta.run_accession}_filtered" }
publishDir = [
2022-05-31 18:11:19 +00:00
path: { "${params.outdir}/filtlong" },
mode: params.publish_dir_mode,
pattern: '*.fastq.gz',
enabled: params.save_preprocessed_reads
]
}
withName: BOWTIE2_BUILD {
publishDir = [
path: { "${params.outdir}/bowtie2/build" },
2022-04-07 12:00:10 +00:00
mode: params.publish_dir_mode,
enabled: params.save_hostremoval_index,
2022-04-18 04:37:23 +00:00
pattern: 'bowtie2'
]
}
withName: BOWTIE2_ALIGN {
ext.prefix = { "${meta.id}_${meta.run_accession}" }
2022-04-18 04:37:23 +00:00
publishDir = [
[
path: { "${params.outdir}/bowtie2/align" },
mode: params.publish_dir_mode,
pattern: '*.log'
2022-04-18 04:37:23 +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
],
[
path: { "${params.outdir}/bowtie2/align" },
2022-04-07 12:00:10 +00:00
mode: params.publish_dir_mode,
enabled: params.save_hostremoval_unmapped,
pattern: '*.fastq.gz'
2022-04-18 04:37:23 +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,
enabled: params.save_hostremoval_index,
2022-05-03 07:28:46 +00:00
pattern: 'minimap2'
]
}
withName: MINIMAP2_ALIGN {
ext.prefix = { "${meta.id}_${meta.run_accession}" }
publishDir = [
path: { "${params.outdir}/minimap2/align" },
mode: params.publish_dir_mode,
enabled: params.save_hostremoval_mapped,
2022-05-03 07:28:46 +00:00
pattern: '*.bam'
]
}
withName: SAMTOOLS_VIEW {
ext.args = '-f 4'
ext.prefix = { "${meta.id}.mapped.sorted" }
publishDir = [
path: { "${params.outdir}/samtools/view" },
mode: params.publish_dir_mode,
enabled: params.save_hostremoval_unmapped,
2022-05-03 07:28:46 +00:00
pattern: '*.bam'
]
}
withName: SAMTOOLS_BAM2FQ {
ext.prefix = { "${meta.id}_${meta.run_accession}" }
publishDir = [
path: { "${params.outdir}/samtools/bam2fq" },
mode: params.publish_dir_mode,
enabled: params.save_hostremoval_unmapped,
2022-05-03 07:28:46 +00:00
pattern: '*.fq.gz'
]
}
withName: BBMAP_BBDUK {
ext.args = [
"entropy=${params.shortread_complexityfilter_entropy}",
"entropywindow=${params.shortread_complexityfilter_bbduk_windowsize}",
params.shortread_complexityfilter_bbduk_mask ? "entropymask=t" : "entropymask=f"
].join(' ').trim()
ext.prefix = { "${meta.id}-${meta.run_accession}" }
publishDir = [
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
]
}
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}" }
publishDir = [
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-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
]
}
withName: MALT_RUN {
ext.args = { "${meta.db_params}" }
// one run with multiple samples, so fix ID to just db name to ensure clean log name
ext.prefix = { "${meta.db_name}" }
publishDir = [
path: { "${params.outdir}/malt/${meta.db_name}" },
mode: params.publish_dir_mode,
pattern: '*.{rma6,log,sam}'
]
}
withName: MEGAN_RMA2INFO {
ext.args = "-c2c Taxonomy"
ext.prefix = { "${meta.id}" }
publishDir = [
path: { "${params.outdir}/malt/${meta.db_name}" },
mode: params.publish_dir_mode,
pattern: '*.{txt.gz,megan}'
]
}
withName: KRAKEN2_KRAKEN2 {
ext.args = { "${meta.db_params}" }
ext.prefix = params.perform_runmerging ? { "${meta.id}-${meta.db_name}" } : { "${meta.id}-${meta.run_accession}-${meta.db_name}" }
publishDir = [
path: { "${params.outdir}/kraken2/${meta.db_name}" },
mode: params.publish_dir_mode,
pattern: '*.{txt,report,fastq.gz}'
]
}
withName: KRONA_IMPORTKRAKEN {
publishDir = [
path: { "${params.outdir}/krona" },
mode: params.publish_dir_mode,
pattern: '*.{html}'
]
}
2022-04-02 12:44:27 +00:00
withName: METAPHLAN3 {
2022-04-08 11:28:37 +00:00
ext.args = { "${meta.db_params}" }
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}'
]
}
withName: CENTRIFUGE_CENTRIFUGE {
publishDir = [
path: { "${params.outdir}/centrifuge/${meta.db_name}" },
mode: params.publish_dir_mode,
pattern: '*.{txt,sam,gz}'
]
ext.args = { "${meta.db_params}" }
ext.prefix = params.perform_runmerging ? { "${meta.id}-${meta.db_name}" } : { "${meta.id}-${meta.run_accession}-${meta.db_name}" }
}
2022-04-22 13:24:10 +00:00
withName: CENTRIFUGE_KREPORT {
ext.args = { "${meta.db_params}" }
2022-04-25 07:21:29 +00:00
ext.prefix = params.perform_runmerging ? { "${meta.id}-${meta.db_name}" } : { "${meta.id}-${meta.run_accession}-${meta.db_name}" }
2022-04-22 13:24:10 +00:00
publishDir = [
path: { "${params.outdir}/centrifuge/${meta.db_name}" },
mode: params.publish_dir_mode,
pattern: '*.{txt}'
]
}
2022-04-29 19:59:42 +00:00
withName: KAIJU_KAIJU {
publishDir = [
2022-04-29 19:59:42 +00:00
path: { "${params.outdir}/kaiju/${meta.db_name}" },
mode: params.publish_dir_mode,
2022-04-29 19:59:42 +00:00
pattern: '*.tsv'
]
2022-04-29 19:59:42 +00:00
ext.args = { "${meta.db_params}" }
ext.prefix = params.perform_runmerging ? { "${meta.id}-${meta.db_name}" } : { "${meta.id}-${meta.run_accession}-${meta.db_name}" }
}
2022-04-29 20:02:44 +00:00
withName: KAIJU_KAIJU2TABLE {
2022-04-29 19:59:42 +00:00
ext.args = { "${meta.db_params}" }
ext.prefix = params.perform_runmerging ? { "${meta.id}-${meta.db_name}" } : { "${meta.id}-${meta.run_accession}-${meta.db_name}" }
2022-04-10 04:44:10 +00:00
publishDir = [
2022-04-29 19:59:42 +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
]
}
2022-04-29 20:02:44 +00:00
withName: DIAMOND_BLASTX {
2022-04-29 19:59:42 +00:00
ext.args = { "${meta.db_params}" }
ext.prefix = params.perform_runmerging ? { "${meta.id}-${meta.db_name}" } : { "${meta.id}-${meta.run_accession}-${meta.db_name}" }
2022-04-13 16:51:56 +00:00
publishDir = [
2022-04-29 19:59:42 +00:00
path: { "${params.outdir}/diamond/${meta.db_name}" },
2022-04-13 16:51:56 +00:00
mode: params.publish_dir_mode,
2022-04-29 19:59:42 +00:00
pattern: '*.{blast,xml,txt,daa,sam,tsv,paf}'
2022-04-13 16:51:56 +00:00
]
}
2022-04-25 15:36:29 +00:00
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
]
}
}