Skip to content

Commit

Permalink
use nf-core/rasusa
Browse files Browse the repository at this point in the history
  • Loading branch information
jimmyliu1326 committed May 31, 2024
1 parent 9288fe3 commit f7e40f1
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 15 deletions.
30 changes: 19 additions & 11 deletions subworkflows/local/nanopore_raw_reads_qc.nf
Original file line number Diff line number Diff line change
Expand Up @@ -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 ] }
Expand All @@ -44,5 +52,5 @@ workflow NANOPORE_RAW_READS_QC {
}

emit:
merged_reads = ch_merged_reads
merged_reads = ch_qc_reads
}
7 changes: 3 additions & 4 deletions subworkflows/local/raw_reads_qc.nf
Original file line number Diff line number Diff line change
Expand Up @@ -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'
Expand Down Expand Up @@ -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
}
Expand Down

0 comments on commit f7e40f1

Please sign in to comment.