Thanks to visit codestin.com
Credit goes to github.com

Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,5 @@ results/
testing/
testing*
*.pyc
null/
.nf-test*
.nf-test/
9 changes: 9 additions & 0 deletions nf-test.config
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
config {

testsDir "tests"
workDir ".nf-test"
configFile "tests/nextflow.config"
profile "docker"
options "-dump-channels"

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

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

test("AMBER testing tumor + normal") {

when {
params {
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 // ref_genome_version
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 {
// stable_name: All files + folders in ${params.outdir}/ with a stable name
// def stable_name = getAllFilesFromDir(params.outdir, relative: true, includeDir: true, ignore: ['pipeline_info/*.{html,json,txt}'])
// assert process.success
// assert snapshot(process.out).match()
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() }
)
}

}

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 {
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("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() }
)
}
}

}
106 changes: 106 additions & 0 deletions tests/modules/local/amber/main.nf.test.snap
Original file line number Diff line number Diff line change
@@ -0,0 +1,106 @@
{
"AMBER testing tumor + normal": {
"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.2",
"nextflow": "24.10.4"
},
"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"
}
}
88 changes: 88 additions & 0 deletions tests/modules/local/cobalt/main.nf.test
Original file line number Diff line number Diff line change
@@ -0,0 +1,88 @@
nextflow_process {

name "Test Process COBALT"
script "modules/local/cobalt/main.nf"
process "COBALT"

test("COBALT testing tumor + normal") {

when {
params {
test_sample_data = 'https://raw.githubusercontent.com/nf-core/test-datasets/oncoanalyser/sample_data/simulated_reads/wgts/markdups_bam/'// define parameters here. Example:
}
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] = 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/GC_profile.1000bp.38.cnp")
input[2] = []
input[3] = []
"""
}
}

then {
def cobalt_output_dir = process.out.cobalt_dir[0][1]
assertAll(
{ assert process.success },
{ assert snapshot(process.out).match() },
{ assert path(cobalt_output_dir).resolve("cobalt.version").exists() },
{ assert path(cobalt_output_dir).resolve("tumor_test.cobalt.gc.median.tsv").exists() },
{ assert path(cobalt_output_dir).resolve("tumor_test.cobalt.ratio.pcf").exists() },
{ assert path(cobalt_output_dir).resolve("tumor_test.cobalt.ratio.tsv.gz").exists() },
{ assert path(cobalt_output_dir).resolve("normal_test.cobalt.gc.median.tsv").exists() },
{ assert path(cobalt_output_dir).resolve("normal_test.cobalt.ratio.median.tsv").exists() },
{ assert path(cobalt_output_dir).resolve("normal_test.cobalt.ratio.pcf").exists() },
{ assert path(process.out.versions[0]).exists() }
)
}

}

test("COBALT 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] = 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/GC_profile.1000bp.38.cnp")
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/DiploidRegions.38.bed.gz")
input[3] = []
"""
}
}

then {
def cobalt_output_dir = process.out.cobalt_dir[0][1]
assertAll(
{ assert process.success },
{ assert snapshot(process.out).match() },
{ assert path(cobalt_output_dir).resolve("cobalt.version").exists() },
{ assert path(cobalt_output_dir).resolve("tumor_test.cobalt.gc.median.tsv").exists() },
{ assert path(cobalt_output_dir).resolve("tumor_test.cobalt.ratio.pcf").exists() },
{ assert path(cobalt_output_dir).resolve("tumor_test.cobalt.ratio.tsv.gz").exists() },
{ assert path(process.out.versions[0]).exists() }
)
}
}
}
Loading
Loading