1
0
Fork 0
mirror of https://github.com/MillironX/taxprofiler.git synced 2024-09-21 08:32:03 +00:00
taxprofiler/subworkflows/local/shortread_hostremoval.nf

35 lines
1.1 KiB
Text
Raw Normal View History

2022-04-03 05:58:40 +00:00
//
// Remove host reads via alignment and export off-target reads
//
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
workflow SHORTREAD_HOSTREMOVAL {
2022-04-03 05:58:40 +00:00
take:
reads // [ [ meta ], [ reads ] ]
reference // /path/to/fasta
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 ) {
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
}
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 ] ]
versions = ch_versions // channel: [ versions.yml ]
2022-04-03 05:58:40 +00:00
mqc = ch_multiqc_files
}