Skip to content

Commit

Permalink
update tests
Browse files Browse the repository at this point in the history
  • Loading branch information
fellen31 committed Oct 17, 2024
1 parent 16df32b commit a689e0f
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 11 deletions.
5 changes: 3 additions & 2 deletions modules/nf-core/svdb/merge/main.nf
Original file line number Diff line number Diff line change
Expand Up @@ -29,17 +29,18 @@ process SVDB_MERGE {

if (sort_inputs && vcfs.collect().size() > 1) {
if (priority) {
// If there are more than one input, make vcf-prioprity pairs
// pair them and sort on VCF name, so priority is also sorted the same
// make vcf-prioprity pairs and sort on VCF name, so priority is also sorted the same
def pairs = vcfs.indices.collect { [vcfs[it], priority[it]] }
pairs = pairs.sort { a, b -> a[0].name <=> b[0].name }
vcfs = pairs.collect { it[0] }
priority = pairs.collect { it[1] }
} else {
// if there's no priority input just sort the vcfs by name
vcfs = vcfs.sort { it.name }
}
}

// If there's only one input VCF the code above is not executed, and that VCF becomes the input
input = vcfs

def prio = ""
Expand Down
10 changes: 1 addition & 9 deletions modules/nf-core/svdb/merge/tests/main.nf.test
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,6 @@ nextflow_process {
assertAll (
{ assert process.success },
{ assert path(process.out.vcf.get(0).get(1)).linesGzip[2].contains("--vcf test.vcf") }, // SVDB command line
{ assert path(process.out.vcf.get(0).get(1)).linesGzip[51].contains("test") }, // #CHROM line
{ assert snapshot(
path(process.out.vcf.get(0).get(1)).vcf.summary,
path(process.out.vcf.get(0).get(1)).vcf.variantsMD5,
Expand Down Expand Up @@ -61,7 +60,6 @@ nextflow_process {
assertAll (
{ assert process.success },
{ assert path(process.out.vcf.get(0).get(1)).linesGzip[2].contains("--vcf test.vcf") }, // SVDB command line
{ assert path(process.out.vcf.get(0).get(1)).linesGzip[51].contains("test") }, // #CHROM line
{ assert snapshot(
path(process.out.vcf.get(0).get(1)).vcf.summary,
path(process.out.vcf.get(0).get(1)).vcf.variantsMD5,
Expand Down Expand Up @@ -92,7 +90,6 @@ nextflow_process {
assertAll (
{ assert process.success },
{ assert path(process.out.vcf.get(0).get(1)).linesGzip[2].contains("--vcf test.vcf:tiddit") }, // SVDB command line
{ assert path(process.out.vcf.get(0).get(1)).linesGzip[51].contains("test") }, // #CHROM line
{ assert snapshot(
path(process.out.vcf.get(0).get(1)).vcf.summary,
path(process.out.vcf.get(0).get(1)).vcf.variantsMD5,
Expand Down Expand Up @@ -123,7 +120,6 @@ nextflow_process {
assertAll (
{ assert process.success },
{ assert path(process.out.vcf.get(0).get(1)).linesGzip[2].contains("--vcf test.vcf:tiddit") }, // SVDB command line
{ assert path(process.out.vcf.get(0).get(1)).linesGzip[51].contains("test") }, // #CHROM line
{ assert snapshot(
path(process.out.vcf.get(0).get(1)).vcf.summary,
path(process.out.vcf.get(0).get(1)).vcf.variantsMD5,
Expand Down Expand Up @@ -155,7 +151,6 @@ nextflow_process {
assertAll (
{ assert process.success },
{ assert path(process.out.vcf.get(0).get(1)).linesGzip[2].contains("--vcf test2.vcf test.vcf") }, // SVDB command line
{ assert path(process.out.vcf.get(0).get(1)).linesGzip[51].contains("test2\ttest") }, // #CHROM line
{ assert snapshot(
path(process.out.vcf.get(0).get(1)).vcf.summary,
path(process.out.vcf.get(0).get(1)).vcf.variantsMD5,
Expand Down Expand Up @@ -187,7 +182,6 @@ nextflow_process {
assertAll (
{ assert process.success },
{ assert path(process.out.vcf.get(0).get(1)).linesGzip[2].contains("--vcf test.vcf test2.vcf") }, // SVDB command line
{ assert path(process.out.vcf.get(0).get(1)).linesGzip[51].contains("test\ttest2") }, // #CHROM line
{ assert snapshot(
path(process.out.vcf.get(0).get(1)).vcf.summary,
path(process.out.vcf.get(0).get(1)).vcf.variantsMD5,
Expand Down Expand Up @@ -219,7 +213,6 @@ nextflow_process {
assertAll (
{ assert process.success },
{ assert path(process.out.vcf.get(0).get(1)).linesGzip[2].contains("--vcf test2.vcf:tiddit test.vcf:cnvnator") }, // SVDB command line
{ assert path(process.out.vcf.get(0).get(1)).linesGzip[51].contains("test2\ttest") }, // #CHROM line
{ assert snapshot(
path(process.out.vcf.get(0).get(1)).vcf.summary,
path(process.out.vcf.get(0).get(1)).vcf.variantsMD5,
Expand All @@ -230,7 +223,7 @@ nextflow_process {
}

test("2 samples, ['tiddit', 'cnvnator'], true") {

when {
process {
"""
Expand All @@ -251,7 +244,6 @@ nextflow_process {
assertAll (
{ assert process.success },
{ assert path(process.out.vcf.get(0).get(1)).linesGzip[2].contains("--vcf test.vcf:cnvnator test2.vcf:tiddit") }, // SVDB command line
{ assert path(process.out.vcf.get(0).get(1)).linesGzip[51].contains("test\ttest2") }, // #CHROM line
{ assert snapshot(
path(process.out.vcf.get(0).get(1)).vcf.summary,
path(process.out.vcf.get(0).get(1)).vcf.variantsMD5,
Expand Down

0 comments on commit a689e0f

Please sign in to comment.