Skip to content

Commit ac77676

Browse files
authoredMar 17, 2022
Merge branch 'dev' into nf-core-template-merge-2.3
2 parents 699d26b + e39c6a8 commit ac77676

21 files changed

+1056
-258
lines changed
 

‎README.md

+18-2
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
## Introduction
1818

1919
<!-- TODO nf-core: Write a 1-2 sentence summary of what data the pipeline is for and what it does -->
20-
**nf-core/taxprofiler** is a bioinformatics best-practice analysis pipeline for Taxonomic profiling of shotgun metagenomic data.
20+
**nf-core/taxprofiler** is a bioinformatics best-practice analysis pipeline for taxonomic profiling of shotgun metagenomic data. It allows for in-parallel profiling against multiple profiling tools and databases and produces standardised output tables.
2121

2222
The pipeline is built using [Nextflow](https://www.nextflow.io), a workflow tool to run tasks across multiple compute infrastructures in a very portable manner. It uses Docker/Singularity containers making installation trivial and results highly reproducible. The [Nextflow DSL2](https://www.nextflow.io/docs/latest/dsl2.html) implementation of this pipeline uses one container per process which makes it much easier to maintain and update software dependencies. Where possible, these processes have been submitted to and installed from [nf-core/modules](https://github.com/nf-core/modules) in order to make them available to all nf-core pipelines, and to everyone within the Nextflow community!
2323

@@ -29,7 +29,23 @@ On release, automated continuous integration tests run the pipeline on a full-si
2929
<!-- TODO nf-core: Fill in short bullet-pointed list of the default steps in the pipeline -->
3030

3131
1. Read QC ([`FastQC`](https://www.bioinformatics.babraham.ac.uk/projects/fastqc/))
32-
2. Present QC for raw reads ([`MultiQC`](http://multiqc.info/))
32+
2. Performs optional read pre-processing
33+
- Adapter clipping and merging
34+
- Low complexity filtering
35+
- Host read removal
36+
- Run merging
37+
3. Performs taxonomic profiling a choice of:
38+
- Kraken2
39+
- MetaPhlAn3
40+
- MALT
41+
- DIAMOND
42+
- Centrifuge
43+
- Kaiju
44+
- mOTUs
45+
4. Perform optional post-processing with:
46+
- bracken
47+
5. Standardises output tables
48+
6. Present QC for raw reads ([`MultiQC`](http://multiqc.info/))
3349

3450
## Quick Start
3551

‎bin/check_samplesheet.py

+207-229
Large diffs are not rendered by default.

‎conf/modules.config

+59
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,65 @@ process {
2828

2929
withName: FASTQC {
3030
ext.args = '--quiet'
31+
ext.prefix = { "${meta.id}_${meta.run_accession}_raw" }
32+
publishDir = [
33+
path: { "${params.outdir}/fastqc/raw" },
34+
mode: 'copy',
35+
pattern: '*.html'
36+
]
37+
}
38+
39+
withName: FASTP {
40+
ext.prefix = { "${meta.id}_${meta.run_accession}" }
41+
// TODO also include option to NOT merge
42+
ext.args = [
43+
{ ${meta.single_end} } == 0 ? "-m" : '',
44+
params.fastp_exclude_unmerged ? '' : "--include_unmerged"
45+
].join(' ').trim()
46+
publishDir = [
47+
path: { "${params.outdir}/fastp" },
48+
mode: 'copy',
49+
pattern: '*.fastq.gz'
50+
]
51+
}
52+
53+
withName: FASTQC_POST {
54+
ext.args = '--quiet'
55+
ext.prefix = { "${meta.id}_${meta.run_accession}_processed" }
56+
publishDir = [
57+
path: { "${params.outdir}/fastqc/processed" },
58+
mode: 'copy',
59+
pattern: '*.html'
60+
]
61+
}
62+
63+
withName: CAT_FASTQ {
64+
publishDir = [
65+
path: { "${params.outdir}/prepared_sequences" },
66+
mode: 'copy',
67+
pattern: '*.fastq.gz'
68+
]
69+
}
70+
71+
withName: MALT_RUN {
72+
publishDir = [
73+
path: { "${params.outdir}/malt/${meta.db_name}" },
74+
mode: 'copy',
75+
pattern: '*.{rma6,tab,text,sam,log}'
76+
]
77+
ext.args = { "${meta.db_params}" }
78+
ext.when = params.run_malt
79+
}
80+
81+
withName: KRAKEN2_KRAKEN2 {
82+
publishDir = [
83+
path: { "${params.outdir}/kraken2/${meta.db_name}" },
84+
mode: 'copy',
85+
pattern: '.{fastq.gz,txt}'
86+
]
87+
ext.args = { "${meta.db_params}" }
88+
ext.when = params.run_kraken2
89+
ext.prefix = { "${meta.id}-${meta.db_name}" }
3190
}
3291

3392
withName: CUSTOM_DUMPSOFTWAREVERSIONS {

‎conf/test.config

+1-3
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,6 @@ params {
2222
// Input data
2323
// TODO nf-core: Specify the paths to your test data on nf-core/test-datasets
2424
// TODO nf-core: Give any required params for the test so that command line flags are not needed
25-
input = 'https://raw.githubusercontent.com/nf-core/test-datasets/viralrecon/samplesheet/samplesheet_test_illumina_amplicon.csv'
25+
input = 'https://raw.githubusercontent.com/nf-core/test-datasets/taxprofiler/samplesheet.csv'
2626

27-
// Genome references
28-
genome = 'R64-1-1'
2927
}

‎lib/WorkflowTaxprofiler.groovy

+5-4
Original file line numberDiff line numberDiff line change
@@ -10,10 +10,11 @@ class WorkflowTaxprofiler {
1010
public static void initialise(params, log) {
1111
genomeExistsError(params, log)
1212

13-
if (!params.fasta) {
14-
log.error "Genome fasta file not specified with e.g. '--fasta genome.fa' or via a detectable config file."
15-
System.exit(1)
16-
}
13+
// TODO update as necessary
14+
//if (!params.fasta) {
15+
// log.error "Genome fasta file not specified with e.g. '--fasta genome.fa' or via a detectable config file."
16+
// System.exit(1)
17+
//}
1718
}
1819

1920
//

‎modules.json

+12
Original file line numberDiff line numberDiff line change
@@ -3,12 +3,24 @@
33
"homePage": "https://github.com/nf-core/taxprofiler",
44
"repos": {
55
"nf-core/modules": {
6+
"cat/fastq": {
7+
"git_sha": "e745e167c1020928ef20ea1397b6b4d230681b4d"
8+
},
69
"custom/dumpsoftwareversions": {
710
"git_sha": "20d8250d9f39ddb05dfb437603aaf99b5c0b2b41"
811
},
12+
"fastp": {
13+
"git_sha": "d0a1cbb703a130c19f6796c3fce24fbe7dfce789"
14+
},
915
"fastqc": {
1016
"git_sha": "9d0cad583b9a71a6509b754fdf589cbfbed08961"
1117
},
18+
"kraken2/kraken2": {
19+
"git_sha": "e745e167c1020928ef20ea1397b6b4d230681b4d"
20+
},
21+
"malt/run": {
22+
"git_sha": "72b96f4e504eef673f2b5c13560a9d90b669129b"
23+
},
1224
"multiqc": {
1325
"git_sha": "20d8250d9f39ddb05dfb437603aaf99b5c0b2b41"
1426
}

‎modules/local/database_check.nf

+25
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
process DATABASE_CHECK {
2+
tag "$databasesheet"
3+
4+
conda (params.enable_conda ? "conda-forge::python=3.8.3" : null)
5+
container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ?
6+
'https://depot.galaxyproject.org/singularity/python:3.8.3' :
7+
'quay.io/biocontainers/python:3.8.3' }"
8+
9+
input:
10+
path databasesheet
11+
12+
output:
13+
path '*.csv' , emit: csv
14+
path "versions.yml", emit: versions
15+
16+
script: // This script is bundled with the pipeline, in nf-core/taxprofiler/bin/
17+
"""
18+
cat $databasesheet >> database_sheet.valid.csv
19+
20+
cat <<-END_VERSIONS > versions.yml
21+
"${task.process}":
22+
python: \$(python --version | sed 's/Python //g')
23+
END_VERSIONS
24+
"""
25+
}
+51
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
+39
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

‎modules/nf-core/modules/fastp/main.nf

+75
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
+68
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
+50
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
+58
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

‎nextflow.config

+14-1
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ params {
3434
help = false
3535
validate_params = true
3636
show_hidden_params = false
37-
schema_ignore_params = 'genomes'
37+
schema_ignore_params = 'genomes,fasta'
3838
enable_conda = false
3939

4040
// Config options
@@ -51,6 +51,19 @@ params {
5151
max_cpus = 16
5252
max_time = '240.h'
5353

54+
// Databaess
55+
databases = null
56+
57+
// FASTQ preprocessing
58+
fastp_clip_merge = false
59+
fastp_exclude_unmerged = true
60+
61+
// MALT
62+
run_malt = false
63+
malt_mode = 'BlastN'
64+
65+
// kraken2
66+
run_kraken2 = false
5467
}
5568

5669
// Load base.config by default for all pipelines

‎nextflow_schema.json

-9
Original file line numberDiff line numberDiff line change
@@ -57,15 +57,6 @@
5757
"fa_icon": "fas fa-book",
5858
"help_text": "If using a reference genome configured in the pipeline using iGenomes, use this parameter to give the ID for the reference. This is then used to build the full paths for all required reference genome files e.g. `--genome GRCh38`. \n\nSee the [nf-core website docs](https://nf-co.re/usage/reference_genomes) for more details."
5959
},
60-
"fasta": {
61-
"type": "string",
62-
"format": "file-path",
63-
"mimetype": "text/plain",
64-
"pattern": "^\\S+\\.fn?a(sta)?(\\.gz)?$",
65-
"description": "Path to FASTA genome file.",
66-
"help_text": "This parameter is *mandatory* if `--genome` is not specified. If you don't have a BWA index available this will be generated for you automatically. Combine with `--save_reference` to save BWA index for future runs.",
67-
"fa_icon": "far fa-file-code"
68-
},
6960
"igenomes_base": {
7061
"type": "string",
7162
"format": "directory-path",

‎subworkflows/local/db_check.nf

+40
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
//
2+
// Check input samplesheet and get read channels
3+
//
4+
5+
include { DATABASE_CHECK } from '../../modules/local/database_check'
6+
7+
workflow DB_CHECK {
8+
take:
9+
dbsheet // file: /path/to/dbsheet.csv
10+
11+
main:
12+
13+
// TODO: make database sheet check
14+
parsed_samplesheet = DATABASE_CHECK ( dbsheet )
15+
.csv
16+
.splitCsv ( header:true, sep:',' )
17+
.dump(tag: "db_split_csv_out")
18+
.map { create_db_channels(it) }
19+
.dump(tag: "db_channel_prepped")
20+
.set{ dbs }
21+
22+
emit:
23+
dbs // channel: [ val(meta), [ db ] ]
24+
versions = DATABASE_CHECK.out.versions // channel: [ versions.yml ]
25+
}
26+
27+
def create_db_channels(LinkedHashMap row) {
28+
def meta = [:]
29+
meta.tool = row.tool
30+
meta.db_name = row.db_name
31+
meta.db_params = row.db_params
32+
33+
def array = []
34+
if (!file(row.db_path, type: 'dir').exists()) {
35+
exit 1, "ERROR: Please check input samplesheet -> database could not be found!\n${row.db_path}"
36+
}
37+
array = [ meta, file(row.db_path) ]
38+
39+
return array
40+
}

‎subworkflows/local/input_check.nf

+39-6
Original file line numberDiff line numberDiff line change
@@ -9,23 +9,39 @@ workflow INPUT_CHECK {
99
samplesheet // file: /path/to/samplesheet.csv
1010

1111
main:
12-
SAMPLESHEET_CHECK ( samplesheet )
12+
parsed_samplesheet = SAMPLESHEET_CHECK ( samplesheet )
1313
.csv
1414
.splitCsv ( header:true, sep:',' )
15-
.map { create_fastq_channel(it) }
16-
.set { reads }
15+
.dump(tag: "input_split_csv_out")
16+
.branch {
17+
fasta: it['fasta'] != ''
18+
fastq: true
19+
}
20+
21+
parsed_samplesheet.fastq
22+
.map { create_fastq_channels(it) }
23+
.dump(tag: "fastq_channel_init")
24+
.set { fastq }
25+
26+
parsed_samplesheet.fasta
27+
.map { create_fasta_channels(it) }
28+
.dump(tag: "fasta_channel_init")
29+
.set { fasta }
1730

1831
emit:
19-
reads // channel: [ val(meta), [ reads ] ]
32+
fastq // channel: [ val(meta), [ reads ] ]
33+
fasta // channel: [ val(meta), fasta ]
2034
versions = SAMPLESHEET_CHECK.out.versions // channel: [ versions.yml ]
2135
}
2236

2337
// Function to get list of [ meta, [ fastq_1, fastq_2 ] ]
2438
def create_fastq_channel(LinkedHashMap row) {
2539
// create meta map
2640
def meta = [:]
27-
meta.id = row.sample
28-
meta.single_end = row.single_end.toBoolean()
41+
meta.id = row.sample
42+
meta.run_accession = row.run_accession
43+
meta.instrument_platform = row.instrument_platform
44+
meta.single_end = row.single_end.toBoolean()
2945

3046
// add path(s) of the fastq file(s) to the meta map
3147
def fastq_meta = []
@@ -42,3 +58,20 @@ def create_fastq_channel(LinkedHashMap row) {
4258
}
4359
return fastq_meta
4460
}
61+
62+
// Function to get list of [ meta, fasta ]
63+
def create_fasta_channels(LinkedHashMap row) {
64+
def meta = [:]
65+
meta.id = row.sample
66+
meta.run_accession = row.run_accession
67+
meta.instrument_platform = row.instrument_platform
68+
meta.single_end = true
69+
70+
def array = []
71+
if (!file(row.fasta).exists()) {
72+
exit 1, "ERROR: Please check input samplesheet -> FastA file does not exist!\n${row.fasta}"
73+
}
74+
array = [ meta, [ file(row.fasta) ] ]
75+
76+
return array
77+
}

‎subworkflows/local/preprocessing.nf

+73
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,73 @@
1+
//
2+
// Check input samplesheet and get read channels
3+
//
4+
5+
6+
include { FASTP as FASTP_SINGLE } from '../../modules/nf-core/modules/fastp/main'
7+
include { FASTP as FASTP_PAIRED } from '../../modules/nf-core/modules/fastp/main'
8+
include { FASTQC as FASTQC_POST } from '../../modules/nf-core/modules/fastqc/main'
9+
10+
workflow FASTQ_PREPROCESSING {
11+
take:
12+
reads // file: /path/to/samplesheet.csv
13+
14+
main:
15+
ch_versions = Channel.empty()
16+
ch_multiqc_files = Channel.empty()
17+
18+
//
19+
// STEP: Read clipping and merging
20+
//
21+
// TODO give option to clip only and retain pairs
22+
// TODO give option to retain singletons (probably fastp option likely)
23+
// TODO move to subworkflow
24+
25+
26+
if ( params.fastp_clip_merge ) {
27+
28+
ch_input_for_fastp = reads
29+
.dump(tag: "pre-fastp_branch")
30+
.branch{
31+
single: it[0]['single_end'] == true
32+
paired: it[0]['single_end'] == false
33+
}
34+
35+
ch_input_for_fastp.single.dump(tag: "input_fastp_single")
36+
ch_input_for_fastp.paired.dump(tag: "input_fastp_paired")
37+
38+
FASTP_SINGLE ( ch_input_for_fastp.single, false, false )
39+
FASTP_PAIRED ( ch_input_for_fastp.paired, false, true )
40+
41+
ch_fastp_reads_prepped = FASTP_PAIRED.out.reads_merged
42+
.mix( FASTP_SINGLE.out.reads )
43+
.map {
44+
meta, reads ->
45+
def meta_new = meta.clone()
46+
meta_new['single_end'] = 1
47+
[ meta_new, reads ]
48+
}
49+
50+
FASTQC_POST ( ch_fastp_reads_prepped )
51+
52+
ch_versions = ch_versions.mix(FASTP_SINGLE.out.versions.first())
53+
ch_versions = ch_versions.mix(FASTP_PAIRED.out.versions.first())
54+
55+
ch_processed_reads = ch_fastp_reads_prepped
56+
57+
ch_multiqc_files = ch_multiqc_files.mix( FASTQC_POST.out.zip.collect{it[1]} )
58+
ch_multiqc_files = ch_multiqc_files.mix( FASTP_SINGLE.out.json.collect{it[1]} )
59+
ch_multiqc_files = ch_multiqc_files.mix( FASTP_PAIRED.out.json.collect{it[1]} )
60+
61+
ch_multiqc_files.dump(tag: "preprocessing_mqc_final")
62+
63+
} else {
64+
ch_processed_reads = reads
65+
}
66+
67+
68+
emit:
69+
reads = ch_processed_reads // channel: [ val(meta), [ reads ] ]
70+
versions = ch_versions // channel: [ versions.yml ]
71+
mqc = ch_multiqc_files
72+
}
73+

‎workflows/taxprofiler.nf

+113-4
Original file line numberDiff line numberDiff line change
@@ -11,11 +11,12 @@ WorkflowTaxprofiler.initialise(params, log)
1111

1212
// TODO nf-core: Add all file path parameters for the pipeline to the list below
1313
// Check input path parameters to see if they exist
14-
def checkPathParamList = [ params.input, params.multiqc_config, params.fasta ]
14+
def checkPathParamList = [ params.input, params.databases, params.multiqc_config ]
1515
for (param in checkPathParamList) { if (param) { file(param, checkIfExists: true) } }
1616

1717
// Check mandatory parameters
18-
if (params.input) { ch_input = file(params.input) } else { exit 1, 'Input samplesheet not specified!' }
18+
if (params.input ) { ch_input = file(params.input) } else { exit 1, 'Input samplesheet not specified!' }
19+
if (params.databases) { ch_databases = file(params.databases) } else { exit 1, 'Input database sheet not specified!' }
1920

2021
/*
2122
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
@@ -35,7 +36,11 @@ ch_multiqc_custom_config = params.multiqc_config ? Channel.fromPath(params.multi
3536
//
3637
// SUBWORKFLOW: Consisting of a mix of local and nf-core/modules
3738
//
38-
include { INPUT_CHECK } from '../subworkflows/local/input_check'
39+
include { INPUT_CHECK } from '../subworkflows/local/input_check'
40+
41+
include { DB_CHECK } from '../subworkflows/local/db_check'
42+
include { FASTQ_PREPROCESSING } from '../subworkflows/local/preprocessing'
43+
3944

4045
/*
4146
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
@@ -50,6 +55,11 @@ include { FASTQC } from '../modules/nf-core/modules/fastqc/
5055
include { MULTIQC } from '../modules/nf-core/modules/multiqc/main'
5156
include { CUSTOM_DUMPSOFTWAREVERSIONS } from '../modules/nf-core/modules/custom/dumpsoftwareversions/main'
5257

58+
include { CAT_FASTQ } from '../modules/nf-core/modules/cat/fastq/main'
59+
include { MALT_RUN } from '../modules/nf-core/modules/malt/run/main'
60+
include { KRAKEN2_KRAKEN2 } from '../modules/nf-core/modules/kraken2/kraken2/main'
61+
62+
5363
/*
5464
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
5565
RUN MAIN WORKFLOW
@@ -71,18 +81,104 @@ workflow TAXPROFILER {
7181
)
7282
ch_versions = ch_versions.mix(INPUT_CHECK.out.versions)
7383

84+
DB_CHECK (
85+
ch_databases
86+
)
87+
7488
//
7589
// MODULE: Run FastQC
7690
//
7791
FASTQC (
78-
INPUT_CHECK.out.reads
92+
INPUT_CHECK.out.fastq
7993
)
8094
ch_versions = ch_versions.mix(FASTQC.out.versions.first())
8195

8296
CUSTOM_DUMPSOFTWAREVERSIONS (
8397
ch_versions.unique().collectFile(name: 'collated_versions.yml')
8498
)
8599

100+
//
101+
// PERFORM PREPROCESSING
102+
//
103+
if ( params.fastp_clip_merge ) {
104+
FASTQ_PREPROCESSING ( INPUT_CHECK.out.fastq )
105+
}
106+
107+
//
108+
// PERFORM RUN MERGING
109+
//
110+
ch_processed_for_combine = FASTQ_PREPROCESSING.out.reads
111+
.dump(tag: "prep_for_combine_grouping")
112+
.map {
113+
meta, reads ->
114+
def meta_new = meta.clone()
115+
meta_new['run_accession'] = 'combined'
116+
[ meta_new, reads ]
117+
}
118+
.groupTuple ( by: 0 )
119+
.branch{
120+
combine: it[1].size() >= 2
121+
skip: it[1].size() < 2
122+
}
123+
124+
CAT_FASTQ ( ch_processed_for_combine.combine )
125+
126+
ch_reads_for_profiling = ch_processed_for_combine.skip
127+
.dump(tag: "skip_combine")
128+
.mix( CAT_FASTQ.out.reads )
129+
.dump(tag: "files_for_profiling")
130+
131+
//
132+
// COMBINE READS WITH POSSIBLE DATABASES
133+
//
134+
135+
// output [DUMP: reads_plus_db] [['id':'2612', 'run_accession':'combined', 'instrument_platform':'ILLUMINA', 'single_end':1], <reads_path>/2612.merged.fastq.gz, ['tool':'malt', 'db_name':'mal95', 'db_params':'"-id 90"'], <db_path>/malt90]
136+
ch_input_for_profiling = ch_reads_for_profiling
137+
.combine(DB_CHECK.out.dbs)
138+
.dump(tag: "reads_plus_db")
139+
.branch {
140+
malt: it[2]['tool'] == 'malt'
141+
kraken2: it[2]['tool'] == 'kraken2'
142+
unknown: true
143+
}
144+
145+
//
146+
// PREP PROFILER INPUT CHANNELS ON PER TOOL BASIS
147+
//
148+
149+
// We groupTuple to have all samples in one channel for MALT as database
150+
// loading takes a long time, so we only want to run it once per database
151+
ch_input_for_malt = ch_input_for_profiling.malt
152+
.map {
153+
it ->
154+
def temp_meta = [ id: it[2]['db_name']] + it[2]
155+
def db = it[3]
156+
[ temp_meta, it[1], db ]
157+
}
158+
.groupTuple(by: [0,2])
159+
.dump(tag: "input for malt")
160+
.multiMap {
161+
it ->
162+
reads: [ it[0], it[1].flatten() ]
163+
db: it[2]
164+
}
165+
166+
// We can run Kraken2 one-by-one sample-wise
167+
ch_input_for_kraken2 = ch_input_for_profiling.kraken2
168+
.dump(tag: "input for kraken")
169+
.multiMap {
170+
it ->
171+
reads: [ it[0] + it[2], it[1] ]
172+
db: it[3]
173+
}
174+
175+
//
176+
// RUN PROFILING
177+
//
178+
MALT_RUN ( ch_input_for_malt.reads, params.malt_mode, ch_input_for_malt.db )
179+
KRAKEN2_KRAKEN2 ( ch_input_for_kraken2.reads, ch_input_for_kraken2.db )
180+
181+
86182
//
87183
// MODULE: MultiQC
88184
//
@@ -95,7 +191,20 @@ workflow TAXPROFILER {
95191
ch_multiqc_files = ch_multiqc_files.mix(ch_workflow_summary.collectFile(name: 'workflow_summary_mqc.yaml'))
96192
ch_multiqc_files = ch_multiqc_files.mix(CUSTOM_DUMPSOFTWAREVERSIONS.out.mqc_yml.collect())
97193
ch_multiqc_files = ch_multiqc_files.mix(FASTQC.out.zip.collect{it[1]}.ifEmpty([]))
194+
if (params.fastp_clip_merge) {
195+
ch_multiqc_files = ch_multiqc_files.mix(FASTQ_PREPROCESSING.out.mqc)
196+
}
197+
if (params.run_kraken2) {
198+
ch_multiqc_files = ch_multiqc_files.mix(KRAKEN2_KRAKEN2.out.txt.collect{it[1]}.ifEmpty([]))
199+
ch_versions = ch_versions.mix(KRAKEN2_KRAKEN2.out.versions.first())
200+
}
201+
if (params.run_malt) {
202+
ch_multiqc_files = ch_multiqc_files.mix(MALT_RUN.out.log.collect{it[1]}.ifEmpty([]))
203+
ch_versions = ch_versions.mix(MALT_RUN.out.versions.first())
204+
}
98205

206+
// TODO MALT results overwriting per database?
207+
// TODO Versions for Karken/MALT not report?
99208
MULTIQC (
100209
ch_multiqc_files.collect()
101210
)

0 commit comments

Comments
 (0)
Please sign in to comment.