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/mutectcaller to nf-test #6991

Open
wants to merge 39 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 37 commits
Commits
Show all changes
39 commits
Select commit Hold shift + click to select a range
192699b
port to nf-test
famosab Nov 13, 2024
fca1546
change conf
famosab Nov 13, 2024
fdd5ce6
add num_gpu
famosab Nov 13, 2024
5fe3310
comment out some tests
famosab Nov 13, 2024
409a86e
comment out some tests
famosab Nov 13, 2024
3613eec
only stub
famosab Nov 13, 2024
9cf060a
only stub
famosab Nov 13, 2024
a56692a
stub snap works
famosab Nov 13, 2024
ae10a6b
add normal test
famosab Nov 13, 2024
52cf9bf
low mem
famosab Nov 13, 2024
971c2a9
add more tests
famosab Nov 13, 2024
7d32e00
wip
famosab Nov 14, 2024
d240c88
add working tests
famosab Nov 14, 2024
d48fee6
update test
famosab Nov 15, 2024
1acf6ac
Merge branch 'master' into mutectcaller
famosab Nov 18, 2024
511280a
update test yaml
famosab Nov 18, 2024
413da91
port to nf-test
famosab Nov 13, 2024
47c8910
change conf
famosab Nov 13, 2024
d7f5501
add num_gpu
famosab Nov 13, 2024
16d1f20
comment out some tests
famosab Nov 13, 2024
d738f10
comment out some tests
famosab Nov 13, 2024
0a70e99
only stub
famosab Nov 13, 2024
7937399
only stub
famosab Nov 13, 2024
2845150
stub snap works
famosab Nov 13, 2024
4661874
add normal test
famosab Nov 13, 2024
d404aa9
low mem
famosab Nov 13, 2024
bc93c65
add more tests
famosab Nov 13, 2024
acf65af
wip
famosab Nov 14, 2024
a2faa76
add working tests
famosab Nov 14, 2024
8b6eced
update test
famosab Nov 15, 2024
0f32b3c
swap to one config
famosab Nov 21, 2024
6411112
add to conda_skip
famosab Dec 2, 2024
2b01c09
Merge branch 'master' into mutectcaller
famosab Dec 2, 2024
99eee96
add tag gpu
famosab Dec 2, 2024
af856b8
Merge branch 'master' into mutectcaller
famosab Dec 9, 2024
8a96f48
update snap
famosab Dec 9, 2024
e941a28
Merge branch 'master' into mutectcaller
famosab Dec 10, 2024
51b03d7
Apply suggestions from code review
famosab Dec 11, 2024
13dc015
Merge branch 'master' into mutectcaller
famosab Dec 11, 2024
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 @@ -183,4 +183,6 @@ exclude:
- profile: conda
path: modules/nf-core/xeniumranger/import-segmentation
- profile: conda
path: modules/nf-core/parabricks/mutectcaller
- profile: conda
path: modules/nf-core/parabricks/genotypegvcf
10 changes: 6 additions & 4 deletions modules/nf-core/parabricks/mutectcaller/main.nf
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
process PARABRICKS_MUTECTCALLER {
tag "$meta.id"
label 'process_high'
label 'process_gpu'

famosab marked this conversation as resolved.
Show resolved Hide resolved
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(tumor_bam), path(tumor_bam_index), path(normal_bam), path(normal_bam_index), path(interval_file)
Expand Down Expand Up @@ -30,6 +31,7 @@ process PARABRICKS_MUTECTCALLER {
def interval_file_command = interval_file ? interval_file.collect{"--interval-file $it"}.join(' ') : ""
def prepon_command = panel_of_normals ? "cp -L $panel_of_normals_index `readlink -f $panel_of_normals`.tbi && pbrun prepon --in-pon-file $panel_of_normals" : ""
def postpon_command = panel_of_normals ? "pbrun postpon --in-vcf ${prefix}.vcf.gz --in-pon-file $panel_of_normals --out-vcf ${prefix}_annotated.vcf.gz" : ""
def num_gpus = task.accelerator ? "--num-gpus $task.accelerator.request" : ""
"""

# if panel of normals specified, run prepon
Expand All @@ -42,7 +44,7 @@ process PARABRICKS_MUTECTCALLER {
--tumor-name ${meta.tumor_id} \\
--out-vcf ${prefix}.vcf.gz \\
$interval_file_command \\
--num-gpus $task.accelerator.request \\
$num_gpus \\
$args

# if panel of normals specified, run postpon
Expand All @@ -57,9 +59,9 @@ process PARABRICKS_MUTECTCALLER {
stub:
def args = task.ext.args ?: ''
def prefix = task.ext.prefix ?: "${meta.id}"
def postpon_command = panel_of_normals ? "touch ${prefix}_annotated.vcf.gz" : ""
def postpon_command = panel_of_normals ? "echo '' | gzip > ${prefix}_annotated.vcf.gz" : ""
"""
touch ${prefix}.vcf.gz
echo "" | gzip > ${prefix}.vcf.gz
touch ${prefix}.vcf.gz.stats
$postpon_command

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

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

tag "modules"
tag "parabricks/mutectcaller"
tag "modules_nfcore"
tag "parabricks"
tag "gpu"

test("human - bam") {

config "./nextflow.config"

when {
params {
module_args = "--mutect-low-memory"
}
process {
"""
input[0] = [
[ id:'test', tumor_id:'tumour' ],
file(params.test_data['homo_sapiens']['illumina']['test2_paired_end_recalibrated_sorted_bam'], checkIfExists: true),
[], // index only neeeded if using intervals or tumor-normal calling
[],
[],
[]
]
input[1] = [ // fasta
[ id: 'reference' ],
file(params.test_data['homo_sapiens']['genome']['genome_21_fasta'], checkIfExists: true)
]
input[2] = [] // pon
input[3] = [] // pon index
"""
}
}

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

}

// test("human - bam - tn") {
// // tumor-normal calling not passing because of issue with readgroups in the test files
// // [PB Error][src/readers.cpp:1314] ID simulation01 maps to tm_simulation01, but PU is nm_simulation01 (different platform), exiting.

// config "./nextflow.config"

// when {
// params {
// module_args = "--in-normal-bam $normal_bam --normal-name $meta.normal_id --mutect-low-memory"
// }
// process {
// """
// input[0] = [
// [ id:'test', tumor_id:'tumour', normal_id:'normal' ],
// file(params.test_data['homo_sapiens']['illumina']['test2_paired_end_recalibrated_sorted_bam'], checkIfExists: true),
// file(params.test_data['homo_sapiens']['illumina']['test2_paired_end_recalibrated_sorted_bam_bai'], checkIfExists: true),
// file(params.test_data['homo_sapiens']['illumina']['test_paired_end_recalibrated_sorted_bam'], checkIfExists: true),
// file(params.test_data['homo_sapiens']['illumina']['test_paired_end_recalibrated_sorted_bam_bai'], checkIfExists: true),
// []
// ]
// input[1] = [ // fasta
// [ id: 'reference' ], //genomics/homo_sapiens/genome/chr21/sequence/genome.fasta
// // file()
// file(params.test_data['homo_sapiens']['genome']['genome_21_fasta'], checkIfExists: true)
// ]
// input[2] = [] // pon
// input[3] = [] // pon index
// """
// }
// }

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

// }

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

// config "./nextflow.config"

// when {
// params {
// module_args = "--mutect-low-memory"
// }
// process {
// """
// input[0] = [
// [ id:'test', tumor_id:'tumor' ],
// file(params.test_data['homo_sapiens']['illumina']['test2_paired_end_recalibrated_sorted_bam'], checkIfExists: true),
// file(params.test_data['homo_sapiens']['illumina']['test2_paired_end_recalibrated_sorted_bam_bai'], checkIfExists: true),
// [],
// [],
// file(params.test_data['homo_sapiens']['genome']['genome_21_multi_interval_bed'], checkIfExists: true)
// ]
// input[1] = [ // fasta
// [ id: 'reference' ],
// file(params.test_data['homo_sapiens']['genome']['genome_21_fasta'], checkIfExists: true)
// ]
// input[2] = [] // pon
// input[3] = [] // pon index
// """
// }
// }

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

// }

// test("human - bam - tn - intervals") {
// // tumor-normal calling not passing because of issue with readgroups in the test files
// // [PB Error][src/readers.cpp:1314] ID simulation01 maps to tm_simulation01, but PU is nm_simulation01 (different platform), exiting.

// config "./nextflow.config"

// when {
// params {
// module_args = "--in-normal-bam $normal_bam --normal-name $meta.normal_id --mutect-low-memory"
// }
// process {
// """
// input[0] = [
// [ id:'test', tumor_id:'tumor', normal_id:'normal'],
// file(params.test_data['homo_sapiens']['illumina']['test2_paired_end_recalibrated_sorted_bam'], checkIfExists: true),
// file(params.test_data['homo_sapiens']['illumina']['test2_paired_end_recalibrated_sorted_bam_bai'], checkIfExists: true),
// file(params.test_data['homo_sapiens']['illumina']['test_paired_end_recalibrated_sorted_bam'], checkIfExists: true),
// file(params.test_data['homo_sapiens']['illumina']['test_paired_end_recalibrated_sorted_bam_bai'], checkIfExists: true),
// file(params.test_data['homo_sapiens']['genome']['genome_21_multi_interval_bed'], checkIfExists: true)
// ]
// input[1] = [ // fasta
// [ id: 'reference' ],
// file(params.test_data['homo_sapiens']['genome']['genome_21_fasta'], checkIfExists: true)
// ]
// input[2] = [] // pon
// input[3] = [] // pon index
// """
// }
// }

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

// }

// test("human - bam - pon") {
// // PON test not passing because the tool expects all chromosomes in the PON file to
// // be present in the reference genome.

// config "./nextflow.config"

// when {
// params {
// module_args = "--pon $panel_of_normals --mutect-low-memory"
// }
// process {
// """
// input[0] = [
// [ id:'test', tumor_id:'tumour' ],
// file(params.test_data['homo_sapiens']['illumina']['test2_paired_end_recalibrated_sorted_bam'], checkIfExists: true),
// file(params.test_data['homo_sapiens']['illumina']['test2_paired_end_recalibrated_sorted_bam_bai'], checkIfExists: true),
// [],
// [],
// file(params.test_data['homo_sapiens']['genome']['genome_21_multi_interval_bed'], checkIfExists: true)
// ]
// input[1] = [ // fasta
// [ id: 'reference' ],
// file(params.test_data['homo_sapiens']['genome']['genome_21_fasta'], checkIfExists: true)
// ]
// input[2] = file(params.test_data['homo_sapiens']['genome']['mills_and_1000g_indels_21_vcf_gz'], checkIfExists: true)
// input[3] = file(params.test_data['homo_sapiens']['genome']['mills_and_1000g_indels_21_vcf_gz_tbi'], checkIfExists: true)
// """
// }
// }

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

// }

test("human - bam - stub") {

options '-stub'

when {
process {
"""
input[0] = [
[ id:'test', tumor_id:'tumour' ],
file(params.test_data['homo_sapiens']['illumina']['test2_paired_end_recalibrated_sorted_bam'], checkIfExists: true),
[], // index only neeeded if using intervals or tumor-normal calling
[],
[],
[]
]
input[1] = [ // fasta
[ id: 'reference' ],
file(params.test_data['homo_sapiens']['genome']['genome_21_fasta'], checkIfExists: true)
]
input[2] = [] // pon
input[3] = [] // pon index
"""
}
}

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

}

test("human - bam - pon - stub") {

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

when {
params {
module_args = "--pon $panel_of_normals --mutect-low-memory"
}
process {
"""
input[0] = [
[ id:'test', tumor_id:'tumour' ],
file(params.test_data['homo_sapiens']['illumina']['test2_paired_end_recalibrated_sorted_bam'], checkIfExists: true),
file(params.test_data['homo_sapiens']['illumina']['test2_paired_end_recalibrated_sorted_bam_bai'], checkIfExists: true),
[],
[],
file(params.test_data['homo_sapiens']['genome']['genome_21_multi_interval_bed'], checkIfExists: true)
]
input[1] = [ // fasta
[ id: 'reference' ],
file(params.test_data['homo_sapiens']['genome']['genome_21_fasta'], checkIfExists: true)
]
input[2] = file(params.test_data['homo_sapiens']['genome']['mills_and_1000g_indels_21_vcf_gz'], checkIfExists: true)
input[3] = file(params.test_data['homo_sapiens']['genome']['mills_and_1000g_indels_21_vcf_gz_tbi'], checkIfExists: true)
"""
}
}

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

}

}
Loading
Loading