Skip to content

Commit

Permalink
update workflow output ch emits
Browse files Browse the repository at this point in the history
  • Loading branch information
sateeshperi committed Nov 30, 2024
1 parent e280822 commit 3af27a7
Show file tree
Hide file tree
Showing 4 changed files with 33 additions and 15 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ nextflow_pipeline {
script "../main.nf"
config "./nextflow.config"

test("CAT_FASTQ | skip_trimming | skip_deduplication") {
test("Params: bismark | CAT_FASTQ | skip_trimming | skip_deduplication") {
when {
params {
input = "${projectDir}/assets/samplesheet_replicates.csv"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"CAT_FASTQ | skip_trimming | skip_deduplication": {
"Params: bismark | CAT_FASTQ | skip_trimming | skip_deduplication": {
"content": [
17,
{
Expand Down Expand Up @@ -260,4 +260,4 @@
},
"timestamp": "2024-11-30T13:43:42.602433043"
}
}
}
12 changes: 6 additions & 6 deletions tests/bismark_run_qualimap.nf.test.snap
Original file line number Diff line number Diff line change
Expand Up @@ -556,7 +556,7 @@
"genome_mapping_quality_histogram.png:md5,74776b1e7e8c8876af1cf89d9dbb5f31",
"genome_reads_content_per_read_position.png:md5,c6920dc357411880132c207c7d0aa68d",
"genome_uniq_read_starts_histogram.png:md5,8f7549a63eee3d3f022699aaa5bb858d",
"qualimapReport.html:md5,bbc015c0d1f3c41a08c82fb7a6839039",
"qualimapReport.html:md5,e2274cb2b25345dc7b76b89fa7730a04",
"coverage_across_reference.txt:md5,2bb9eb828acfd71ace8f1e6a2ca124b4",
"coverage_histogram.txt:md5,6ee761660a6072e5b6b75b7fe8d2c69e",
"duplication_rate_histogram.txt:md5,d5f25ad3572b98880b6904dcf4b3ed25",
Expand Down Expand Up @@ -601,7 +601,7 @@
"genome_mapping_quality_histogram.png:md5,7ba0db9375d09fd49946b9bca4ba92b4",
"genome_reads_content_per_read_position.png:md5,1a6a7717ea948d2518808f72f58ffdef",
"genome_uniq_read_starts_histogram.png:md5,395413ab1d0e10af72b116fd8cb12685",
"qualimapReport.html:md5,1fe626f663d66a7ce0c6e1e0207d829d",
"qualimapReport.html:md5,e841c7cc3bb8beca037a98e55d3d7a12",
"coverage_across_reference.txt:md5,081ddc3be3349b0c57d9676c03d84803",
"coverage_histogram.txt:md5,47b75803a6925e883e254bb91d6220d2",
"duplication_rate_histogram.txt:md5,3d06b34e40d1fdeb55c4ad19dc6ddad1",
Expand Down Expand Up @@ -643,7 +643,7 @@
"genome_mapping_quality_histogram.png:md5,017451f46bc875ac58e7906bf7979956",
"genome_reads_content_per_read_position.png:md5,fd94ec5bfe5ca4adfa6ebdeaebe25157",
"genome_uniq_read_starts_histogram.png:md5,2f2555ef88c3bda05315469e684f5b19",
"qualimapReport.html:md5,af640b29bd28f80bdc0ab6fe7d9c97f4",
"qualimapReport.html:md5,ef10a67a886f948f244a74506ea96071",
"coverage_across_reference.txt:md5,a76b3da0ebb2f8bd6c36ec1902cf13f2",
"coverage_histogram.txt:md5,ca854c05e9619233b7d95d44051cab80",
"duplication_rate_histogram.txt:md5,530bb05c648d610227e121e1e74f41f8",
Expand Down Expand Up @@ -685,7 +685,7 @@
"genome_mapping_quality_histogram.png:md5,a22ee10fcb9e34a84f607b089855fb92",
"genome_reads_content_per_read_position.png:md5,9fa406f353148448f6b9ac11880bc6de",
"genome_uniq_read_starts_histogram.png:md5,cf2fe3e30e11e7d6eb2db679cd12dc03",
"qualimapReport.html:md5,c8114fbb2a63da68111f0d4cbb8a1973",
"qualimapReport.html:md5,c600f4100ccb57a26ac2132c575f8e3e",
"coverage_across_reference.txt:md5,fb9c989fc6c15d0a8fd0a58b8d3c20ce",
"coverage_histogram.txt:md5,8a3f45461442657433914c6a5ecb1301",
"duplication_rate_histogram.txt:md5,ec9a705fd3a300b126d556afa14c326b",
Expand Down Expand Up @@ -752,6 +752,6 @@
"nf-test": "0.9.2",
"nextflow": "24.10.2"
},
"timestamp": "2024-11-28T09:47:26.992492832"
"timestamp": "2024-11-30T14:38:57.39810446"
}
}
}
30 changes: 24 additions & 6 deletions workflows/methylseq/main.nf
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,14 @@ workflow METHYLSEQ {

main:

ch_fastq = Channel.empty()
ch_fastqc_html = Channel.empty()
ch_fastqc_zip = Channel.empty()
ch_reads = Channel.empty()
ch_bam = Channel.empty()
ch_bai = Channel.empty()
ch_qualimap = Channel.empty()
ch_preseq = Channel.empty()
ch_multiqc_files = Channel.empty()

//
Expand Down Expand Up @@ -64,6 +72,8 @@ workflow METHYLSEQ {
FASTQC (
ch_fastq
)
ch_fastqc_html = FASTQC.out.html
ch_fastqc_zip = FASTQC.out.zip
ch_multiqc_files = ch_multiqc_files.mix(FASTQC.out.zip.collect{ meta, zip -> zip })
ch_versions = ch_versions.mix(FASTQC.out.versions.first())

Expand All @@ -74,10 +84,10 @@ workflow METHYLSEQ {
TRIMGALORE(
ch_fastq
)
reads = TRIMGALORE.out.reads
ch_reads = TRIMGALORE.out.reads
ch_versions = ch_versions.mix(TRIMGALORE.out.versions.first())
} else {
reads = ch_fastq
ch_reads = ch_fastq
}

//
Expand All @@ -90,28 +100,30 @@ workflow METHYLSEQ {
// Run Bismark alignment + downstream processing
//
FASTQ_ALIGN_DEDUP_BISMARK (
reads,
ch_reads,
ch_fasta,
ch_bismark_index,
params.skip_deduplication || params.rrbs,
params.cytosine_report || params.nomeseq
)
ch_versions = ch_versions.mix(FASTQ_ALIGN_DEDUP_BISMARK.out.versions.unique{ it.baseName })
ch_bam = FASTQ_ALIGN_DEDUP_BISMARK.out.bam
ch_bam = FASTQ_ALIGN_DEDUP_BISMARK.out.bam
ch_bai = FASTQ_ALIGN_DEDUP_BISMARK.out.bai
ch_aligner_mqc = FASTQ_ALIGN_DEDUP_BISMARK.out.multiqc
}
// Aligner: bwameth
else if ( params.aligner == 'bwameth' ){

FASTQ_ALIGN_DEDUP_BWAMETH (
reads,
ch_reads,
ch_fasta,
ch_fasta_index.map{ index -> [ [:], index ]},
ch_bwameth_index,
params.skip_deduplication || params.rrbs,
)
ch_versions = ch_versions.mix(FASTQ_ALIGN_DEDUP_BWAMETH.out.versions.unique{ it.baseName })
ch_bam = FASTQ_ALIGN_DEDUP_BWAMETH.out.bam
ch_bam = FASTQ_ALIGN_DEDUP_BWAMETH.out.bam
ch_bai = FASTQ_ALIGN_DEDUP_BWAMETH.out.bai
ch_aligner_mqc = FASTQ_ALIGN_DEDUP_BWAMETH.out.multiqc
}

Expand All @@ -124,6 +136,7 @@ workflow METHYLSEQ {
ch_bam,
params.bamqc_regions_file ? Channel.fromPath( params.bamqc_regions_file, checkIfExists: true ).toList() : []
)
ch_qualimap = QUALIMAP_BAMQC.out.results
ch_versions = ch_versions.mix(QUALIMAP_BAMQC.out.versions.first())
}

Expand All @@ -135,6 +148,7 @@ workflow METHYLSEQ {
PRESEQ_LCEXTRAP (
ch_bam
)
ch_preseq = PRESEQ_LCEXTRAP.out.lc_extrap
ch_versions = ch_versions.mix(PRESEQ_LCEXTRAP.out.versions.first())
}

Expand Down Expand Up @@ -199,6 +213,10 @@ workflow METHYLSEQ {
)

emit:
bam = ch_bam // channel: [ path(bam) ]
bai = ch_bai // channel: [ path(bai) ]
qualimap = ch_qualimap // channel: [ path(qualimap) ]
preseq = ch_preseq // channel: [ path(preseq) ]
multiqc_report = MULTIQC.out.report.toList() // channel: [ path(multiqc_report.html ) ]
versions = ch_versions // channel: [ path(versions.yml) ]
}
Expand Down

0 comments on commit 3af27a7

Please sign in to comment.