-
Notifications
You must be signed in to change notification settings - Fork 10
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add nf-test for mergeBam module and merging workflow
- Loading branch information
Showing
11 changed files
with
419 additions
and
4 deletions.
There are no files selected for viewing
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
nextflow_process { | ||
|
||
name "Test Process mergeBam" | ||
script "modules/mergeBam/sambamba/main.nf" | ||
process "mergeBam" | ||
|
||
tag "module" | ||
|
||
test("Should merge BAM files using sambamba") { | ||
|
||
when { | ||
params { | ||
maxMismatches = 4 | ||
maxMultimaps = 10 | ||
} | ||
process { | ||
""" | ||
input[0] = Channel.from([ | ||
[ "sample2", [ "test2", "test3" ], file("${baseDir}/data/test*/*toGenome_sorted.bam"), "bam", "GenomeAlignments", true] | ||
]) | ||
""" | ||
} | ||
} | ||
|
||
then { | ||
assert process.success | ||
assert snapshot(process.out).match() | ||
} | ||
|
||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
{ | ||
"Should merge BAM files using sambamba": { | ||
"content": [ | ||
{ | ||
"0": [ | ||
[ | ||
"sample2", | ||
"test2:test3", | ||
"sample2_m4_n10_toGenome.bam:md5,724ebe0d965d40decaa80c6b09e47ba5", | ||
"bam", | ||
"GenomeAlignments", | ||
true | ||
] | ||
] | ||
} | ||
], | ||
"meta": { | ||
"nf-test": "0.8.4", | ||
"nextflow": "23.10.1" | ||
}, | ||
"timestamp": "2024-05-02T11:08:00.400122" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
nextflow_process { | ||
|
||
name "Test Process mergeBam" | ||
script "modules/mergeBam/samtools/main.nf" | ||
process "mergeBam" | ||
|
||
tag "module" | ||
|
||
test("Should merge BAM files using samtools") { | ||
|
||
when { | ||
params { | ||
maxMismatches = 4 | ||
maxMultimaps = 10 | ||
} | ||
process { | ||
""" | ||
input[0] = Channel.from([ | ||
[ "sample2", [ "test2", "test3" ], file("${baseDir}/data/test*/*toGenome_sorted.bam"), "bam", "GenomeAlignments", true] | ||
]) | ||
""" | ||
} | ||
} | ||
|
||
then { | ||
assert process.success | ||
assert snapshot(process.out).match() | ||
} | ||
|
||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
{ | ||
"Should merge BAM files using samtools": { | ||
"content": [ | ||
{ | ||
"0": [ | ||
[ | ||
"sample2", | ||
"test2:test3", | ||
"sample2_m4_n10_toGenome.bam:md5,1aafe9aacc6e403ed8a5466a30549c85", | ||
"bam", | ||
"GenomeAlignments", | ||
true | ||
] | ||
] | ||
} | ||
], | ||
"meta": { | ||
"nf-test": "0.8.4", | ||
"nextflow": "23.10.1" | ||
}, | ||
"timestamp": "2024-05-02T11:27:59.686395" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,123 @@ | ||
nextflow_workflow { | ||
|
||
name "Test Workflow merging" | ||
script "workflows/merging.nf" | ||
workflow "merging" | ||
|
||
tag "workflow" | ||
|
||
test("Should merge genome BAM files using sambamba") { | ||
|
||
when { | ||
params { | ||
maxMismatches = 4 | ||
maxMultimaps = 10 | ||
mergeBamTool = "sambamba" | ||
markdupTool = "sambamba" | ||
} | ||
workflow { | ||
""" | ||
input[0] = Channel.from([ | ||
[ "sample2", "test2", file("${baseDir}/data/test2/sample2_m4_n10_toGenome_sorted.bam"), "bam", "GenomeAlignments", true], | ||
[ "sample2", "test3", file("${baseDir}/data/test3/sample2_m4_n10_toGenome_sorted.bam"), "bam", "GenomeAlignments", true] | ||
]) | ||
input[1] = Channel.empty() | ||
""" | ||
} | ||
} | ||
|
||
then { | ||
assert workflow.success | ||
assert snapshot(workflow.out).match() | ||
} | ||
|
||
} | ||
|
||
test("Should merge genome BAM files using samtools") { | ||
|
||
when { | ||
params { | ||
maxMismatches = 4 | ||
maxMultimaps = 10 | ||
mergeBamTool = "samtools" | ||
markdupTool = "sambamba" | ||
} | ||
workflow { | ||
""" | ||
input[0] = Channel.from([ | ||
[ "sample2", "test2", file("${baseDir}/data/test2/sample2_m4_n10_toGenome_sorted.bam"), "bam", "GenomeAlignments", true], | ||
[ "sample2", "test3", file("${baseDir}/data/test3/sample2_m4_n10_toGenome_sorted.bam"), "bam", "GenomeAlignments", true] | ||
]) | ||
input[1] = Channel.empty() | ||
""" | ||
} | ||
} | ||
|
||
then { | ||
assert workflow.success | ||
assert snapshot(workflow.out).match() | ||
} | ||
|
||
} | ||
|
||
test("Should merge all BAM files using samtools") { | ||
|
||
when { | ||
params { | ||
maxMismatches = 4 | ||
maxMultimaps = 10 | ||
mergeBamTool = "samtools" | ||
markdupTool = "sambamba" | ||
} | ||
workflow { | ||
""" | ||
input[0] = Channel.from([ | ||
[ "sample2", "test2", file("${baseDir}/data/test2/sample2_m4_n10_toGenome_sorted.bam"), "bam", "GenomeAlignments", true], | ||
[ "sample2", "test3", file("${baseDir}/data/test3/sample2_m4_n10_toGenome_sorted.bam"), "bam", "GenomeAlignments", true] | ||
]) | ||
input[1] = Channel.from([ | ||
[ "sample2", "test2", file("${baseDir}/data/test2/sample2_m4_n10_toTranscriptome_sorted.bam"), "bam", "TranscriptomeAlignments", true], | ||
[ "sample2", "test3", file("${baseDir}/data/test3/sample2_m4_n10_toTranscriptome_sorted.bam"), "bam", "TranscriptomeAlignments", true] | ||
]) | ||
""" | ||
} | ||
} | ||
|
||
then { | ||
assert workflow.success | ||
assert snapshot(workflow.out).match() | ||
} | ||
|
||
} | ||
|
||
test("Should merge all BAM files using sambamba") { | ||
|
||
when { | ||
params { | ||
maxMismatches = 4 | ||
maxMultimaps = 10 | ||
mergeBamTool = "sambamba" | ||
markdupTool = "sambamba" | ||
} | ||
workflow { | ||
""" | ||
input[0] = Channel.from([ | ||
[ "sample2", "test2", file("${baseDir}/data/test2/sample2_m4_n10_toGenome_sorted.bam"), "bam", "GenomeAlignments", true], | ||
[ "sample2", "test3", file("${baseDir}/data/test3/sample2_m4_n10_toGenome_sorted.bam"), "bam", "GenomeAlignments", true] | ||
]) | ||
input[1] = Channel.from([ | ||
[ "sample2", "test2", file("${baseDir}/data/test2/sample2_m4_n10_toTranscriptome_sorted.bam"), "bam", "TranscriptomeAlignments", true], | ||
[ "sample2", "test3", file("${baseDir}/data/test3/sample2_m4_n10_toTranscriptome_sorted.bam"), "bam", "TranscriptomeAlignments", true] | ||
]) | ||
""" | ||
} | ||
} | ||
|
||
then { | ||
assert workflow.success | ||
assert snapshot(workflow.out).match() | ||
} | ||
|
||
} | ||
|
||
} |
Oops, something went wrong.