2022-04-03 05:58:40 +00:00
|
|
|
//
|
|
|
|
// Remove host reads via alignment and export off-target reads
|
|
|
|
//
|
|
|
|
|
2022-04-03 15:23:14 +00:00
|
|
|
include { BOWTIE2_BUILD } from '../../modules/nf-core/modules/bowtie2/build/main'
|
|
|
|
include { BOWTIE2_ALIGN } from '../../modules/nf-core/modules/bowtie2/align/main'
|
2022-04-03 05:58:40 +00:00
|
|
|
|
2022-04-03 15:23:14 +00:00
|
|
|
workflow SHORTREAD_HOSTREMOVAL {
|
2022-04-03 05:58:40 +00:00
|
|
|
take:
|
|
|
|
reads // [ [ meta ], [ reads ] ]
|
|
|
|
reference // /path/to/fasta
|
2022-04-03 15:23:14 +00:00
|
|
|
index // /path/to/index
|
2022-04-03 05:58:40 +00:00
|
|
|
|
|
|
|
main:
|
|
|
|
ch_versions = Channel.empty()
|
|
|
|
ch_multiqc_files = Channel.empty()
|
|
|
|
|
|
|
|
if ( !params.shortread_hostremoval_index ) {
|
2022-04-03 15:23:14 +00:00
|
|
|
ch_bowtie2_index = BOWTIE2_BUILD ( reference ).index
|
|
|
|
ch_versions = ch_versions.mix( BOWTIE2_BUILD.out.versions )
|
|
|
|
} else {
|
|
|
|
ch_bowtie2_index = index.first()
|
2022-04-03 05:58:40 +00:00
|
|
|
}
|
|
|
|
|
2022-04-03 15:23:14 +00:00
|
|
|
BOWTIE2_ALIGN ( reads, ch_bowtie2_index, true )
|
|
|
|
ch_versions = ch_versions.mix( BOWTIE2_ALIGN.out.versions.first() )
|
|
|
|
ch_multiqc_files = ch_multiqc_files.mix( BOWTIE2_ALIGN.out.log )
|
2022-04-03 05:58:40 +00:00
|
|
|
|
|
|
|
emit:
|
|
|
|
reads = BOWTIE2_ALIGN.out.fastq // channel: [ val(meta), [ reads ] ]
|
2022-04-03 15:23:14 +00:00
|
|
|
versions = ch_versions // channel: [ versions.yml ]
|
2022-04-03 05:58:40 +00:00
|
|
|
mqc = ch_multiqc_files
|
|
|
|
}
|
|
|
|
|