2022-02-19 11:36:08 +00:00
|
|
|
//
|
2022-04-02 15:02:05 +00:00
|
|
|
// Perform read trimming and merging
|
2022-02-19 11:36:08 +00:00
|
|
|
//
|
|
|
|
|
|
|
|
|
2022-03-25 13:58:06 +00:00
|
|
|
include { SHORTREAD_FASTP } from './shortread_fastp'
|
2022-03-31 13:31:45 +00:00
|
|
|
include { SHORTREAD_ADAPTERREMOVAL } from './shortread_adapterremoval'
|
2022-03-25 13:58:06 +00:00
|
|
|
include { FASTQC as FASTQC_PROCESSED } from '../../modules/nf-core/modules/fastqc/main'
|
2022-02-19 11:36:08 +00:00
|
|
|
|
2022-03-21 17:29:47 +00:00
|
|
|
workflow SHORTREAD_PREPROCESSING {
|
2022-02-19 11:36:08 +00:00
|
|
|
take:
|
2022-04-02 15:02:05 +00:00
|
|
|
reads // [ [ meta ], [ reads ] ]
|
2022-02-19 11:36:08 +00:00
|
|
|
|
|
|
|
main:
|
2022-03-25 13:58:06 +00:00
|
|
|
ch_versions = Channel.empty()
|
|
|
|
ch_multiqc_files = Channel.empty()
|
2022-02-19 11:36:08 +00:00
|
|
|
|
2022-05-01 05:18:14 +00:00
|
|
|
if ( params.shortread_qc_tool == "fastp" ) {
|
2022-03-25 13:58:06 +00:00
|
|
|
ch_processed_reads = SHORTREAD_FASTP ( reads ).reads
|
|
|
|
ch_versions = ch_versions.mix( SHORTREAD_FASTP.out.versions )
|
|
|
|
ch_multiqc_files = ch_multiqc_files.mix( SHORTREAD_FASTP.out.mqc )
|
2022-05-01 05:18:14 +00:00
|
|
|
} else if ( params.shortread_qc_tool == "adapterremoval" ) {
|
2022-03-31 13:31:45 +00:00
|
|
|
ch_processed_reads = SHORTREAD_ADAPTERREMOVAL ( reads ).reads
|
2022-04-01 13:34:05 +00:00
|
|
|
ch_versions = ch_versions.mix( SHORTREAD_ADAPTERREMOVAL.out.versions )
|
|
|
|
ch_multiqc_files = ch_multiqc_files.mix( SHORTREAD_ADAPTERREMOVAL.out.mqc )
|
2022-02-19 11:36:08 +00:00
|
|
|
} else {
|
|
|
|
ch_processed_reads = reads
|
|
|
|
}
|
|
|
|
|
2022-03-25 14:32:56 +00:00
|
|
|
FASTQC_PROCESSED ( ch_processed_reads )
|
|
|
|
ch_versions = ch_versions.mix( FASTQC_PROCESSED.out.versions )
|
2022-04-02 15:02:05 +00:00
|
|
|
ch_multiqc_files = ch_multiqc_files.mix( FASTQC_PROCESSED.out.zip )
|
2022-02-19 11:36:08 +00:00
|
|
|
|
|
|
|
emit:
|
|
|
|
reads = ch_processed_reads // channel: [ val(meta), [ reads ] ]
|
|
|
|
versions = ch_versions // channel: [ versions.yml ]
|
|
|
|
mqc = ch_multiqc_files
|
|
|
|
}
|
|
|
|
|