forked from nf-core/modules
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Convert ngscheckmate/vafncm to nf-test (nf-core#5696)
* Add tests for vafncm * Fix linting
- Loading branch information
Showing
8 changed files
with
277 additions
and
119 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,155 @@ | ||
nextflow_process { | ||
|
||
name "Test Process NGSCHECKMATE_VAFNCM" | ||
script "../main.nf" | ||
config "./nextflow.config" | ||
process "NGSCHECKMATE_VAFNCM" | ||
|
||
tag "modules" | ||
tag "modules_nfcore" | ||
tag "ngscheckmate" | ||
tag "ngscheckmate/vafncm" | ||
tag "gawk" | ||
tag "bedtools/makewindows" | ||
tag "bowtie/build" | ||
tag "ngscheckmate/patterngenerator" | ||
tag "ngscheckmate/fastq" | ||
|
||
setup { | ||
|
||
run("GAWK" , alias: "GAWK_FAI") { | ||
script "../../../gawk/main.nf" | ||
process { | ||
""" | ||
input[0] = [ | ||
[ id: 'sarscov2' ], | ||
file(params.test_data['sarscov2']['genome']['genome_fasta_fai'], checkIfExists: true) | ||
] | ||
input[1] = [] | ||
""" | ||
} | ||
} | ||
|
||
run("BEDTOOLS_MAKEWINDOWS") { | ||
script "../../../bedtools/makewindows/main.nf" | ||
process { | ||
""" | ||
input[0] = GAWK_FAI.out.output | ||
""" | ||
} | ||
} | ||
|
||
run("GAWK" , alias: "GAWK_BED") { | ||
script "../../../gawk/main.nf" | ||
process { | ||
""" | ||
input[0] = BEDTOOLS_MAKEWINDOWS.out.bed | ||
input[1] = [] | ||
""" | ||
} | ||
} | ||
|
||
run("BOWTIE_BUILD") { | ||
script "../../../bowtie/build/main.nf" | ||
process { | ||
""" | ||
input[0] = file(params.test_data['sarscov2']['genome']['genome_fasta'], checkIfExists: true) | ||
""" | ||
} | ||
} | ||
|
||
run("NGSCHECKMATE_PATTERNGENERATOR") { | ||
script "../../patterngenerator/main.nf" | ||
process { | ||
""" | ||
input[0] = GAWK_BED.out.output | ||
input[1] = [ | ||
[ id: 'sarscov2' ], | ||
file(params.test_data['sarscov2']['genome']['genome_fasta'], checkIfExists: true) | ||
] | ||
input[2] = BOWTIE_BUILD.out.index | ||
""" | ||
} | ||
} | ||
|
||
run("NGSCHECKMATE_FASTQ") { | ||
script "../../fastq/main.nf" | ||
process { | ||
""" | ||
input[0] = channel.fromList( | ||
[ | ||
[ | ||
[ id:'test1', single_end:false ], // meta map | ||
[ | ||
file(params.test_data['sarscov2']['illumina']['test_1_fastq_gz'], checkIfExists: true), | ||
file(params.test_data['sarscov2']['illumina']['test_2_fastq_gz'], checkIfExists: true) | ||
] | ||
], | ||
[ | ||
[ id:'test2', single_end:false ], // meta map | ||
[ | ||
file(params.test_data['sarscov2']['illumina']['test2_1_fastq_gz'], checkIfExists: true), | ||
file(params.test_data['sarscov2']['illumina']['test2_2_fastq_gz'], checkIfExists: true) | ||
] | ||
], | ||
[ | ||
[ id:'test3', single_end:false ], // meta map | ||
[ | ||
file(params.test_data['sarscov2']['illumina']['test_methylated_1_fastq_gz'], checkIfExists: true), | ||
file(params.test_data['sarscov2']['illumina']['test_methylated_2_fastq_gz'], checkIfExists: true) | ||
] | ||
], | ||
] | ||
) | ||
input[1] = NGSCHECKMATE_PATTERNGENERATOR.out.pt | ||
""" | ||
} | ||
} | ||
|
||
} | ||
|
||
test("sarscov2 - fastq") { | ||
|
||
when { | ||
process { | ||
""" | ||
input[0] = NGSCHECKMATE_FASTQ.out.vaf.map{it[1]}.collect().map{files -> [[id:"combined"], files]} | ||
""" | ||
} | ||
} | ||
|
||
then { | ||
assertAll( | ||
{ assert process.success }, | ||
{ assert snapshot( | ||
process.out.corr_matrix, | ||
process.out.matched, | ||
process.out.all, | ||
process.out.versions).match() } | ||
) | ||
} | ||
|
||
} | ||
|
||
test("sarscov2 - fastq - stub") { | ||
|
||
options "-stub" | ||
|
||
when { | ||
process { | ||
""" | ||
input[0] = NGSCHECKMATE_FASTQ.out.vaf.map{it[1]}.collect().map{files -> [[id:"combined"], files]} | ||
""" | ||
} | ||
} | ||
|
||
then { | ||
assertAll( | ||
{ assert process.success }, | ||
{ assert snapshot(process.out).match() } | ||
) | ||
} | ||
|
||
} | ||
|
||
} |
119 changes: 119 additions & 0 deletions
119
modules/nf-core/ngscheckmate/vafncm/tests/main.nf.test.snap
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,119 @@ | ||
{ | ||
"sarscov2 - fastq - stub": { | ||
"content": [ | ||
{ | ||
"0": [ | ||
[ | ||
{ | ||
"id": "combined" | ||
}, | ||
"combined.pdf:md5,d41d8cd98f00b204e9800998ecf8427e" | ||
] | ||
], | ||
"1": [ | ||
[ | ||
{ | ||
"id": "combined" | ||
}, | ||
"combined_corr_matrix.txt:md5,d41d8cd98f00b204e9800998ecf8427e" | ||
] | ||
], | ||
"2": [ | ||
[ | ||
{ | ||
"id": "combined" | ||
}, | ||
"combined_all.txt:md5,d41d8cd98f00b204e9800998ecf8427e" | ||
] | ||
], | ||
"3": [ | ||
[ | ||
{ | ||
"id": "combined" | ||
}, | ||
"combined_matched.txt:md5,d41d8cd98f00b204e9800998ecf8427e" | ||
] | ||
], | ||
"4": [ | ||
"versions.yml:md5,e8fcb7ac4528e05b40b58825c13220f0" | ||
], | ||
"all": [ | ||
[ | ||
{ | ||
"id": "combined" | ||
}, | ||
"combined_all.txt:md5,d41d8cd98f00b204e9800998ecf8427e" | ||
] | ||
], | ||
"corr_matrix": [ | ||
[ | ||
{ | ||
"id": "combined" | ||
}, | ||
"combined_corr_matrix.txt:md5,d41d8cd98f00b204e9800998ecf8427e" | ||
] | ||
], | ||
"matched": [ | ||
[ | ||
{ | ||
"id": "combined" | ||
}, | ||
"combined_matched.txt:md5,d41d8cd98f00b204e9800998ecf8427e" | ||
] | ||
], | ||
"pdf": [ | ||
[ | ||
{ | ||
"id": "combined" | ||
}, | ||
"combined.pdf:md5,d41d8cd98f00b204e9800998ecf8427e" | ||
] | ||
], | ||
"versions": [ | ||
"versions.yml:md5,e8fcb7ac4528e05b40b58825c13220f0" | ||
] | ||
} | ||
], | ||
"meta": { | ||
"nf-test": "0.8.4", | ||
"nextflow": "24.04.1" | ||
}, | ||
"timestamp": "2024-05-26T08:37:18.164420662" | ||
}, | ||
"sarscov2 - fastq": { | ||
"content": [ | ||
[ | ||
[ | ||
{ | ||
"id": "combined" | ||
}, | ||
"output_corr_matrix.txt:md5,fe8139cc3dffb7df41d17aa24c599dba" | ||
] | ||
], | ||
[ | ||
[ | ||
{ | ||
"id": "combined" | ||
}, | ||
"combined_matched.txt:md5,60d6159595026c2365acce3dbaa9677e" | ||
] | ||
], | ||
[ | ||
[ | ||
{ | ||
"id": "combined" | ||
}, | ||
"combined_all.txt:md5,6e7c7446bb308af84ee9b1689e1e60ee" | ||
] | ||
], | ||
[ | ||
"versions.yml:md5,e8fcb7ac4528e05b40b58825c13220f0" | ||
] | ||
], | ||
"meta": { | ||
"nf-test": "0.8.4", | ||
"nextflow": "24.04.1" | ||
}, | ||
"timestamp": "2024-05-26T08:42:46.60890226" | ||
} | ||
} |
6 changes: 0 additions & 6 deletions
6
...-core/ngscheckmate/vafncm/nextflow.config → ...ngscheckmate/vafncm/tests/nextflow.config
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,22 +1,16 @@ | ||
process { | ||
|
||
publishDir = { "${params.outdir}/${task.process.tokenize(':')[-1].tokenize('_')[0].toLowerCase()}" } | ||
|
||
withName: BEDTOOLS_MAKEWINDOWS { | ||
ext.args = '-w 1' | ||
ext.prefix = 'test_split' | ||
} | ||
|
||
withName: GAWK_BED { | ||
ext.args2 = '\'NR > 20 && NR < 20000 && FS = OFS = "\t" { print $0 FS "rs1" FS "G" FS "C" }\'' | ||
ext.prefix = 'snp' | ||
ext.suffix = "bed" | ||
} | ||
|
||
withName: GAWK_FAI { | ||
ext.args2 = '\'BEGIN { FS = OFS = "\t" } { print \$1 FS "0" FS \$2 }\'' | ||
ext.prefix = 'fasta' | ||
ext.suffix = "bed" | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
ngscheckmate/vafncm: | ||
- "modules/nf-core/ngscheckmate/vafncm/**" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.