Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

port parabricks/deepvariant to nf-test #6995

Merged
merged 33 commits into from
Jan 20, 2025
Merged
Show file tree
Hide file tree
Changes from 12 commits
Commits
Show all changes
33 commits
Select commit Hold shift + click to select a range
d38760a
port to nf-test
famosab Nov 14, 2024
94d726f
remove
famosab Nov 14, 2024
3acb809
update test yaml
famosab Nov 18, 2024
f87d2d9
swap to nextflow config
famosab Nov 21, 2024
32e24fa
finalize
famosab Nov 21, 2024
3f7444d
revert changes to nf-test config
famosab Nov 22, 2024
220f99d
revert changes to nf-test config
famosab Nov 22, 2024
35eab5d
add to conda_skip
famosab Dec 2, 2024
45fc76f
Merge branch 'master' into deepv
famosab Dec 2, 2024
053c1d3
add tag gpu
famosab Dec 2, 2024
894bb4a
Merge branch 'master' into deepv
famosab Dec 9, 2024
3c4aa44
Merge branch 'master' into deepv
famosab Dec 10, 2024
13420bb
Update modules/nf-core/parabricks/deepvariant/tests/nextflow.config
famosab Dec 11, 2024
dc18210
Update modules/nf-core/parabricks/deepvariant/main.nf
famosab Dec 11, 2024
1d64fdf
Merge branch 'master' into deepv
famosab Dec 11, 2024
d13179d
fix tests and add myself as maintainer to other modules
famosab Dec 16, 2024
e1297f3
fix meta
famosab Dec 16, 2024
3fea3ae
Merge branch 'master' into deepv
famosab Dec 16, 2024
7f9128e
Merge branch 'master' into deepv
famosab Dec 16, 2024
8dbece3
Merge branch 'master' into deepv
famosab Dec 18, 2024
632de59
Merge branch 'master' into deepv
famosab Dec 20, 2024
19dc4f7
Merge branch 'master' into deepv
famosab Jan 7, 2025
6b8dbe6
Merge branch 'master' into deepv
SPPearce Jan 8, 2025
98b1c2f
add isssue to comment
famosab Jan 8, 2025
8b902e8
Merge branch 'master' into deepv
famosab Jan 9, 2025
3f7b31f
remove conda skip
famosab Jan 15, 2025
fde7d5d
Merge branch 'master' into deepv
famosab Jan 15, 2025
722385f
Merge branch 'master' into deepv
famosab Jan 15, 2025
897a895
update snap
famosab Jan 15, 2025
8465ecf
Merge branch 'deepv' of github.com:famosab/modules into deepv
famosab Jan 15, 2025
72edfa5
Merge branch 'master' into deepv
famosab Jan 15, 2025
7e09226
Merge branch 'master' into deepv
SPPearce Jan 15, 2025
4c67aaa
Merge branch 'master' into deepv
sateeshperi Jan 20, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .github/conda_skip.yml
Original file line number Diff line number Diff line change
Expand Up @@ -182,5 +182,7 @@ exclude:
path: modules/nf-core/xeniumranger/resegment
- profile: conda
path: modules/nf-core/xeniumranger/import-segmentation
- profile: conda
path: modules/nf-core/parabricks/deepvariant
- profile: conda
path: modules/nf-core/parabricks/genotypegvcf
13 changes: 5 additions & 8 deletions modules/nf-core/parabricks/deepvariant/main.nf
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ process PARABRICKS_DEEPVARIANT {
tag "$meta.id"
label 'process_high'

container "nvcr.io/nvidia/clara/clara-parabricks:4.3.0-1"
container "nvcr.io/nvidia/clara/clara-parabricks:4.4.0-1"

input:
tuple val(meta), path(input), path(input_index), path(interval_file)
Expand All @@ -16,25 +16,23 @@ process PARABRICKS_DEEPVARIANT {
task.ext.when == null || task.ext.when

script:

// Exit if running this module with -profile conda / -profile mamba
if (workflow.profile.tokenize(',').intersect(['conda', 'mamba']).size() >= 1) {
exit 1, "Parabricks module does not support Conda. Please use Docker / Singularity / Podman instead."
}

def args = task.ext.args ?: ''
def prefix = task.ext.prefix ?: "${meta.id}"
def output_file = args =~ "gvcf" ? "${prefix}.g.vcf" : "${prefix}.vcf"
def output_file = ("--gvcf" =~ task.ext.args)? "${prefix}.g.vcf" : "${prefix}.vcf"
def interval_file_command = interval_file ? interval_file.collect{"--interval-file $it"}.join(' ') : ""
def num_gpus = task.accelerator ? "--num-gpus $task.accelerator.request" : ''
"""

pbrun \\
deepvariant \\
--ref $fasta \\
--in-bam $input \\
--out-variants $output_file \\
$interval_file_command \\
--num-gpus $task.accelerator.request \\
$num_gpus \\
$args

cat <<-END_VERSIONS > versions.yml
Expand All @@ -44,9 +42,8 @@ process PARABRICKS_DEEPVARIANT {
"""

stub:
def args = task.ext.args ?: ''
def prefix = task.ext.prefix ?: "${meta.id}"
def output_file = args =~ "gvcf" ? "${prefix}.g.vcf" : "${prefix}.vcf"
def output_file = ("--gvcf" =~ task.ext.args)? "${prefix}.g.vcf" : "${prefix}.vcf"
"""
touch $output_file

Expand Down
178 changes: 178 additions & 0 deletions modules/nf-core/parabricks/deepvariant/tests/main.nf.test
Original file line number Diff line number Diff line change
@@ -0,0 +1,178 @@
nextflow_process {

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

tag "modules"
tag "modules_nfcore"
tag "parabricks"
tag "parabricks/deepvariant"
tag "gpu"

test("human - bam") {

when {
process {
"""
input[0] = [
[ id:'test'],
file(params.modules_testdata_base_path + 'genomics/homo_sapiens/illumina/bam/test2.paired_end.recalibrated.sorted.bam', checkIfExists: true),
[], // bam.bai not needed unless using intervals
[]
]
input[1] = [
[ id:'test'],
file(params.modules_testdata_base_path + 'genomics/homo_sapiens/genome/chr21/sequence/genome.fasta', checkIfExists: true)
]
"""
}
}

then {
assertAll(
{ assert process.success },
{ assert snapshot(
path(process.out.vcf[0][1]).vcf.variantsMD5,
process.out.versions
).match() }
)
}

}

test("human - bam - intervals") {

config './nextflow.config'

when {
process {
"""
input[0] = [
[ id:'test'],
file(params.modules_testdata_base_path + 'genomics/homo_sapiens/illumina/bam/test2.paired_end.recalibrated.sorted.bam', checkIfExists: true),
file(params.modules_testdata_base_path + 'genomics/homo_sapiens/illumina/bam/test2.paired_end.recalibrated.sorted.bam.bai', checkIfExists: true),
file(params.modules_testdata_base_path + 'genomics/homo_sapiens/genome/chr21/sequence/multi_intervals.bed', checkIfExists: true)
]
input[1] = [
[ id:'ref'],
file(params.modules_testdata_base_path + 'genomics/homo_sapiens/genome/chr21/sequence/genome.fasta', checkIfExists: true)
]
"""
}
}

then {
assertAll(
{ assert process.success },
{ assert snapshot(
path(process.out.vcf[0][1]).vcf.variantsMD5,
process.out.versions
).match() }
)
}

}

test("human - bam - intervals - gvcf") {

config './nextflow.config'

when {
params {
module_args = '--gvcf'
}
process {
"""
input[0] = [
[ id:'test'],
file(params.modules_testdata_base_path + 'genomics/homo_sapiens/illumina/bam/test2.paired_end.recalibrated.sorted.bam', checkIfExists: true),
file(params.modules_testdata_base_path + 'genomics/homo_sapiens/illumina/bam/test2.paired_end.recalibrated.sorted.bam.bai', checkIfExists: true),
file(params.modules_testdata_base_path + 'genomics/homo_sapiens/genome/chr21/sequence/multi_intervals.bed', checkIfExists: true)
]
input[1] = [
[ id:'ref'],
file(params.modules_testdata_base_path + 'genomics/homo_sapiens/genome/chr21/sequence/genome.fasta', checkIfExists: true)
]
"""
}
}

then {
assertAll(
{ assert process.success },
{ assert snapshot(
process.out.versions,
// file(process.out.vcf[0][1]).name // fails with groovy.lang.MissingMethodException: No signature of method: static com.askimed.nf.test.lang.extensions.GlobalMethods.file() is applicable for argument types: (ArrayList) values:
).match()
}
)
}

}

test("human - bam - stub") {

options "-stub"

when {
process {
"""
input[0] = [
[ id:'test'],
file(params.modules_testdata_base_path + 'genomics/homo_sapiens/illumina/bam/test2.paired_end.recalibrated.sorted.bam', checkIfExists: true),
[], // bam.bai not needed unless using intervals
[]
]
input[1] = [
[ id:'test'],
file(params.modules_testdata_base_path + 'genomics/homo_sapiens/genome/chr21/sequence/genome.fasta', checkIfExists: true)
]
"""
}
}

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

}

test("human - bam - intervals - gvcf - stub") {

config './nextflow.config'
options "-stub"

when {
params {
module_args = '--gvcf'
}
process {
"""
input[0] = [
[ id:'test'],
file(params.modules_testdata_base_path + 'genomics/homo_sapiens/illumina/bam/test2.paired_end.recalibrated.sorted.bam', checkIfExists: true),
file(params.modules_testdata_base_path + 'genomics/homo_sapiens/illumina/bam/test2.paired_end.recalibrated.sorted.bam.bai', checkIfExists: true),
file(params.modules_testdata_base_path + 'genomics/homo_sapiens/genome/chr21/sequence/multi_intervals.bed', checkIfExists: true)
]
input[1] = [
[ id:'test'],
file(params.modules_testdata_base_path + 'genomics/homo_sapiens/genome/chr21/sequence/genome.fasta', checkIfExists: true)
]
"""
}
}

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

}

}
106 changes: 106 additions & 0 deletions modules/nf-core/parabricks/deepvariant/tests/main.nf.test.snap
Original file line number Diff line number Diff line change
@@ -0,0 +1,106 @@
{
"human - bam - intervals - gvcf": {
"content": [
[
"versions.yml:md5,c7bcf80d609e2951eb99f0b774cd2f6d"
]
],
"meta": {
"nf-test": "0.9.2",
"nextflow": "24.10.0"
},
"timestamp": "2024-11-14T15:26:48.481295634"
},
"human - bam - stub": {
"content": [
{
"0": [
[
{
"id": "test"
},
"test.vcf:md5,d41d8cd98f00b204e9800998ecf8427e"
]
],
"1": [
"versions.yml:md5,c7bcf80d609e2951eb99f0b774cd2f6d"
],
"vcf": [
[
{
"id": "test"
},
"test.vcf:md5,d41d8cd98f00b204e9800998ecf8427e"
]
],
"versions": [
"versions.yml:md5,c7bcf80d609e2951eb99f0b774cd2f6d"
]
}
],
"meta": {
"nf-test": "0.9.2",
"nextflow": "24.10.0"
},
"timestamp": "2024-11-14T15:05:28.449273519"
},
"human - bam - intervals": {
"content": [
"27097afc7aae62918a3e26790cc189c3",
[
"versions.yml:md5,c7bcf80d609e2951eb99f0b774cd2f6d"
]
],
"meta": {
"nf-test": "0.9.2",
"nextflow": "24.10.0"
},
"timestamp": "2024-11-14T15:06:52.854870182"
},
"human - bam": {
"content": [
"8b526a232f93a5036176336415abf7d1",
[
"versions.yml:md5,c7bcf80d609e2951eb99f0b774cd2f6d"
]
],
"meta": {
"nf-test": "0.9.2",
"nextflow": "24.10.0"
},
"timestamp": "2024-11-14T15:06:37.651354312"
},
"human - bam - intervals - gvcf - stub": {
"content": [
{
"0": [
[
{
"id": "test"
},
"test.g.vcf:md5,d41d8cd98f00b204e9800998ecf8427e"
]
],
"1": [
"versions.yml:md5,c7bcf80d609e2951eb99f0b774cd2f6d"
],
"vcf": [
[
{
"id": "test"
},
"test.g.vcf:md5,d41d8cd98f00b204e9800998ecf8427e"
]
],
"versions": [
"versions.yml:md5,c7bcf80d609e2951eb99f0b774cd2f6d"
]
}
],
"meta": {
"nf-test": "0.9.2",
"nextflow": "24.10.0"
},
"timestamp": "2024-11-14T15:12:11.438654866"
}
}
8 changes: 8 additions & 0 deletions modules/nf-core/parabricks/deepvariant/tests/nextflow.config
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
process {

withName: 'PARABRICKS_DEEPVARIANT' {
ext.args = params.module_args
stageInMode = 'copy'
}

}
3 changes: 0 additions & 3 deletions tests/config/pytest_modules.yml
Original file line number Diff line number Diff line change
Expand Up @@ -398,9 +398,6 @@ oncocnv:
parabricks/dbsnp:
- modules/nf-core/parabricks/dbsnp/**
- tests/modules/nf-core/parabricks/dbsnp/**
parabricks/deepvariant:
- modules/nf-core/parabricks/deepvariant/**
- tests/modules/nf-core/parabricks/deepvariant/**
parabricks/haplotypecaller:
- modules/nf-core/parabricks/haplotypecaller/**
- tests/modules/nf-core/parabricks/haplotypecaller/**
Expand Down
Loading
Loading