Skip to content

Commit

Permalink
Additional tests for tumor-only mode
Browse files Browse the repository at this point in the history
  • Loading branch information
rhassaine committed Feb 4, 2025
1 parent 8552a82 commit a8d5e94
Show file tree
Hide file tree
Showing 2 changed files with 80 additions and 43 deletions.
76 changes: 34 additions & 42 deletions tests/modules/local/amber/main.nf.test
Original file line number Diff line number Diff line change
Expand Up @@ -61,49 +61,41 @@ nextflow_process {

}

// test("AMBER with tumor only") {
// when {
// params {
// // publish_dir_mode = "symlink"
// test_sample_data = 'https://raw.githubusercontent.com/nf-core/test-datasets/oncoanalyser/sample_data/simulated_reads/wgts/markdups_bam/'
// }
// process {
// """
// input[0] = [
// [id: 'test', tumor_id: 'tumor_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.tumor.dna.bwa-mem2_2.2.1.markdups.bam.bai', checkIfExists: true),
// []
// ]
// input[1] = 38
// input[2] = file("/home/rhassaine/resource_files_oa/38/results/reference_data/1.0.0/20250203_101759/hmf_data_5.34_38--2/dna_pipeline/copy_number/AmberGermlineSites.38.tsv.gz")
// input[3] = []
// """
// }
// }
test("AMBER with tumor only") {
when {
params {
// publish_dir_mode = "symlink"
test_sample_data = 'https://raw.githubusercontent.com/nf-core/test-datasets/oncoanalyser/sample_data/simulated_reads/wgts/markdups_bam/'
}
process {
"""
input[0] = [
[id: 'test', tumor_id: 'tumor_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.tumor.dna.bwa-mem2_2.2.1.markdups.bam.bai', checkIfExists: true),
[]
]
input[1] = 38
input[2] = file("/home/rhassaine/resource_files_oa/38/results/reference_data/1.0.0/20250203_101759/hmf_data_5.34_38--2/dna_pipeline/copy_number/AmberGermlineSites.38.tsv.gz")
input[3] = []
"""
}
}

// then {
// // assert process.success
// // assert snapshot(process.out).match()
// def amber_output_dir = process.out.amber_dir[0][1]
then {
def amber_output_dir = process.out.amber_dir[0][1]

// assertAll(
// { assert process.success },
// { assert snapshot(process.out).match() },
// { assert path(amber_output_dir).resolve("amber.version").exists() },
// { assert path(amber_output_dir).resolve("normal_test.amber.homozygousregion.tsv").exists() },
// { assert path(amber_output_dir).resolve("normal_test.amber.snp.vcf.gz").exists() },
// { assert path(amber_output_dir).resolve("normal_test.amber.snp.vcf.gz.tbi").exists() },
// { assert path(amber_output_dir).resolve("tumor_test.amber.baf.pcf").exists() },
// { assert path(amber_output_dir).resolve("tumor_test.amber.baf.tsv.gz").exists() },
// { assert path(amber_output_dir).resolve("tumor_test.amber.contamination.tsv").exists() },
// { assert path(amber_output_dir).resolve("tumor_test.amber.contamination.vcf.gz").exists() },
// { assert path(amber_output_dir).resolve("tumor_test.amber.contamination.vcf.gz.tbi").exists() },
// { assert path(amber_output_dir).resolve("tumor_test.amber.qc").exists() },
// { assert path(process.out.versions[0]).exists() }
// )
// }
// }
assertAll(
{ assert process.success },
{ assert snapshot(process.out).match() },
{ assert path(amber_output_dir).resolve("amber.version").exists() },
{ assert path(amber_output_dir).resolve("tumor_test.amber.baf.pcf").exists() },
{ assert path(amber_output_dir).resolve("tumor_test.amber.baf.tsv.gz").exists() },
{ assert path(amber_output_dir).resolve("tumor_test.amber.qc").exists() },
{ assert path(process.out.versions[0]).exists() }
)
}
}

}
47 changes: 46 additions & 1 deletion tests/modules/local/amber/main.nf.test.snap
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,51 @@
"nf-test": "0.9.2",
"nextflow": "24.10.4"
},
"timestamp": "2025-02-03T16:00:40.195219282"
"timestamp": "2025-02-04T08:41:54.940934927"
},
"AMBER with tumor only": {
"content": [
{
"0": [
[
{
"id": "test",
"tumor_id": "tumor_test"
},
[
"amber.version:md5,94a3ca487cc956f9eadb8de364c27b1d",
"tumor_test.amber.baf.pcf:md5,5b42f5fac4df8e88a1605943beda9eda",
"tumor_test.amber.baf.tsv.gz:md5,938d30b5bd65598a4efc2b5c01f89ce1",
"tumor_test.amber.qc:md5,9547e68ba672e08d6bd49e1e6f654ee8"
]
]
],
"1": [
"versions.yml:md5,f5846f28a6cd7391cccfc28a96892710"
],
"amber_dir": [
[
{
"id": "test",
"tumor_id": "tumor_test"
},
[
"amber.version:md5,94a3ca487cc956f9eadb8de364c27b1d",
"tumor_test.amber.baf.pcf:md5,5b42f5fac4df8e88a1605943beda9eda",
"tumor_test.amber.baf.tsv.gz:md5,938d30b5bd65598a4efc2b5c01f89ce1",
"tumor_test.amber.qc:md5,9547e68ba672e08d6bd49e1e6f654ee8"
]
]
],
"versions": [
"versions.yml:md5,f5846f28a6cd7391cccfc28a96892710"
]
}
],
"meta": {
"nf-test": "0.9.2",
"nextflow": "24.10.4"
},
"timestamp": "2025-02-04T08:42:14.429643438"
}
}

0 comments on commit a8d5e94

Please sign in to comment.