-
Notifications
You must be signed in to change notification settings - Fork 753
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Added nf-test for somalier/ancestry #7380
base: master
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change | ||||||
---|---|---|---|---|---|---|---|---|
@@ -0,0 +1,90 @@ | ||||||||
nextflow_process { | ||||||||
|
||||||||
name "Test Process SOMALIER_ANCESTRY" | ||||||||
config "./nextflow.test.config" | ||||||||
script "../main.nf" | ||||||||
process "SOMALIER_ANCESTRY" | ||||||||
|
||||||||
tag "modules" | ||||||||
tag "modules_nfcore" | ||||||||
tag "somalier" | ||||||||
tag "somalier/extract" | ||||||||
tag "somalier/ancestry" | ||||||||
tag "untar" | ||||||||
|
||||||||
setup { | ||||||||
run("UNTAR") { | ||||||||
script "../../../untar/main.nf" | ||||||||
params { | ||||||||
module_args = "--wildcards '*.somalier'" | ||||||||
} | ||||||||
|
||||||||
process { | ||||||||
""" | ||||||||
labelled_somalier_tar = file("https://zenodo.org/record/3479773/files/1kg.somalier.tar.gz") | ||||||||
input[0] = [[id:"1kg"],labelled_somalier_tar] | ||||||||
Comment on lines
+24
to
+25
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||||
""" | ||||||||
} | ||||||||
} | ||||||||
} | ||||||||
|
||||||||
test("test_somalier_ancestry") { | ||||||||
|
||||||||
when { | ||||||||
params { | ||||||||
module_args = '' | ||||||||
} | ||||||||
process { | ||||||||
""" | ||||||||
whole_genome_sommalier = file("https://github.com/nf-core/test-datasets/raw/modules/data/delete_me/somalier/whole_genome.somalier", checkIfExists: true) | ||||||||
labels = file("https://github.com/brentp/somalier/raw/73db124d3fe9febe3a53787707554f863595b48f/scripts/ancestry-labels-1kg.tsv", checkIfExists: true) | ||||||||
Comment on lines
+39
to
+40
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. these probably need to be moved from delete_me and also both to the test_datasets repo |
||||||||
|
||||||||
ch_labels = Channel.of([[id:"1kg"], labels]) | ||||||||
ch_whole_genome_somalier = Channel.of([[id:"test"], whole_genome_sommalier]) | ||||||||
|
||||||||
input[0] = Channel.of([[id:"test"],whole_genome_sommalier]) | ||||||||
input[1] = ch_labels.join(UNTAR.out.untar) | ||||||||
""" | ||||||||
} | ||||||||
} | ||||||||
then { | ||||||||
assertAll( | ||||||||
{ assert process.success }, | ||||||||
{ assert snapshot( | ||||||||
path(process.out.tsv[0][1]).text.contains('AFR AFR'), | ||||||||
path(process.out.html[0][1]).text.contains('"ancestry_label":"AMR"'), | ||||||||
process.out.versions | ||||||||
).match() | ||||||||
} | ||||||||
) | ||||||||
} | ||||||||
} | ||||||||
|
||||||||
|
||||||||
test("test_somalier_ancestry -- stub") { | ||||||||
options '-stub' | ||||||||
when { | ||||||||
params { | ||||||||
module_args = '' | ||||||||
} | ||||||||
process { | ||||||||
""" | ||||||||
whole_genome_sommalier = file("https://github.com/nf-core/test-datasets/raw/modules/data/delete_me/somalier/whole_genome.somalier", checkIfExists: true) | ||||||||
labels = file("https://github.com/brentp/somalier/raw/73db124d3fe9febe3a53787707554f863595b48f/scripts/ancestry-labels-1kg.tsv", checkIfExists: true) | ||||||||
|
||||||||
ch_labels = Channel.of([[id:"1kg"], labels]) | ||||||||
ch_whole_genome_somalier = Channel.of([[id:"test"], whole_genome_sommalier]) | ||||||||
|
||||||||
input[0] = Channel.of([[id:"test"],whole_genome_sommalier]) | ||||||||
input[1] = ch_labels.join(UNTAR.out.untar) | ||||||||
""" | ||||||||
} | ||||||||
} | ||||||||
then { | ||||||||
assertAll( | ||||||||
{ assert process.success }, | ||||||||
{ assert snapshot(process.out).match() } | ||||||||
) | ||||||||
} | ||||||||
} | ||||||||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,65 @@ | ||
{ | ||
"test_somalier_ancestry": { | ||
"content": [ | ||
true, | ||
true, | ||
[ | ||
"versions.yml:md5,75c0cd29fd1bf99528a819954cff93c6" | ||
] | ||
], | ||
"meta": { | ||
"nf-test": "0.9.0", | ||
"nextflow": "24.10.3" | ||
}, | ||
"timestamp": "2025-01-28T09:39:02.833629" | ||
}, | ||
"test_somalier_ancestry -- stub": { | ||
"content": [ | ||
{ | ||
"0": [ | ||
[ | ||
{ | ||
"id": "test" | ||
}, | ||
"somalier-ancestry.somalier-ancestry.tsv:md5,d41d8cd98f00b204e9800998ecf8427e" | ||
] | ||
], | ||
"1": [ | ||
[ | ||
{ | ||
"id": "test" | ||
}, | ||
"somalier-ancestry.somalier-ancestry.html:md5,d41d8cd98f00b204e9800998ecf8427e" | ||
] | ||
], | ||
"2": [ | ||
"versions.yml:md5,75c0cd29fd1bf99528a819954cff93c6" | ||
], | ||
"html": [ | ||
[ | ||
{ | ||
"id": "test" | ||
}, | ||
"somalier-ancestry.somalier-ancestry.html:md5,d41d8cd98f00b204e9800998ecf8427e" | ||
] | ||
], | ||
"tsv": [ | ||
[ | ||
{ | ||
"id": "test" | ||
}, | ||
"somalier-ancestry.somalier-ancestry.tsv:md5,d41d8cd98f00b204e9800998ecf8427e" | ||
] | ||
], | ||
"versions": [ | ||
"versions.yml:md5,75c0cd29fd1bf99528a819954cff93c6" | ||
] | ||
} | ||
], | ||
"meta": { | ||
"nf-test": "0.9.0", | ||
"nextflow": "24.10.3" | ||
}, | ||
"timestamp": "2025-01-28T09:41:31.001304" | ||
} | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
process { | ||
|
||
withName: "UNTAR" { | ||
ext.args2 = params.module_args | ||
} | ||
} |
This file was deleted.
This file was deleted.
This file was deleted.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
removed because it cannot be used?