Skip to content

Commit

Permalink
Add test case with no significant hits
Browse files Browse the repository at this point in the history
    for additive GWAS
    pipeline should success
    filtered tophits are empty
  • Loading branch information
AmstlerStephan committed Dec 15, 2023
1 parent 55572eb commit 948f694
Show file tree
Hide file tree
Showing 2 changed files with 53 additions and 2 deletions.
32 changes: 30 additions & 2 deletions tests/main.nf.test
Original file line number Diff line number Diff line change
Expand Up @@ -803,7 +803,7 @@ test("Should execute pipeline for binary trait with optional regenie params") {
rsids_filename = "$projectDir/tests/input/pipeline/rsids.tsv.gz"
annotation_min_log10p = 2
regenie_step2_optional = "--maxCatLevels 3"
outdir = "$outputDir"
outdir = "$outputDir"
}
}
then {
Expand Down Expand Up @@ -936,8 +936,36 @@ test("Should GWAS with chunking and optional step 1 param") {
assert workflow.failed
snapshot(workflow.trace).match()
}

}

}

test("Should execute GWAS with additive testig with no significant hits") {

when {

params {
project = "test-gwas-binary"
genotypes_prediction = "$projectDir/tests/input/pipeline/example.{bim,bed,fam}"
genotypes_association = "$projectDir/tests/input/pipeline/example.bgen"
genotypes_build = 'hg19'
genotypes_imputed_format = 'bgen'
phenotypes_filename = "$projectDir/tests/input/pipeline/phenotype_bin.txt"
phenotypes_columns = 'Y1,Y2'
phenotypes_binary_trait = true
regenie_test = 'additive'
outdir = "$outputDir"
rsids_filename = "$projectDir/tests/input/pipeline/rsids.tsv.gz"
annotation_min_log10p = 100
regenie_step1_optional = "--pThresh 0.01"
outdir = "$outputDir"
}
}

then {
assert workflow.success
assert snapshot(new File("$outputDir/results/tophits/Y1.regenie.filtered.gz"), new File("$outputDir/results/tophits/Y2.regenie.filtered.gz"), workflow.trace).match()
}
}

}
23 changes: 23 additions & 0 deletions tests/main.nf.test.snap
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,17 @@
],
"timestamp": "2023-12-14T17:03:22.52629"
},
"Should fail(?) because no significant hit was found": {
"content": [
"Y1.regenie.gz:md5,f80dee2e3a0f824408cfa0bf963f4a2d",
{
"tasksFailed": 0,
"tasksCount": 14,
"tasksSucceeded": 14
}
],
"timestamp": "2023-12-15T11:12:53.355508"
},
"Should execute GWAS with phenotype file in tabs format": {
"content": [
"Y1.regenie.gz:md5,3b46e913e302d59a27c87f989384a689",
Expand Down Expand Up @@ -167,6 +178,18 @@
],
"timestamp": "2023-12-14T16:41:52.068742"
},
"Should execute GWAS with additive testig with no significant hits": {
"content": [
"Y1.regenie.filtered.gz:md5,d41d8cd98f00b204e9800998ecf8427e",
"Y2.regenie.filtered.gz:md5,d41d8cd98f00b204e9800998ecf8427e",
{
"tasksFailed": 0,
"tasksCount": 14,
"tasksSucceeded": 14
}
],
"timestamp": "2023-12-15T11:19:19.183957"
},
"Should execute GWAS with header in phenotype file (custom batch size)": {
"content": [
"PHENO1.regenie.gz:md5,c03c47e1d4300277f2a445afc14c6d1e",
Expand Down

0 comments on commit 948f694

Please sign in to comment.