Skip to content

Commit

Permalink
Added nf-test for gatk4/calibratedragstrmodel (#6321)
Browse files Browse the repository at this point in the history
Co-authored-by: Simon Pearce <[email protected]>
  • Loading branch information
GallVp and SPPearce authored Aug 26, 2024
1 parent adf8be4 commit 3f42e07
Show file tree
Hide file tree
Showing 6 changed files with 215 additions and 109 deletions.
137 changes: 137 additions & 0 deletions modules/nf-core/gatk4/calibratedragstrmodel/tests/main.nf.test
Original file line number Diff line number Diff line change
@@ -0,0 +1,137 @@

nextflow_process {

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

tag "modules"
tag "modules_nfcore"
tag "gatk4"
tag "gatk4/calibratedragstrmodel"

test("test-gatk4-calibratedragstrmodel-bam") {

when {
process {
"""
input[0] = [
[ id:'test', single_end:false ], // meta map
file(params.modules_testdata_base_path + 'genomics/homo_sapiens/illumina/bam/test.paired_end.sorted.bam', checkIfExists: true),
file(params.modules_testdata_base_path + 'genomics/homo_sapiens/illumina/bam/test.paired_end.sorted.bam.bai', checkIfExists: true),
]
input[1] = file(params.modules_testdata_base_path + 'genomics/homo_sapiens/genome/genome.fasta', checkIfExists: true)
input[2] = file(params.modules_testdata_base_path + 'genomics/homo_sapiens/genome/genome.fasta.fai', checkIfExists: true)
input[3] = file(params.modules_testdata_base_path + 'genomics/homo_sapiens/genome/genome.dict', checkIfExists: true)
input[4] = file(params.modules_testdata_base_path + 'genomics/homo_sapiens/genome/genome_strtablefile.zip', checkIfExists: true)
"""
}
}

then {
assertAll(
{ assert process.success },
{ assert snapshot(
file(process.out.dragstr_model[0][1]).readLines()[3..7],
process.out.versions
).match()
}
)
}
}

test("test-gatk4-calibratedragstrmodel-cram") {

when {
process {
"""
input[0] = [
[ id:'test', single_end:false ], // meta map
file(params.modules_testdata_base_path + 'genomics/homo_sapiens/illumina/cram/test.paired_end.sorted.cram', checkIfExists: true),
file(params.modules_testdata_base_path + 'genomics/homo_sapiens/illumina/cram/test.paired_end.sorted.cram.crai', checkIfExists: true),
]
input[1] = file(params.modules_testdata_base_path + 'genomics/homo_sapiens/genome/genome.fasta', checkIfExists: true)
input[2] = file(params.modules_testdata_base_path + 'genomics/homo_sapiens/genome/genome.fasta.fai', checkIfExists: true)
input[3] = file(params.modules_testdata_base_path + 'genomics/homo_sapiens/genome/genome.dict', checkIfExists: true)
input[4] = file(params.modules_testdata_base_path + 'genomics/homo_sapiens/genome/genome_strtablefile.zip', checkIfExists: true)
"""
}
}

then {
assertAll(
{ assert process.success },
{ assert snapshot(
file(process.out.dragstr_model[0][1]).readLines()[3..7],
process.out.versions
).match()
}
)
}
}

test("test-gatk4-calibratedragstrmodel-beds") {

when {
process {
"""
input[0] = [
[ id:'test', single_end:false ], // meta map
file(params.modules_testdata_base_path + 'genomics/homo_sapiens/illumina/cram/test.paired_end.sorted.cram', checkIfExists: true),
file(params.modules_testdata_base_path + 'genomics/homo_sapiens/illumina/cram/test.paired_end.sorted.cram.crai', checkIfExists: true),
]
input[1] = file(params.modules_testdata_base_path + 'genomics/homo_sapiens/genome/genome.fasta', checkIfExists: true)
input[2] = file(params.modules_testdata_base_path + 'genomics/homo_sapiens/genome/genome.fasta.fai', checkIfExists: true)
input[3] = file(params.modules_testdata_base_path + 'genomics/homo_sapiens/genome/genome.dict', checkIfExists: true)
input[4] = file(params.modules_testdata_base_path + 'genomics/homo_sapiens/genome/genome_strtablefile.zip', checkIfExists: true)
"""
}
}

then {
assertAll(
{ assert process.success },
{ assert snapshot(
file(process.out.dragstr_model[0][1]).readLines()[3..7],
process.out.versions
).match()
}
)
}
}

test("test-gatk4-calibratedragstrmodel-gzipped-beds") {

when {
process {
"""
input[0] = [
[ id:'test', single_end:false ], // meta map
file(params.modules_testdata_base_path + 'genomics/homo_sapiens/illumina/cram/test.paired_end.sorted.cram', checkIfExists: true),
file(params.modules_testdata_base_path + 'genomics/homo_sapiens/illumina/cram/test.paired_end.sorted.cram.crai', checkIfExists: true),
]
input[1] = file(params.modules_testdata_base_path + 'genomics/homo_sapiens/genome/genome.fasta', checkIfExists: true)
input[2] = file(params.modules_testdata_base_path + 'genomics/homo_sapiens/genome/genome.fasta.fai', checkIfExists: true)
input[3] = file(params.modules_testdata_base_path + 'genomics/homo_sapiens/genome/genome.dict', checkIfExists: true)
input[4] = file(params.modules_testdata_base_path + 'genomics/homo_sapiens/genome/genome_strtablefile.zip', checkIfExists: true)
"""
}
}

then {
assertAll(
{ assert process.success },
{ assert snapshot(
file(process.out.dragstr_model[0][1]).readLines()[3..7],
process.out.versions
).match()
}
)
}
}

}
Original file line number Diff line number Diff line change
@@ -0,0 +1,78 @@
{
"test-gatk4-calibratedragstrmodel-bam": {
"content": [
[
"# sample = testN",
"# readGroups = 1",
"# estimatedOrDefaults = defaults",
"# commandLine = CalibrateDragstrModel --str-table-path genome_strtablefile.zip --threads 2 --output test.txt --input test.paired_end.sorted.bam --reference genome.fasta --tmp-dir . --gp-values 10:1.0:50 --api-values 0:1.0:40 --gop-values 10:.25:50 --het-to-hom-ratio 2.0 --min-loci-count 50 --api-mono-threshold 3 --max-period 8 --max-repeats 20 --minimum-depth 10 --pileup-padding 5 --sampling-min-mq 20 --parallel false --shard-size 1000000 --down-sample-size 4096 --force-estimation false --interval-set-rule UNION --interval-padding 0 --interval-exclusion-padding 0 --interval-merging-rule ALL --read-validation-stringency SILENT --seconds-between-progress-updates 10.0 --disable-sequence-dictionary-validation false --create-output-bam-index true --create-output-bam-md5 false --create-output-variant-index true --create-output-variant-md5 false --max-variants-per-shard 0 --lenient false --add-output-sam-program-record true --add-output-vcf-command-line true --cloud-prefetch-buffer 40 --cloud-index-prefetch-buffer -1 --disable-bam-index-caching false --sites-only-vcf-output false --help false --version false --showHidden false --verbosity INFO --QUIET false --use-jdk-deflater false --use-jdk-inflater false --gcs-max-retries 20 --gcs-project-for-requester-pays --disable-tool-default-read-filters false",
"############################################################################################"
],
[
"versions.yml:md5,3a652afb9cc9fca4e162ec205406b368"
]
],
"meta": {
"nf-test": "0.8.4",
"nextflow": "24.04.4"
},
"timestamp": "2024-08-26T13:22:17.584362"
},
"test-gatk4-calibratedragstrmodel-cram": {
"content": [
[
"# sample = testN",
"# readGroups = 1",
"# estimatedOrDefaults = defaults",
"# commandLine = CalibrateDragstrModel --str-table-path genome_strtablefile.zip --threads 2 --output test.txt --input test.paired_end.sorted.cram --reference genome.fasta --tmp-dir . --gp-values 10:1.0:50 --api-values 0:1.0:40 --gop-values 10:.25:50 --het-to-hom-ratio 2.0 --min-loci-count 50 --api-mono-threshold 3 --max-period 8 --max-repeats 20 --minimum-depth 10 --pileup-padding 5 --sampling-min-mq 20 --parallel false --shard-size 1000000 --down-sample-size 4096 --force-estimation false --interval-set-rule UNION --interval-padding 0 --interval-exclusion-padding 0 --interval-merging-rule ALL --read-validation-stringency SILENT --seconds-between-progress-updates 10.0 --disable-sequence-dictionary-validation false --create-output-bam-index true --create-output-bam-md5 false --create-output-variant-index true --create-output-variant-md5 false --max-variants-per-shard 0 --lenient false --add-output-sam-program-record true --add-output-vcf-command-line true --cloud-prefetch-buffer 40 --cloud-index-prefetch-buffer -1 --disable-bam-index-caching false --sites-only-vcf-output false --help false --version false --showHidden false --verbosity INFO --QUIET false --use-jdk-deflater false --use-jdk-inflater false --gcs-max-retries 20 --gcs-project-for-requester-pays --disable-tool-default-read-filters false",
"############################################################################################"
],
[
"versions.yml:md5,3a652afb9cc9fca4e162ec205406b368"
]
],
"meta": {
"nf-test": "0.8.4",
"nextflow": "24.04.4"
},
"timestamp": "2024-08-26T13:22:30.21551"
},
"test-gatk4-calibratedragstrmodel-gzipped-beds": {
"content": [
[
"# sample = testN",
"# readGroups = 1",
"# estimatedOrDefaults = defaults",
"# commandLine = CalibrateDragstrModel --str-table-path genome_strtablefile.zip --threads 2 --output test.txt --input test.paired_end.sorted.cram --reference genome.fasta --tmp-dir . --gp-values 10:1.0:50 --api-values 0:1.0:40 --gop-values 10:.25:50 --het-to-hom-ratio 2.0 --min-loci-count 50 --api-mono-threshold 3 --max-period 8 --max-repeats 20 --minimum-depth 10 --pileup-padding 5 --sampling-min-mq 20 --parallel false --shard-size 1000000 --down-sample-size 4096 --force-estimation false --interval-set-rule UNION --interval-padding 0 --interval-exclusion-padding 0 --interval-merging-rule ALL --read-validation-stringency SILENT --seconds-between-progress-updates 10.0 --disable-sequence-dictionary-validation false --create-output-bam-index true --create-output-bam-md5 false --create-output-variant-index true --create-output-variant-md5 false --max-variants-per-shard 0 --lenient false --add-output-sam-program-record true --add-output-vcf-command-line true --cloud-prefetch-buffer 40 --cloud-index-prefetch-buffer -1 --disable-bam-index-caching false --sites-only-vcf-output false --help false --version false --showHidden false --verbosity INFO --QUIET false --use-jdk-deflater false --use-jdk-inflater false --gcs-max-retries 20 --gcs-project-for-requester-pays --disable-tool-default-read-filters false",
"############################################################################################"
],
[
"versions.yml:md5,3a652afb9cc9fca4e162ec205406b368"
]
],
"meta": {
"nf-test": "0.8.4",
"nextflow": "24.04.4"
},
"timestamp": "2024-08-26T13:22:53.619871"
},
"test-gatk4-calibratedragstrmodel-beds": {
"content": [
[
"# sample = testN",
"# readGroups = 1",
"# estimatedOrDefaults = defaults",
"# commandLine = CalibrateDragstrModel --str-table-path genome_strtablefile.zip --threads 2 --output test.txt --input test.paired_end.sorted.cram --reference genome.fasta --tmp-dir . --gp-values 10:1.0:50 --api-values 0:1.0:40 --gop-values 10:.25:50 --het-to-hom-ratio 2.0 --min-loci-count 50 --api-mono-threshold 3 --max-period 8 --max-repeats 20 --minimum-depth 10 --pileup-padding 5 --sampling-min-mq 20 --parallel false --shard-size 1000000 --down-sample-size 4096 --force-estimation false --interval-set-rule UNION --interval-padding 0 --interval-exclusion-padding 0 --interval-merging-rule ALL --read-validation-stringency SILENT --seconds-between-progress-updates 10.0 --disable-sequence-dictionary-validation false --create-output-bam-index true --create-output-bam-md5 false --create-output-variant-index true --create-output-variant-md5 false --max-variants-per-shard 0 --lenient false --add-output-sam-program-record true --add-output-vcf-command-line true --cloud-prefetch-buffer 40 --cloud-index-prefetch-buffer -1 --disable-bam-index-caching false --sites-only-vcf-output false --help false --version false --showHidden false --verbosity INFO --QUIET false --use-jdk-deflater false --use-jdk-inflater false --gcs-max-retries 20 --gcs-project-for-requester-pays --disable-tool-default-read-filters false",
"############################################################################################"
],
[
"versions.yml:md5,3a652afb9cc9fca4e162ec205406b368"
]
],
"meta": {
"nf-test": "0.8.4",
"nextflow": "24.04.4"
},
"timestamp": "2024-08-26T13:22:41.938548"
}
}
3 changes: 0 additions & 3 deletions tests/config/pytest_modules.yml
Original file line number Diff line number Diff line change
Expand Up @@ -371,9 +371,6 @@ gappa/examineheattree:
gatk/indelrealigner:
- modules/nf-core/gatk/indelrealigner/**
- tests/modules/nf-core/gatk/indelrealigner/**
gatk4/calibratedragstrmodel:
- modules/nf-core/gatk4/calibratedragstrmodel/**
- tests/modules/nf-core/gatk4/calibratedragstrmodel/**
gatk4/cnnscorevariants:
- modules/nf-core/gatk4/cnnscorevariants/**
- tests/modules/nf-core/gatk4/cnnscorevariants/**
Expand Down
82 changes: 0 additions & 82 deletions tests/modules/nf-core/gatk4/calibratedragstrmodel/main.nf

This file was deleted.

This file was deleted.

19 changes: 0 additions & 19 deletions tests/modules/nf-core/gatk4/calibratedragstrmodel/test.yml

This file was deleted.

0 comments on commit 3f42e07

Please sign in to comment.