Skip to content

Commit

Permalink
4451 add vcf2maf nf test (nf-core#4463)
Browse files Browse the repository at this point in the history
* add nf-test case for vcf2maf without VEP

* add VEP test case for vcf2maf nf-test

* update linting for vcf2maf

* fix prettier for vcf2maf

* remove pytest files for vcf2maf

* remove vcf2maf from pytest modules yml

* add modules/nf-core/vcf2maf/tests/tags.yml

* add line count to vcf2maf test

* add line number and versions contents yaml to vcf2maf test

* remove alternate container from vcf2maf testing and use the same container for testing with or without VEP

* update modules/nf-core/vcf2maf/tests/main.nf.test

* update modules/nf-core/vcf2maf/tests/main.nf.test

* Update and fix tests

* Apply suggestions from code review

Co-authored-by: Simon Pearce <24893913+SPPearce@users.noreply.github.com>

* Add conda declaration to nf-test

* Remove output in snapshot

* Add versions to snapshot

---------

Co-authored-by: Simon Pearce <24893913+SPPearce@users.noreply.github.com>
Co-authored-by: Adam Talbot <12817534+adamrtalbot@users.noreply.github.com>
  • Loading branch information
3 people authored Sep 12, 2024
1 parent a004c86 commit aa8c39b
Show file tree
Hide file tree
Showing 11 changed files with 247 additions and 63 deletions.
2 changes: 1 addition & 1 deletion modules/nf-core/vcf2maf/environment.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,5 @@ channels:
- conda-forge
- bioconda
dependencies:
- bioconda::vcf2maf=1.6.21
- bioconda::ensembl-vep=106.1
- bioconda::vcf2maf=1.6.21
76 changes: 76 additions & 0 deletions modules/nf-core/vcf2maf/tests/main.nf.test
Original file line number Diff line number Diff line change
@@ -0,0 +1,76 @@
nextflow_process {
name "Test vcf2maf"
process "VCF2MAF"
script "../main.nf"

tag "modules"
tag "modules_nfcore"
tag "vcf2maf"
tag "untar"

test("Run without VEP") {
config "./nextflow.config"
when {
process {
"""
input[0] = [
[ id:'test'], // meta map
file(params.modules_testdata_base_path + "genomics/homo_sapiens/illumina/gvcf/test.genome.vcf", checkIfExists: true)
]
input[1] = [ file(params.modules_testdata_base_path + "genomics/homo_sapiens/genome/genome.fasta", checkIfExists: true) ]
input[2] = []
"""
}
}
then {
assertAll(
{ assert process.success },
{ assert snapshot(
path(process.out.maf[0][1]).readLines()[5..131],
process.out.versions
).match() },
{ assert path(process.out.versions[0]).readLines() == ['"VCF2MAF":', ' vcf2maf: 1.6.21', ' ensemblvep: 106.1'] }
)
}
}

test("Run with VEP"){
tag "vcf2maf-withVEP"
config "./nextflow.withVEP.config"

setup {
run("UNTAR") {
script "../../../../modules/nf-core/untar/main.nf"
process {
"""
input[0] = [
[ id:'test_genome_vep' ],
file(params.modules_testdata_base_path + "genomics/homo_sapiens/genome/vep.tar.gz", checkIfExists: true)
]
"""
}
}
}

when {
process {
"""
input[0] = [
[ id:'test'], // meta map
file(params.modules_testdata_base_path + "genomics/homo_sapiens/illumina/gvcf/test.genome.vcf", checkIfExists: true)
]
input[1] = [ file(params.modules_testdata_base_path + "genomics/homo_sapiens/genome/genome.fasta", checkIfExists: true) ]
input[2] = UNTAR.out.untar.map { it[1] }
"""
}
}

then{
assertAll(
{ assert process.success },
{ assert path(process.out.maf[0][1]).readLines().size() == 2 }, // no variants, only header lines
{ assert path(process.out.versions[0]).readLines() == ['"VCF2MAF":', ' vcf2maf: 1.6.21', ' ensemblvep: 106.1'] }
)
}
}
}
143 changes: 143 additions & 0 deletions modules/nf-core/vcf2maf/tests/main.nf.test.snap

Large diffs are not rendered by default.

11 changes: 11 additions & 0 deletions modules/nf-core/vcf2maf/tests/nextflow.config
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
// config for running without VEP
params.species = "homo_sapiens"
params.build = "GRCh38"

process {
container = "biocontainers/vcf2maf:1.6.21--hdfd78af_0"
conda = "bioconda::vcf2maf=1.6.21"
withName: 'VCF2MAF' {
ext.args = "--ncbi-build ${params.build} --species ${params.species} --inhibit-vep"
}
}
9 changes: 9 additions & 0 deletions modules/nf-core/vcf2maf/tests/nextflow.withVEP.config
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
// config for running with VEP
params.species = "homo_sapiens"
params.build = "GRCh38"

process {
withName: 'VCF2MAF' {
ext.args = "--ncbi-build ${params.build} --species ${params.species}"
}
}
2 changes: 2 additions & 0 deletions modules/nf-core/vcf2maf/tests/tags.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
vcf2maf:
- modules/nf-core/vcf2maf/**
2 changes: 2 additions & 0 deletions tests/config/nextflow.config
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,11 @@ if ("$PROFILE" == "singularity") {
singularity.autoMounts = true
} else if ("$PROFILE" == "conda") {
conda.enabled = true
conda.useMicromamba = true
} else if ("$PROFILE" == "mamba") {
conda.enabled = true
conda.useMamba = true
conda.useMicromamba = true
} else if ("$PROFILE" == "podman") {
podman.enabled = true
podman.userEmulation = true
Expand Down
6 changes: 3 additions & 3 deletions tests/config/pytest_modules.yml
Original file line number Diff line number Diff line change
Expand Up @@ -813,9 +813,9 @@ varlociraptor/callvariants:
varlociraptor/preprocess:
- modules/nf-core/varlociraptor/preprocess/**
- tests/modules/nf-core/varlociraptor/preprocess/**
vcf2maf:
- modules/nf-core/vcf2maf/**
- tests/modules/nf-core/vcf2maf/**
vcflib/vcfbreakmulti:
- modules/nf-core/vcflib/vcfbreakmulti/**
- tests/modules/nf-core/vcflib/vcfbreakmulti/**
verifybamid/verifybamid2:
- modules/nf-core/verifybamid/verifybamid2/**
- tests/modules/nf-core/verifybamid/verifybamid2/**
Expand Down
30 changes: 0 additions & 30 deletions tests/modules/nf-core/vcf2maf/main.nf

This file was deleted.

14 changes: 0 additions & 14 deletions tests/modules/nf-core/vcf2maf/nextflow.config

This file was deleted.

15 changes: 0 additions & 15 deletions tests/modules/nf-core/vcf2maf/test.yml

This file was deleted.

0 comments on commit aa8c39b

Please sign in to comment.