-
Notifications
You must be signed in to change notification settings - Fork 742
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
port
controlfreec-freec
to nf-test (#5398)
* feat: add nf-test files and snapshot * remove pytest files * modify test to comment single * change snap * fix tests and update snap --------- Co-authored-by: Maxime U Garcia <[email protected]>
- Loading branch information
Showing
7 changed files
with
379 additions
and
114 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,165 @@ | ||
nextflow_process { | ||
|
||
name "Test Process CONTROLFREEC_FREEC" | ||
script "../main.nf" | ||
process "CONTROLFREEC_FREEC" | ||
config "./nextflow.config" | ||
|
||
tag "modules" | ||
tag "modules_nfcore" | ||
tag "controlfreec" | ||
tag "controlfreec/freec" | ||
tag "untar" | ||
|
||
setup { | ||
|
||
run("UNTAR") { | ||
script "../../../../nf-core/untar/main.nf" | ||
process { | ||
""" | ||
input[0] = [ [], | ||
file(params.modules_testdata_base_path + 'genomics/homo_sapiens/genome/chr21/sequence/chromosomes.tar.gz', checkIfExists: true) | ||
] | ||
""" | ||
} | ||
} | ||
|
||
} | ||
|
||
test("human - mpileup") { | ||
|
||
when { | ||
process { | ||
""" | ||
input[0] = [ [ id:'test', single_end:false, sex:'XX' ], // meta map | ||
file(params.modules_testdata_base_path + 'genomics/homo_sapiens/illumina/mpileup/test.mpileup.gz', checkIfExists: true), | ||
file(params.modules_testdata_base_path + 'genomics/homo_sapiens/illumina/mpileup/test2.mpileup.gz', checkIfExists: true), | ||
[],[],[],[] | ||
] | ||
// fasta | ||
input[1] = file(params.modules_testdata_base_path + 'genomics/homo_sapiens/genome/chr21/sequence/genome.fasta', checkIfExists: true) | ||
// fai | ||
input[2] = file(params.modules_testdata_base_path + 'genomics/homo_sapiens/genome/chr21/sequence/genome.fasta.fai', checkIfExists: true) | ||
// snp_position | ||
input[3] = [] | ||
// known_snps | ||
input[4] = file(params.modules_testdata_base_path + 'genomics/homo_sapiens/genome/chr21/germlineresources/dbsnp_138.hg38.vcf.gz', checkIfExists: true) | ||
// known_snps_tbi | ||
input[5] = file(params.modules_testdata_base_path + 'genomics/homo_sapiens/genome/chr21/germlineresources/dbsnp_138.hg38.vcf.gz.tbi', checkIfExists: true) | ||
// chr_directory | ||
input[6] = UNTAR.out.untar.map{ it[1] } | ||
// mappability | ||
input[7] = [] | ||
// target_bed | ||
input[8] = file(params.modules_testdata_base_path + 'genomics/homo_sapiens/genome/chr21/sequence/multi_intervals.bed', checkIfExists: true) | ||
// gccontent_profile | ||
input[9] = [] | ||
""" | ||
} | ||
} | ||
|
||
then { | ||
assertAll( | ||
{ assert process.success }, | ||
// not asserting optional outputs [bedgraph, control_cpn, gcprofile_cpn] | ||
{ assert snapshot( | ||
// match file names | ||
file(process.out.sample_cpn.get(0).get(1)).name, | ||
file(process.out.CNV.get(0).get(1)).name, | ||
// match first line | ||
path(process.out.BAF.get(0).get(1)).readLines()[0], | ||
path(process.out.ratio.get(0).get(1)).readLines()[0], | ||
path(process.out.config.get(0).get(1)).readLines()[0], | ||
path(process.out.info.get(0).get(1)).readLines()[0] | ||
).match() }, | ||
{ assert snapshot(process.out.versions).match("version") } | ||
) | ||
} | ||
|
||
} | ||
|
||
// test("human - mpileup - single") { | ||
|
||
// when { | ||
// process { | ||
// """ | ||
// input[0] = [ [ id:'test', single_end:false, sex:'XX' ], // meta map | ||
// [], | ||
// file(params.modules_testdata_base_path + 'genomics/homo_sapiens/illumina/mpileup/test2.mpileup.gz', checkIfExists: true), | ||
// [],[],[],[] | ||
// ] | ||
// // fasta | ||
// input[1] = file(params.modules_testdata_base_path + 'genomics/homo_sapiens/genome/chr21/sequence/genome.fasta', checkIfExists: true) | ||
// // fai | ||
// input[2] = file(params.modules_testdata_base_path + 'genomics/homo_sapiens/genome/chr21/sequence/genome.fasta.fai', checkIfExists: true) | ||
// // snp_position | ||
// input[3] = [] | ||
// // known_snps | ||
// input[4] = file(params.modules_testdata_base_path + 'genomics/homo_sapiens/genome/chr21/germlineresources/dbsnp_138.hg38.vcf.gz', checkIfExists: true) | ||
// // known_snps_tbi | ||
// input[5] = file(params.modules_testdata_base_path + 'genomics/homo_sapiens/genome/chr21/germlineresources/dbsnp_138.hg38.vcf.gz.tbi', checkIfExists: true) | ||
// // chr_directory | ||
// input[6] = UNTAR.out.untar.map{ it[1] } | ||
// // mappability | ||
// input[7] = [] | ||
// // target_bed | ||
// input[8] = file(params.modules_testdata_base_path + 'genomics/homo_sapiens/genome/chr21/sequence/multi_intervals.bed', checkIfExists: true) | ||
// // gccontent_profile | ||
// input[9] = [] | ||
// """ | ||
// } | ||
// } | ||
|
||
// then { | ||
// assertAll( | ||
// { assert process.success }, | ||
// { assert snapshot(process.out).match() } | ||
// ) | ||
// } | ||
|
||
// } | ||
|
||
test("human - mpileup - stub") { | ||
|
||
options "-stub" | ||
|
||
when { | ||
process { | ||
""" | ||
input[0] = [ [ id:'test', single_end:false, sex:'XX' ], // meta map | ||
file(params.modules_testdata_base_path + 'genomics/homo_sapiens/illumina/mpileup/test.mpileup.gz', checkIfExists: true), | ||
file(params.modules_testdata_base_path + 'genomics/homo_sapiens/illumina/mpileup/test2.mpileup.gz', checkIfExists: true), | ||
[],[],[],[] | ||
] | ||
// fasta | ||
input[1] = file(params.modules_testdata_base_path + 'genomics/homo_sapiens/genome/chr21/sequence/genome.fasta', checkIfExists: true) | ||
// fai | ||
input[2] = file(params.modules_testdata_base_path + 'genomics/homo_sapiens/genome/chr21/sequence/genome.fasta.fai', checkIfExists: true) | ||
// snp_position | ||
input[3] = [] | ||
// known_snps | ||
input[4] = file(params.modules_testdata_base_path + 'genomics/homo_sapiens/genome/chr21/germlineresources/dbsnp_138.hg38.vcf.gz', checkIfExists: true) | ||
// known_snps_tbi | ||
input[5] = file(params.modules_testdata_base_path + 'genomics/homo_sapiens/genome/chr21/germlineresources/dbsnp_138.hg38.vcf.gz.tbi', checkIfExists: true) | ||
// chr_directory | ||
input[6] = UNTAR.out.untar.map{ it[1] } | ||
// mappability | ||
input[7] = [] | ||
// target_bed | ||
input[8] = file(params.modules_testdata_base_path + 'genomics/homo_sapiens/genome/chr21/sequence/multi_intervals.bed', checkIfExists: true) | ||
// gccontent_profile | ||
input[9] = [] | ||
""" | ||
} | ||
} | ||
|
||
then { | ||
assertAll( | ||
{ assert process.success }, | ||
{ assert snapshot(process.out).match() } | ||
) | ||
} | ||
|
||
} | ||
|
||
} |
212 changes: 212 additions & 0 deletions
212
modules/nf-core/controlfreec/freec/tests/main.nf.test.snap
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
3 changes: 0 additions & 3 deletions
3
...f-core/controlfreec/freec/nextflow.config → .../controlfreec/freec/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
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 @@ | ||
controlfreec/freec: | ||
- "modules/nf-core/controlfreec/freec/**" |
Oops, something went wrong.