Skip to content

Commit

Permalink
Add regions bed and nf-test to glnexus (#6888)
Browse files Browse the repository at this point in the history
Add regions and nf-test to glnexus

Co-authored-by: Sateesh_Peri <[email protected]>
  • Loading branch information
fellen31 and sateeshperi authored Oct 31, 2024
1 parent adf071f commit bcf36bc
Show file tree
Hide file tree
Showing 8 changed files with 211 additions and 33 deletions.
5 changes: 4 additions & 1 deletion modules/nf-core/glnexus/main.nf
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
process GLNEXUS {
tag "$meta.id"
label 'process_medium'
label 'process_high'

conda "${moduleDir}/environment.yml"
container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ?
Expand All @@ -9,6 +9,7 @@ process GLNEXUS {

input:
tuple val(meta), path(gvcfs)
tuple val(meta2), path(bed)

output:
tuple val(meta), path("*.bcf"), emit: bcf
Expand All @@ -20,6 +21,7 @@ process GLNEXUS {
script:
def args = task.ext.args ?: ''
def prefix = task.ext.prefix ?: "${meta.id}"
def regions = bed ? "--bed ${bed}" : ""

// Make list of GVCFs to merge
def input = gvcfs.collect { it.toString() }
Expand All @@ -33,6 +35,7 @@ process GLNEXUS {
glnexus_cli \\
--threads $task.cpus \\
--mem-gbytes $avail_mem \\
$regions \\
$args \\
${input.join(' ')} \\
> ${prefix}.bcf
Expand Down
9 changes: 9 additions & 0 deletions modules/nf-core/glnexus/meta.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,15 @@ input:
type: list
description: Input genomic vcf files
pattern: "*.{gvcf,gvcf.gz,g.vcf,g.vcf.gz}"
- - meta2:
type: map
description: |
Groovy Map containing regions information
e.g. [ id:'test' ]
- bed:
type: list
description: Input BED file
pattern: "*.bed"
output:
- bcf:
- meta:
Expand Down
97 changes: 97 additions & 0 deletions modules/nf-core/glnexus/tests/main.nf.test
Original file line number Diff line number Diff line change
@@ -0,0 +1,97 @@
nextflow_process {

name "Test Process GLNEXUS"
script "../main.nf"
process "GLNEXUS"

tag "modules"
tag "modules_nfcore"
tag "glnexus"

test("vcfs, []") {

when {
process {
"""
input[0] = Channel.of([
[ id:'test' ],
[
file(params.modules_testdata_base_path + 'genomics/homo_sapiens/illumina/gvcf/test.genome.vcf.gz', checkIfExists: true),
file(params.modules_testdata_base_path + 'genomics/homo_sapiens/illumina/gvcf/test2.genome.vcf.gz', checkIfExists: true),
]
])
input[1] = [[],[]]
"""
}
}

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

}

test("vcfs, bed") {

when {
process {
"""
input[0] = Channel.of([
[ id:'test' ],
[
file(params.modules_testdata_base_path + 'genomics/homo_sapiens/illumina/gvcf/test.genome.vcf.gz', checkIfExists: true),
file(params.modules_testdata_base_path + 'genomics/homo_sapiens/illumina/gvcf/test2.genome.vcf.gz', checkIfExists: true),
]
])
input[1] = [
[ id:'region' ],
file(params.modules_testdata_base_path + 'genomics/homo_sapiens/genome/genome.bed', checkIfExists: true),
]
"""
}
}

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

}

test("vcfs, bed - stub") {

options "-stub"

when {
process {
"""
input[0] = Channel.of([
[ id:'test' ],
[
file(params.modules_testdata_base_path + 'genomics/homo_sapiens/illumina/gvcf/test.genome.vcf.gz', checkIfExists: true),
file(params.modules_testdata_base_path + 'genomics/homo_sapiens/illumina/gvcf/test2.genome.vcf.gz', checkIfExists: true),
]
])
input[1] = [
[ id:'region' ],
file(params.modules_testdata_base_path + 'genomics/homo_sapiens/genome/genome.bed', checkIfExists: true),
]
"""
}
}

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

}

}
101 changes: 101 additions & 0 deletions modules/nf-core/glnexus/tests/main.nf.test.snap
Original file line number Diff line number Diff line change
@@ -0,0 +1,101 @@
{
"vcfs, bed - stub": {
"content": [
{
"0": [
[
{
"id": "test"
},
"test.bcf:md5,d41d8cd98f00b204e9800998ecf8427e"
]
],
"1": [
"versions.yml:md5,dfeeb7f12f37cbef54a798614b83ffb0"
],
"bcf": [
[
{
"id": "test"
},
"test.bcf:md5,d41d8cd98f00b204e9800998ecf8427e"
]
],
"versions": [
"versions.yml:md5,dfeeb7f12f37cbef54a798614b83ffb0"
]
}
],
"meta": {
"nf-test": "0.9.0",
"nextflow": "24.04.4"
},
"timestamp": "2024-10-29T12:17:01.253378301"
},
"vcfs, bed": {
"content": [
{
"0": [
[
{
"id": "test"
},
"test.bcf:md5,62b2cea9c1b92ac63645cb031eea46fc"
]
],
"1": [
"versions.yml:md5,dfeeb7f12f37cbef54a798614b83ffb0"
],
"bcf": [
[
{
"id": "test"
},
"test.bcf:md5,62b2cea9c1b92ac63645cb031eea46fc"
]
],
"versions": [
"versions.yml:md5,dfeeb7f12f37cbef54a798614b83ffb0"
]
}
],
"meta": {
"nf-test": "0.9.0",
"nextflow": "24.04.4"
},
"timestamp": "2024-10-29T12:16:53.859544065"
},
"vcfs, []": {
"content": [
{
"0": [
[
{
"id": "test"
},
"test.bcf:md5,62b2cea9c1b92ac63645cb031eea46fc"
]
],
"1": [
"versions.yml:md5,dfeeb7f12f37cbef54a798614b83ffb0"
],
"bcf": [
[
{
"id": "test"
},
"test.bcf:md5,62b2cea9c1b92ac63645cb031eea46fc"
]
],
"versions": [
"versions.yml:md5,dfeeb7f12f37cbef54a798614b83ffb0"
]
}
],
"meta": {
"nf-test": "0.9.0",
"nextflow": "24.04.4"
},
"timestamp": "2024-10-29T12:13:03.068397129"
}
}
3 changes: 0 additions & 3 deletions tests/config/pytest_modules.yml
Original file line number Diff line number Diff line change
Expand Up @@ -263,9 +263,6 @@ gfastats:
gget/gget:
- modules/nf-core/gget/gget/**
- tests/modules/nf-core/gget/gget/**
glnexus:
- modules/nf-core/glnexus/**
- tests/modules/nf-core/glnexus/**
gprofiler2/gost:
- modules/nf-core/gprofiler2/gost/**
- tests/modules/nf-core/gprofiler2/gost/**
Expand Down
17 changes: 0 additions & 17 deletions tests/modules/nf-core/glnexus/main.nf

This file was deleted.

5 changes: 0 additions & 5 deletions tests/modules/nf-core/glnexus/nextflow.config

This file was deleted.

7 changes: 0 additions & 7 deletions tests/modules/nf-core/glnexus/test.yml

This file was deleted.

0 comments on commit bcf36bc

Please sign in to comment.