Skip to content

Commit

Permalink
Updated tests
Browse files Browse the repository at this point in the history
  • Loading branch information
Schmytzi committed Oct 10, 2024
1 parent 8bb6f50 commit 05dcd39
Show file tree
Hide file tree
Showing 2 changed files with 526 additions and 141 deletions.
173 changes: 161 additions & 12 deletions subworkflows/local/call_svs/tests/main.nf.test
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ nextflow_workflow {
}
}

test("1 sample - [bam, bai], fasta, fai, [] - sniffles") {
test("1 sample - [bam, bai], fasta, fai, [], [] - sniffles") {

when {
workflow {
Expand All @@ -45,6 +45,7 @@ nextflow_workflow {
input[2] = SAMTOOLS_FAIDX.out.fai
input[3] = "sniffles"
input[4] = [[],[]]
input[5] = [[],[]]
"""
}
}
Expand All @@ -64,7 +65,7 @@ nextflow_workflow {

}

test("1 sample - [bam, bai], fasta, fai, bed - sniffles") {
test("1 sample - [bam, bai], fasta, fai, bed, [] - sniffles") {

when {
workflow {
Expand All @@ -81,6 +82,7 @@ nextflow_workflow {
[ id:'trf' ],
file('https://github.com/fritzsedlazeck/Sniffles/raw/master/annotations/human_GRCh38_no_alt_analysis_set.trf.bed', checkIfExists: true)
]
input[5] = [[],[]]
"""
}
}
Expand All @@ -100,7 +102,7 @@ nextflow_workflow {

}

test("2 samples - [bam, bai], fasta, fai, [] - sniffles") {
test("2 samples - [bam, bai], fasta, fai, [], [] - sniffles") {

when {
workflow {
Expand All @@ -121,6 +123,7 @@ nextflow_workflow {
input[2] = SAMTOOLS_FAIDX.out.fai
input[3] = "sniffles"
input[4] = [[],[]]
input[5] = [[],[]]
"""
}
}
Expand All @@ -141,7 +144,44 @@ nextflow_workflow {

}

test("1 sample - [bam, bai], fasta, fai, [] - severus") {
test("1 sample - [bam, bai], fasta, fai, [], bed - sniffles") {

when {
workflow {
"""
input[0] = Channel.of([
[ id:'test', single_end:false, project: 'project' ], // meta map
file(params.pipelines_testdata_base_path + 'testdata/HG002_PacBio_Revio.bam', checkIfExists: true),
file(params.pipelines_testdata_base_path + 'testdata/HG002_PacBio_Revio.bam.bai', checkIfExists: true)
])
input[1] = GUNZIP.out.gunzip
input[2] = SAMTOOLS_FAIDX.out.fai
input[3] = "sniffles"
input[4] = [[],[]]
input[5] = [
[id: 'test'],
file(params.modules_testdata_base_path + '/genomics/homo_sapiens/genome/genome.bed', checkIfExists: true)
]
"""
}
}

then {
assertAll(
{ assert workflow.success },
{ assert workflow.out.ch_sv_calls_tbi.get(0).get(1).endsWith("tbi") },
{ assert workflow.out.ch_multisample_tbi.get(0).get(1).endsWith("tbi") },
{ assert snapshot(
path(workflow.out.ch_sv_calls_vcf.get(0).get(1)).vcf.variantsMD5,
path(workflow.out.ch_multisample_vcf.get(0).get(1)).vcf.variantsMD5,
workflow.out.versions,
).match() }
)
}

}

test("1 sample - [bam, bai], fasta, fai, [], [] - severus") {

when {
workflow {
Expand All @@ -155,6 +195,7 @@ nextflow_workflow {
input[2] = SAMTOOLS_FAIDX.out.fai
input[3] = "severus"
input[4] = [[],[]]
input[5] = [[],[]]
"""
}
}
Expand All @@ -174,7 +215,7 @@ nextflow_workflow {

}

test("1 sample - [bam, bai], fasta, fai, bed - severus") {
test("1 sample - [bam, bai], fasta, fai, bed, [] - severus") {

when {
workflow {
Expand All @@ -191,6 +232,7 @@ nextflow_workflow {
[ id:'trf' ],
file('https://github.com/fritzsedlazeck/Sniffles/raw/master/annotations/human_GRCh38_no_alt_analysis_set.trf.bed', checkIfExists: true)
]
input[5] = [[],[]]
"""
}
}
Expand All @@ -210,7 +252,44 @@ nextflow_workflow {

}

test("2 samples - [bam, bai], fasta, fai, [] - severus") {
test("1 sample - [bam, bai], fasta, fai, [], bed - severus") {

when {
workflow {
"""
input[0] = Channel.of([
[ id:'test', single_end:false, project: 'project' ], // meta map
file(params.pipelines_testdata_base_path + 'testdata/HG002_PacBio_Revio.bam', checkIfExists: true),
file(params.pipelines_testdata_base_path + 'testdata/HG002_PacBio_Revio.bam.bai', checkIfExists: true)
])
input[1] = GUNZIP.out.gunzip
input[2] = SAMTOOLS_FAIDX.out.fai
input[3] = "severus"
input[4] = [[],[]]
input[5] = [
[id: 'test'],
file(params.modules_testdata_base_path + '/genomics/homo_sapiens/genome/genome.bed', checkIfExists: true)
]
"""
}
}

then {
assertAll(
{ assert workflow.success },
{ assert workflow.out.ch_sv_calls_tbi.get(0).get(1).endsWith("tbi") },
{ assert workflow.out.ch_multisample_tbi.get(0).get(1).endsWith("tbi") },
{ assert snapshot(
path(workflow.out.ch_sv_calls_vcf.get(0).get(1)).vcf.variantsMD5,
path(workflow.out.ch_multisample_vcf.get(0).get(1)).vcf.variantsMD5,
workflow.out.versions,
).match() }
)
}

}

test("2 samples - [bam, bai], fasta, fai, [], [] - severus") {

when {
workflow {
Expand All @@ -231,6 +310,7 @@ nextflow_workflow {
input[2] = SAMTOOLS_FAIDX.out.fai
input[3] = "severus"
input[4] = [[],[]]
input[5] = [[],[]]
"""
}
}
Expand All @@ -251,7 +331,7 @@ nextflow_workflow {

}

test("1 sample - [bam, bai], fasta, fai, [] - sniffles -stub") {
test("1 sample - [bam, bai], fasta, fai, [], [] - sniffles -stub") {

options "-stub"

Expand All @@ -267,6 +347,7 @@ nextflow_workflow {
input[2] = SAMTOOLS_FAIDX.out.fai
input[3] = "sniffles"
input[4] = [[],[]]
input[5] = [[],[]]
"""
}
}
Expand All @@ -280,7 +361,7 @@ nextflow_workflow {

}

test("1 sample - [bam, bai], fasta, fai, bed - sniffles -stub") {
test("1 sample - [bam, bai], fasta, fai, bed, [] - sniffles -stub") {

options "-stub"

Expand All @@ -299,6 +380,7 @@ nextflow_workflow {
[ id:'trf' ],
file('https://github.com/fritzsedlazeck/Sniffles/raw/master/annotations/human_GRCh38_no_alt_analysis_set.trf.bed', checkIfExists: true)
]
input[5] = [[],[]]
"""
}
}
Expand All @@ -312,7 +394,40 @@ nextflow_workflow {

}

test("2 samples - [bam, bai], fasta, fai, [] - sniffles -stub") {
test("1 sample - [bam, bai], fasta, fai, [], bed - sniffles -stub") {

options "-stub"

when {
workflow {
"""
input[0] = Channel.of([
[ id:'test', single_end:false, project: 'project' ], // meta map
file(params.pipelines_testdata_base_path + 'testdata/HG002_PacBio_Revio.bam', checkIfExists: true),
file(params.pipelines_testdata_base_path + 'testdata/HG002_PacBio_Revio.bam.bai', checkIfExists: true)
])
input[1] = GUNZIP.out.gunzip
input[2] = SAMTOOLS_FAIDX.out.fai
input[3] = "sniffles"
input[4] = [[],[]]
input[5] = [
[id: 'test'],
file(params.modules_testdata_base_path + '/genomics/homo_sapiens/genome/genome.bed', checkIfExists: true)
]
"""
}
}

then {
assertAll(
{ assert workflow.success },
{ assert snapshot(workflow.out).match() }
)
}

}

test("2 samples - [bam, bai], fasta, fai, [], [] - sniffles -stub") {

options "-stub"

Expand All @@ -335,6 +450,7 @@ nextflow_workflow {
input[2] = SAMTOOLS_FAIDX.out.fai
input[3] = "sniffles"
input[4] = [[],[]]
input[5] = [[],[]]
"""
}
}
Expand All @@ -354,7 +470,37 @@ nextflow_workflow {

}

test("1 sample - [bam, bai], fasta, fai, [] - severus -stub") {
test("1 sample - [bam, bai], fasta, fai, [], [] - severus -stub") {

options "-stub"

when {
workflow {
"""
input[0] = Channel.of([
[ id:'test', single_end:false, project: 'project' ], // meta map
file(params.pipelines_testdata_base_path + 'testdata/HG002_PacBio_Revio.bam', checkIfExists: true),
file(params.pipelines_testdata_base_path + 'testdata/HG002_PacBio_Revio.bam.bai', checkIfExists: true)
])
input[1] = GUNZIP.out.gunzip
input[2] = SAMTOOLS_FAIDX.out.fai
input[3] = "severus"
input[4] = [[],[]]
input[5] = [[],[]]
"""
}
}

then {
assertAll(
{ assert workflow.success },
{ assert snapshot(workflow.out).match() }
)
}

}

test("1 sample - [bam, bai], fasta, fai, [], bed - severus -stub") {

options "-stub"

Expand All @@ -370,6 +516,7 @@ nextflow_workflow {
input[2] = SAMTOOLS_FAIDX.out.fai
input[3] = "severus"
input[4] = [[],[]]
input[5] = [[],[]]
"""
}
}
Expand All @@ -383,7 +530,7 @@ nextflow_workflow {

}

test("1 sample - [bam, bai], fasta, fai, bed - severus -stub") {
test("1 sample - [bam, bai], fasta, fai, bed, [] - severus -stub") {

options "-stub"

Expand All @@ -402,6 +549,7 @@ nextflow_workflow {
[ id:'trf' ],
file('https://github.com/fritzsedlazeck/Sniffles/raw/master/annotations/human_GRCh38_no_alt_analysis_set.trf.bed', checkIfExists: true)
]
input[5] = [[],[]]
"""
}
}
Expand All @@ -415,7 +563,7 @@ nextflow_workflow {

}

test("2 samples - [bam, bai], fasta, fai, [] - severus -stub") {
test("2 samples - [bam, bai], fasta, fai, [], [] - severus -stub") {

options "-stub"

Expand All @@ -438,6 +586,7 @@ nextflow_workflow {
input[2] = SAMTOOLS_FAIDX.out.fai
input[3] = "severus"
input[4] = [[],[]]
input[5] = [[],[]]
"""
}
}
Expand Down
Loading

0 comments on commit 05dcd39

Please sign in to comment.