From f7e40f1bf22ba09168677bf47edddd5e50d84cc5 Mon Sep 17 00:00:00 2001 From: jimmyliu1326 Date: Fri, 31 May 2024 13:53:55 -0700 Subject: [PATCH] use nf-core/rasusa --- subworkflows/local/nanopore_raw_reads_qc.nf | 30 +++++++++++++-------- subworkflows/local/raw_reads_qc.nf | 7 +++-- 2 files changed, 22 insertions(+), 15 deletions(-) diff --git a/subworkflows/local/nanopore_raw_reads_qc.nf b/subworkflows/local/nanopore_raw_reads_qc.nf index 7fec87b..9cffbe3 100644 --- a/subworkflows/local/nanopore_raw_reads_qc.nf +++ b/subworkflows/local/nanopore_raw_reads_qc.nf @@ -10,25 +10,33 @@ workflow NANOPORE_RAW_READS_QC { main: ch_versions = Channel.empty() + ch_qc_reads = ch_merged_reads if (!params.skip_porechop) { PORECHOP_ABI(ch_merged_reads) - ch_merged_reads = PORECHOP_ABI.out.reads + ch_qc_reads = PORECHOP_ABI.out.reads } if (!params.skip_subsampling) { - ch_genomesize = Channel.of(params.genomesize) - - ch_merged_reads - .combine(ch_genomesize) - .set{ch_sub_reads_qc} - + + // ch_coverages = Channel.fromList(params.depth_cut_off.split(',').collect { it.trim().toDouble() }) + + if (!params.skip_porechop) { + PORECHOP_ABI.out.reads + .map { meta, fastq -> + tuple(meta, fastq, params.subsampling_genomesize) + } + .set{ch_sub_reads_qc} + } else { + ch_merged_reads + .map { tuple(it[0], it[1], params.subsampling_genomesize) } + .set{ch_sub_reads_qc} + } RASUSA_NANOPORE(ch_sub_reads_qc, params.depth_cut_off) - - ch_merged_reads = RASUSA_NANOPORE.out.reads + ch_qc_reads = RASUSA_NANOPORE.out.reads } if (!params.skip_quality_report) { if (!params.skip_nanocomp) { - ch_merged_reads + ch_qc_reads .map { [it[1]] } .collect() .map { reads -> [ [id: params.nanopore_summary_file_id], reads ] } @@ -44,5 +52,5 @@ workflow NANOPORE_RAW_READS_QC { } emit: - merged_reads = ch_merged_reads + merged_reads = ch_qc_reads } \ No newline at end of file diff --git a/subworkflows/local/raw_reads_qc.nf b/subworkflows/local/raw_reads_qc.nf index 2737ce0..930ba42 100644 --- a/subworkflows/local/raw_reads_qc.nf +++ b/subworkflows/local/raw_reads_qc.nf @@ -5,7 +5,7 @@ include { FASTQC as RAW_FASTQC } from '../../modules/nf-core/fastqc' include { FASTQC as TRIM_FASTQC } from '../../modules/nf-core/fastqc' include { MULTIQC as TRIM_MULTIQC } from '../../modules/nf-core/multiqc' include { MULTIQC as RAW_MULTIQC } from '../../modules/nf-core/multiqc' -include { RASUSA } from '../../modules/local/rasusa' +include { RASUSA } from '../../modules/nf-core/rasusa' include { CONFINDR } from '../../modules/local/confindr' include { AGGREGATE_CONFINDR_RESULTS } from '../../modules/local/aggregate_confindr_results' include { CAT_FASTQ } from '../../modules/nf-core/cat/fastq/main' @@ -39,15 +39,14 @@ workflow RAW_READS_QC { if (!params.skip_subsampling) { ch_genomesize = Channel.of(params.subsampling_genomesize) - ch_coverages = Channel.fromList(params.depth_cut_off.split(',').collect { it.trim().toDouble() }) + // ch_coverages = Channel.fromList(params.depth_cut_off.split(',').collect { it.trim().toDouble() }) ch_raw_reads_qc .map { tuple(it[0], it[1], params.subsampling_genomesize) } - .combine(ch_coverages) .set { ch_sub_reads_qc } // .view() - RASUSA(ch_sub_reads_qc) + RASUSA(ch_sub_reads_qc, params.depth_cut_off) ch_raw_reads_qc = RASUSA.out.reads }