Skip to content

Commit

Permalink
use a check for the -fisher arg instead
Browse files Browse the repository at this point in the history
  • Loading branch information
nvnieuwk committed Oct 7, 2024
1 parent 398e2b1 commit f9bfe71
Show file tree
Hide file tree
Showing 5 changed files with 28 additions and 34 deletions.
8 changes: 4 additions & 4 deletions modules/nf-core/vardictjava/main.nf
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,6 @@ process VARDICTJAVA {
tuple val(meta), path(bams), path(bais), path(bed)
tuple val(meta2), path(fasta)
tuple val(meta3), path(fasta_fai)
val(run_test) // Run either teststrandbias.R or testsomatic.R.
// If this options is false the --fisher option will be added automatically
// https://github.com/AstraZeneca-NGS/VarDictJava/issues/300#issuecomment-638085125

output:
tuple val(meta), path("*.vcf.gz"), emit: vcf
Expand All @@ -23,11 +20,14 @@ process VARDICTJAVA {
task.ext.when == null || task.ext.when

script:
def args = (task.ext.args ?: '-c 1 -S 2 -E 3') + run_test ? " --fisher" : ""
def args = task.ext.args ?: '-c 1 -S 2 -E 3'
def args2 = task.ext.args2 ?: ''
def args3 = task.ext.args3 ?: ''
def prefix = task.ext.prefix ?: "${meta.id}"

// Don't run test scripts when -fisher has been used by vardictjava
def run_test = !args.contains("-fisher")

def somatic = bams instanceof List && bams.size() == 2 ? true : false
def input = somatic ? "-b \"${bams[0]}|${bams[1]}\"" : "-b ${bams}"
def test = run_test ? somatic ? "| testsomatic.R" : "| teststrandbias.R" : ""
Expand Down
6 changes: 0 additions & 6 deletions modules/nf-core/vardictjava/meta.yml
Original file line number Diff line number Diff line change
Expand Up @@ -52,12 +52,6 @@ input:
type: file
description: The index of the FASTA of the reference genome
pattern: "*.fai"
- - run_test:
type: boolean
description: |
Run tests using teststrandbias.R or testsomatic.R
When false, the --fisher option will be automatically added to the arguments
https://github.com/AstraZeneca-NGS/VarDictJava/issues/300#issuecomment-638085125
output:
- vcf:
- meta:
Expand Down
13 changes: 5 additions & 8 deletions modules/nf-core/vardictjava/tests/main.nf.test
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ nextflow_process {
tag "modules_nfcore"
tag "vardictjava"

test("homo_sapiens - [bam, bai, bed] - fasta - fai - true") {
test("homo_sapiens - [bam, bai, bed] - fasta - fai") {

when {
process {
Expand All @@ -26,7 +26,6 @@ nextflow_process {
[id:"ref"],
file(params.modules_testdata_base_path + 'genomics/homo_sapiens/genome/genome.fasta.fai', checkIfExists: true)
]
input[3] = true
"""
}
}
Expand All @@ -42,7 +41,7 @@ nextflow_process {

}

test("homo_sapiens - [[bam, bam], [bai, bai], bed] - fasta - fai - true") {
test("homo_sapiens - [[bam, bam], [bai, bai], bed] - fasta - fai") {

when {
process {
Expand All @@ -67,7 +66,6 @@ nextflow_process {
[id:"ref"],
file(params.modules_testdata_base_path + 'genomics/homo_sapiens/genome/genome.fasta.fai', checkIfExists: true)
]
input[3] = true
"""
}
}
Expand All @@ -83,8 +81,9 @@ nextflow_process {

}

test("homo_sapiens - [bam, bai, bed] - fasta - fai - false") {
test("homo_sapiens - [bam, bai, bed] - fasta - fai - fisher") {

config "./nextflow.config"
when {
process {
"""
Expand All @@ -102,7 +101,6 @@ nextflow_process {
[id:"ref"],
file(params.modules_testdata_base_path + 'genomics/homo_sapiens/genome/genome.fasta.fai', checkIfExists: true)
]
input[3] = false
"""
}
}
Expand All @@ -118,7 +116,7 @@ nextflow_process {

}

test("homo_sapiens - [bam, bai, bed] - fasta - fai - true - stub") {
test("homo_sapiens - [bam, bai, bed] - fasta - fai - stub") {

options "-stub"

Expand All @@ -139,7 +137,6 @@ nextflow_process {
[id:"ref"],
file(params.modules_testdata_base_path + 'genomics/homo_sapiens/genome/genome.fasta.fai', checkIfExists: true)
]
input[3] = true
"""
}
}
Expand Down
32 changes: 16 additions & 16 deletions modules/nf-core/vardictjava/tests/main.nf.test.snap
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
{
"homo_sapiens - [[bam, bam], [bai, bai], bed] - fasta - fai - true": {
"homo_sapiens - [bam, bai, bed] - fasta - fai": {
"content": [
{
"0": [
[
{
"id": "test"
},
"test.vcf.gz:md5,7e4ab2c6d49b61c53b04e6c65c8f84ab"
"test.vcf.gz:md5,e8411ecae49b4f6afa6ea0b681ea506e"
]
],
"1": [
Expand All @@ -18,7 +18,7 @@
{
"id": "test"
},
"test.vcf.gz:md5,7e4ab2c6d49b61c53b04e6c65c8f84ab"
"test.vcf.gz:md5,e8411ecae49b4f6afa6ea0b681ea506e"
]
],
"versions": [
Expand All @@ -30,17 +30,17 @@
"nf-test": "0.9.0",
"nextflow": "24.04.4"
},
"timestamp": "2024-10-07T15:43:10.951200568"
"timestamp": "2024-10-07T16:05:15.117453312"
},
"homo_sapiens - [bam, bai, bed] - fasta - fai - true - stub": {
"homo_sapiens - [[bam, bam], [bai, bai], bed] - fasta - fai": {
"content": [
{
"0": [
[
{
"id": "test"
},
"test.vcf.gz:md5,68b329da9893e34099c7d8ad5cb9c940"
"test.vcf.gz:md5,b52c874c18be636d876d1e0df4a449c3"
]
],
"1": [
Expand All @@ -51,7 +51,7 @@
{
"id": "test"
},
"test.vcf.gz:md5,68b329da9893e34099c7d8ad5cb9c940"
"test.vcf.gz:md5,b52c874c18be636d876d1e0df4a449c3"
]
],
"versions": [
Expand All @@ -63,17 +63,17 @@
"nf-test": "0.9.0",
"nextflow": "24.04.4"
},
"timestamp": "2024-10-07T15:43:26.712061015"
"timestamp": "2024-10-07T16:05:26.932438089"
},
"homo_sapiens - [bam, bai, bed] - fasta - fai - true": {
"homo_sapiens - [bam, bai, bed] - fasta - fai - fisher": {
"content": [
{
"0": [
[
{
"id": "test"
},
"test.vcf.gz:md5,8acdd8ca041f024aab55d102fb6b0c38"
"test.vcf.gz:md5,e8411ecae49b4f6afa6ea0b681ea506e"
]
],
"1": [
Expand All @@ -84,7 +84,7 @@
{
"id": "test"
},
"test.vcf.gz:md5,8acdd8ca041f024aab55d102fb6b0c38"
"test.vcf.gz:md5,e8411ecae49b4f6afa6ea0b681ea506e"
]
],
"versions": [
Expand All @@ -96,17 +96,17 @@
"nf-test": "0.9.0",
"nextflow": "24.04.4"
},
"timestamp": "2024-10-07T15:43:02.162517044"
"timestamp": "2024-10-07T16:05:38.456816851"
},
"homo_sapiens - [bam, bai, bed] - fasta - fai - false": {
"homo_sapiens - [bam, bai, bed] - fasta - fai - stub": {
"content": [
{
"0": [
[
{
"id": "test"
},
"test.vcf.gz:md5,8acdd8ca041f024aab55d102fb6b0c38"
"test.vcf.gz:md5,68b329da9893e34099c7d8ad5cb9c940"
]
],
"1": [
Expand All @@ -117,7 +117,7 @@
{
"id": "test"
},
"test.vcf.gz:md5,8acdd8ca041f024aab55d102fb6b0c38"
"test.vcf.gz:md5,68b329da9893e34099c7d8ad5cb9c940"
]
],
"versions": [
Expand All @@ -129,6 +129,6 @@
"nf-test": "0.9.0",
"nextflow": "24.04.4"
},
"timestamp": "2024-10-07T15:43:19.212653351"
"timestamp": "2024-10-07T16:05:48.440804849"
}
}
3 changes: 3 additions & 0 deletions modules/nf-core/vardictjava/tests/nextflow.config
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
process {
ext.args = "-c 1 -S 2 -E 3 -fisher"
}

0 comments on commit f9bfe71

Please sign in to comment.