Skip to content

Commit

Permalink
Add nf-test for amber module
Browse files Browse the repository at this point in the history
  • Loading branch information
rhassaine committed Nov 12, 2024
1 parent 2fcec6a commit 9268ed5
Show file tree
Hide file tree
Showing 5 changed files with 128 additions and 0 deletions.
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -9,3 +9,7 @@ testing/
testing*
*.pyc
null/
# nf-test specific
.nf-test/
nf-test_*
.nf-test.log*
8 changes: 8 additions & 0 deletions nf-test.config
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
config {

testsDir "tests"
workDir ".nf-test"
profile "test"

}

50 changes: 50 additions & 0 deletions tests/modules/local/amber/main.nf.test
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
nextflow_process {

name "Test Process AMBER"
script "modules/local/amber/main.nf"
process "AMBER"

test("AMBER testing") {

when {
params {

publish_dir_mode = "symlink"
// test_reference_data = 'https://raw.githubusercontent.com/nf-core/test-datasets/oncoanalyser/reference_data/hmftools/5.34_38--2/dna_pipeline/copy_number/'
test_sample_data = 'https://raw.githubusercontent.com/nf-core/test-datasets/oncoanalyser/sample_data/simulated_reads/wgts/markdups_bam/'

}

process {
"""
// define inputs of the process here. Example:
// input[0] = file("test-file.txt")
input[0] = [
[id: 'test',
tumor_id: 'tumor_test',
normal_id: 'normal_test'
],
file(params.test_sample_data + 'subject_a.tumor.dna.bwa-mem2_2.2.1.markdups.bam', checkIfExists: true),
file(params.test_sample_data + 'subject_a.normal.dna.bwa-mem2_2.2.1.markdups.bam', checkIfExists: true),
file(params.test_sample_data + 'subject_a.tumor.dna.bwa-mem2_2.2.1.markdups.bam.bai', checkIfExists: true),
file(params.test_sample_data + 'subject_a.normal.dna.bwa-mem2_2.2.1.markdups.bam.bai', checkIfExists: true),
]
input[1] = 38
// input[2] = file(params.test_reference_data + 'AmberGermlineSites.38.tsv.gz', checkIfExists: true)
input[2] = file("https://raw.githubusercontent.com/nf-core/test-datasets/oncoanalyser/reference_data/hmftools/5.34_38--2/dna_pipeline/copy_number/AmberGermlineSites.38.tsv.gz")
input[3] = []
"""
}
}

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

}

}
61 changes: 61 additions & 0 deletions tests/modules/local/amber/main.nf.test.snap
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
{
"AMBER testing": {
"content": [
{
"0": [
[
{
"id": "test",
"tumor_id": "tumor_test",
"normal_id": "normal_test"
},
[
"amber.version:md5,94a3ca487cc956f9eadb8de364c27b1d",
"normal_test.amber.homozygousregion.tsv:md5,d21abd62a26119eaf01ea8d1f66b9f05",
"normal_test.amber.snp.vcf.gz:md5,44f59e7c11b3b348f647e0251732acc6",
"normal_test.amber.snp.vcf.gz.tbi:md5,e4caffcadff308826156914dd6b43484",
"tumor_test.amber.baf.pcf:md5,d4015414e9ccf00ab02c818a2a99a939",
"tumor_test.amber.baf.tsv.gz:md5,7c6921d6c7742598b3e8b3f7fe8fea8d",
"tumor_test.amber.contamination.tsv:md5,6fb3d29cc2c879b1db07cc8581a8fb70",
"tumor_test.amber.contamination.vcf.gz:md5,5562d1e335c40ff733bbf751e37e541c",
"tumor_test.amber.contamination.vcf.gz.tbi:md5,a359216fecd8b0a3eada28dc683300a1",
"tumor_test.amber.qc:md5,9c502425aa5e1bf23569e1f60a32dcf1"
]
]
],
"1": [
"versions.yml:md5,f5846f28a6cd7391cccfc28a96892710"
],
"amber_dir": [
[
{
"id": "test",
"tumor_id": "tumor_test",
"normal_id": "normal_test"
},
[
"amber.version:md5,94a3ca487cc956f9eadb8de364c27b1d",
"normal_test.amber.homozygousregion.tsv:md5,d21abd62a26119eaf01ea8d1f66b9f05",
"normal_test.amber.snp.vcf.gz:md5,44f59e7c11b3b348f647e0251732acc6",
"normal_test.amber.snp.vcf.gz.tbi:md5,e4caffcadff308826156914dd6b43484",
"tumor_test.amber.baf.pcf:md5,d4015414e9ccf00ab02c818a2a99a939",
"tumor_test.amber.baf.tsv.gz:md5,7c6921d6c7742598b3e8b3f7fe8fea8d",
"tumor_test.amber.contamination.tsv:md5,6fb3d29cc2c879b1db07cc8581a8fb70",
"tumor_test.amber.contamination.vcf.gz:md5,5562d1e335c40ff733bbf751e37e541c",
"tumor_test.amber.contamination.vcf.gz.tbi:md5,a359216fecd8b0a3eada28dc683300a1",
"tumor_test.amber.qc:md5,9c502425aa5e1bf23569e1f60a32dcf1"
]
]
],
"versions": [
"versions.yml:md5,f5846f28a6cd7391cccfc28a96892710"
]
}
],
"meta": {
"nf-test": "0.9.1",
"nextflow": "24.10.0"
},
"timestamp": "2024-11-12T12:39:04.36170114"
}
}
5 changes: 5 additions & 0 deletions tests/nextflow.config
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
/*
========================================================================================
Nextflow config file for running tests
========================================================================================
*/

0 comments on commit 9268ed5

Please sign in to comment.