1
0
Fork 0
mirror of https://github.com/MillironX/taxprofiler.git synced 2024-11-10 23:43:08 +00:00
taxprofiler/subworkflows/local/longread_preprocessing.nf

64 lines
2.6 KiB
Text
Raw Normal View History

//
// Process long raw reads with porechop
//
2022-03-25 14:21:52 +00:00
include { FASTQC as FASTQC_PROCESSED } from '../../modules/nf-core/modules/fastqc/main'
include { PORECHOP } from '../../modules/nf-core/modules/porechop/main'
include { FILTLONG } from '../../modules/nf-core/modules/filtlong/main'
workflow LONGREAD_PREPROCESSING {
take:
reads
main:
ch_versions = Channel.empty()
ch_multiqc_files = Channel.empty()
if ( params.longread_qc_run_clip && !params.longread_qc_run_filter ) {
PORECHOP ( reads )
ch_processed_reads = PORECHOP.out.reads
.map {
meta, reads ->
def meta_new = meta.clone()
meta_new['single_end'] = 1
[ meta_new, reads ]
}
ch_versions = ch_versions.mix(PORECHOP.out.versions.first())
ch_multiqc_files = ch_multiqc_files.mix( PORECHOP.out.log.collect{it[1]}.ifEmpty([]) )
} else if ( !params.longread_qc_run_clip && params.longread_qc_run_filter ) {
ch_processed_reads = FILTLONG ( reads.map{ meta, reads -> [meta, [], reads ]} )
ch_versions = ch_versions.mix(FILTLONG.out.versions.first())
2022-07-19 14:44:08 +00:00
ch_multiqc_files = ch_multiqc_files.mix( FILTLONG.out.log )
} else {
PORECHOP ( reads )
ch_clipped_reads = PORECHOP.out.reads
.map {
meta, reads ->
def meta_new = meta.clone()
meta_new['single_end'] = 1
[ meta_new, reads ]
}
ch_processed_reads = FILTLONG ( ch_clipped_reads.map{ meta, reads -> [meta, [], reads ]} ).reads
ch_versions = ch_versions.mix(PORECHOP.out.versions.first())
ch_versions = ch_versions.mix(FILTLONG.out.versions.first())
2022-07-19 15:10:10 +00:00
ch_multiqc_files = ch_multiqc_files.mix( PORECHOP.out.log.collect{it[1]}.ifEmpty([]) )
2022-07-20 12:05:23 +00:00
ch_multiqc_files = ch_multiqc_files.mix( FILTLONG.out.log.collect{it[1]}.ifEmpty([]) )
}
FASTQC_PROCESSED ( ch_processed_reads )
ch_multiqc_files = ch_multiqc_files.mix( FASTQC_PROCESSED.out.zip )
emit:
reads = ch_processed_reads // channel: [ val(meta), [ reads ] ]
versions = ch_versions // channel: [ versions.yml ]
mqc = ch_multiqc_files
}