diff --git a/modules/bigwig/star/main.nf b/modules/bigwig/star/main.nf index a4d5f56..6176c2d 100644 --- a/modules/bigwig/star/main.nf +++ b/modules/bigwig/star/main.nf @@ -31,7 +31,7 @@ process signal { """ } -process bigwig { +process bw { tag "${sample}" container params.bgtobwContainer @@ -89,3 +89,16 @@ process bigwig { } cmd.join('\n') } + +workflow bigwig { + take: + fastaIndex + genomeAlignments + + main: + signal( fastaIndex, genomeAlignments ) + bw( fastaIndex, signal.out ) + + emit: + bw.out +} diff --git a/tests/modules/bigwig/star/main.bigwig.nf.test b/tests/modules/bigwig/star/main.bigwig.nf.test index 56f4abe..4365ee8 100644 --- a/tests/modules/bigwig/star/main.bigwig.nf.test +++ b/tests/modules/bigwig/star/main.bigwig.nf.test @@ -2,7 +2,7 @@ nextflow_process { name "Test Process bigwig" script "modules/bigwig/star/main.nf" - process "bigwig" + process "bw" tag "module" diff --git a/tests/workflows/signal.nf.test b/tests/workflows/signal.nf.test index 8ce93aa..ab0bb19 100644 --- a/tests/workflows/signal.nf.test +++ b/tests/workflows/signal.nf.test @@ -6,7 +6,7 @@ nextflow_workflow { tag "workflow" - test("Should produce bigwig files") { + test("Should produce bigwig files with STAR") { when { params { @@ -32,6 +32,32 @@ nextflow_workflow { } + test("Should produce bigwig files with RGCRG") { + + when { + params { + fastaIndexTool = "samtools" + contigTool = "rgcrg" + bigwigTool = "rgcrg" + stepList = ['bigwig'] + } + workflow { + """ + input[0] = file("${baseDir}/data/genome.fa.gz") + input[1] = Channel.from([ + [ "sample3", "test3", file("${baseDir}/data/sample3_m4_n10_toGenome.bam"), "bam", "GenomeAlignments", true, "MATE2_SENSE"] + ]) + """ + } + } + + then { + assert workflow.success + assert snapshot(workflow.out).match() + } + + } + test("Should produce contig files") { when { diff --git a/tests/workflows/signal.nf.test.snap b/tests/workflows/signal.nf.test.snap index 971b5c2..cf5c2bf 100644 --- a/tests/workflows/signal.nf.test.snap +++ b/tests/workflows/signal.nf.test.snap @@ -36,9 +36,66 @@ "nf-test": "0.8.4", "nextflow": "23.10.1" }, - "timestamp": "2024-04-25T14:05:02.995265" + "timestamp": "2024-04-30T18:20:00.779747" }, - "Should produce bigwig files": { + "Should produce bigwig files with RGCRG": { + "content": [ + { + "0": [ + + ], + "1": [ + [ + "sample3", + "test3", + "sample3.minusRaw.bw:md5,db10a50bb7eebec0f3421f4460d4cae8", + "bigWig", + "MinusRawSignal", + true, + "MATE2_SENSE" + ], + [ + "sample3", + "test3", + "sample3.plusRaw.bw:md5,235e2d65c856c969048e432234c04ff4", + "bigWig", + "PlusRawSignal", + true, + "MATE2_SENSE" + ] + ], + "bigwigs": [ + [ + "sample3", + "test3", + "sample3.minusRaw.bw:md5,db10a50bb7eebec0f3421f4460d4cae8", + "bigWig", + "MinusRawSignal", + true, + "MATE2_SENSE" + ], + [ + "sample3", + "test3", + "sample3.plusRaw.bw:md5,235e2d65c856c969048e432234c04ff4", + "bigWig", + "PlusRawSignal", + true, + "MATE2_SENSE" + ] + ], + "contigs": [ + + ] + } + ], + "meta": { + "nf-test": "0.8.4", + "nextflow": "23.10.1" + }, + "timestamp": "2024-04-30T18:14:51.685863" + }, + "Should produce bigwig files with STAR": { "content": [ { "0": [ @@ -129,6 +186,6 @@ "nf-test": "0.8.4", "nextflow": "23.10.1" }, - "timestamp": "2024-04-25T14:04:52.79812" + "timestamp": "2024-04-30T18:20:54.929343" } } \ No newline at end of file diff --git a/workflows/signal.nf b/workflows/signal.nf index 406d0ec..bf1d240 100644 --- a/workflows/signal.nf +++ b/workflows/signal.nf @@ -1,6 +1,6 @@ include { fastaIndex } from "../modules/fastaIndex/${params.fastaIndexTool}" include { contig } from "../modules/contig/${params.contigTool.toLowerCase()}" -include { signal as bedgraph; bigwig } from "../modules/bigwig/${params.bigwigTool.toLowerCase()}" +include { bigwig } from "../modules/bigwig/${params.bigwigTool.toLowerCase()}" doBigwig = ( 'bigwig' in params.stepList ) doContig = ( 'contig' in params.stepList ) @@ -15,8 +15,7 @@ workflow signal { fastaIndex( genome ) } if ( doBigwig ) { - bedgraph( fastaIndex.out, genomeAlignments ) - bigwig( fastaIndex.out, bedgraph.out ) + bigwig( fastaIndex.out, genomeAlignments ) } if ( doContig ) { contig( fastaIndex.out, genomeAlignments )