-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Sort inputs when creating PED-files, so the output it always the same (…
- Loading branch information
Showing
11 changed files
with
222 additions
and
71 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,67 @@ | ||
nextflow_process { | ||
|
||
name "Test Process CREATE_PEDIGREE_FILE" | ||
script "../main.nf" | ||
process "CREATE_PEDIGREE_FILE" | ||
|
||
tag "modules" | ||
tag "modules_local" | ||
tag "create_pedigree_file" | ||
|
||
test("create_pedigree_file - one sample") { | ||
|
||
when { | ||
process { | ||
""" | ||
input[0] = Channel.of( | ||
[ 'project', | ||
[ | ||
[id:'HG002.Revio', family_id:'family', paternal_id:0, maternal_id:0, sex:0, phenotype:2, project:'project', n_files:1, single_end:true] | ||
] | ||
]) | ||
""" | ||
} | ||
} | ||
|
||
then { | ||
assertAll( | ||
{ assert process.success }, | ||
{ assert snapshot( | ||
path(process.out.ped.get(0).get(1)).readLines(), | ||
process.out.versions | ||
).match() } | ||
) | ||
} | ||
} | ||
|
||
test("create_pedigree_file - multiple samples") { | ||
|
||
when { | ||
process { | ||
""" | ||
input[0] = Channel.of( | ||
[ 'test', | ||
[ | ||
[id:'HG002_Revio_AB', family_id:'FAM2', paternal_id:0, maternal_id:0, sex:0, phenotype:1, project:'test', n_files:1, single_end:true], | ||
[id:'HG002_Revio_AA', family_id:'FAM2', paternal_id:0, maternal_id:0, sex:0, phenotype:1, project:'test', n_files:1, single_end:true], | ||
[id:'HG002_Revio_B', family_id:'FAM1', paternal_id:0, maternal_id:0, sex:0, phenotype:1, project:'test', n_files:2, single_end:true], | ||
[id:'HG002_Revio_A', family_id:'FAM1', paternal_id:0, maternal_id:0, sex:0, phenotype:2, project:'test', n_files:1, single_end:true], | ||
[id:'HG002_Revio_B', family_id:'FAM1', paternal_id:0, maternal_id:0, sex:0, phenotype:1, project:'test', n_files:2, single_end:true] | ||
] | ||
]) | ||
""" | ||
} | ||
} | ||
|
||
then { | ||
assertAll( | ||
{ assert process.success }, | ||
{ assert snapshot( | ||
path(process.out.ped.get(0).get(1)).readLines(), | ||
process.out.versions | ||
).match() } | ||
) | ||
} | ||
} | ||
|
||
} |
37 changes: 37 additions & 0 deletions
37
modules/local/create_pedigree_file/tests/main.nf.test.snap
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
{ | ||
"create_pedigree_file - one sample": { | ||
"content": [ | ||
[ | ||
"#family_id\tsample_id\tfather\tmother\tsex\tphenotype", | ||
"family\tHG002.Revio\t0\t0\t0\t2" | ||
], | ||
[ | ||
"versions.yml:md5,c0d2b2d33f1c465351d65e149ae88f0c" | ||
] | ||
], | ||
"meta": { | ||
"nf-test": "0.8.4", | ||
"nextflow": "24.04.3" | ||
}, | ||
"timestamp": "2024-09-12T10:24:34.60478278" | ||
}, | ||
"create_pedigree_file - multiple samples": { | ||
"content": [ | ||
[ | ||
"#family_id\tsample_id\tfather\tmother\tsex\tphenotype", | ||
"FAM1\tHG002_Revio_A\t0\t0\t0\t2", | ||
"FAM1\tHG002_Revio_B\t0\t0\t0\t1", | ||
"FAM2\tHG002_Revio_AA\t0\t0\t0\t1", | ||
"FAM2\tHG002_Revio_AB\t0\t0\t0\t1" | ||
], | ||
[ | ||
"versions.yml:md5,c0d2b2d33f1c465351d65e149ae88f0c" | ||
] | ||
], | ||
"meta": { | ||
"nf-test": "0.8.4", | ||
"nextflow": "24.04.3" | ||
}, | ||
"timestamp": "2024-09-12T10:40:54.71628575" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.