Skip to content

Commit

Permalink
Fix issue with STAR signal module
Browse files Browse the repository at this point in the history
  • Loading branch information
emi80 committed Apr 30, 2024
1 parent 1d11dc8 commit acb6b52
Show file tree
Hide file tree
Showing 5 changed files with 104 additions and 9 deletions.
15 changes: 14 additions & 1 deletion modules/bigwig/star/main.nf
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ process signal {
"""
}

process bigwig {
process bw {

tag "${sample}"
container params.bgtobwContainer
Expand Down Expand Up @@ -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
}
2 changes: 1 addition & 1 deletion tests/modules/bigwig/star/main.bigwig.nf.test
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ nextflow_process {

name "Test Process bigwig"
script "modules/bigwig/star/main.nf"
process "bigwig"
process "bw"

tag "module"

Expand Down
28 changes: 27 additions & 1 deletion tests/workflows/signal.nf.test
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ nextflow_workflow {

tag "workflow"

test("Should produce bigwig files") {
test("Should produce bigwig files with STAR") {

when {
params {
Expand All @@ -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 {
Expand Down
63 changes: 60 additions & 3 deletions tests/workflows/signal.nf.test.snap
Original file line number Diff line number Diff line change
Expand Up @@ -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": [
Expand Down Expand Up @@ -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"
}
}
5 changes: 2 additions & 3 deletions workflows/signal.nf
Original file line number Diff line number Diff line change
@@ -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 )
Expand All @@ -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 )
Expand Down

0 comments on commit acb6b52

Please sign in to comment.