Skip to content

Commit

Permalink
add test eddy full
Browse files Browse the repository at this point in the history
  • Loading branch information
ThoumyreStanislas committed Oct 31, 2024
1 parent 8ff0ada commit 6704412
Show file tree
Hide file tree
Showing 2 changed files with 73 additions and 3 deletions.
44 changes: 41 additions & 3 deletions modules/nf-neuro/preproc/eddy/tests/main.nf.test
Original file line number Diff line number Diff line change
Expand Up @@ -19,21 +19,22 @@ nextflow_process {
script "../../../../../subworkflows/nf-neuro/load_test_data/main.nf"
process {
"""
input[0] = Channel.from( [ "raw_DWIss1000-dir32.zip", "TOPUP.zip" ] )
input[0] = Channel.from( [ "raw_DWIss1000-dir32.zip", "TOPUP.zip", "topup_eddy_light.zip" ] )
input[1] = "test.load-test-data"
"""
}
}
}

test("eddy") {
test("eddy_light") {
when {
process {
"""
ch_split_test_data = LOAD_DATA.out.test_data_directory
.branch{
raw_dwi: it.simpleName == "raw_DWIss1000-dir32"
topup_results: it.SimpleName == "TOPUP"
rev_dwi: it.simpleName == "topup_eddy_light.zip"
}
ch_raw_dwi = ch_split_test_data.raw_dwi
.map{ test_data_directory -> [
Expand All @@ -50,12 +51,49 @@ nextflow_process {
file("\${test_data_directory}/topup_corrected_b0s.nii.gz", checkIfExists: true),
file("\${test_data_directory}/topup_fieldcoef.nii.gz", checkIfExists: true),
file("\${test_data_directory}/topup_movpar.txt", checkIfExists: true)]}

input[0] = ch_raw_dwi.join(ch_topup)
"""
}
}
then {
assertAll(
{ assert process.success },
{ assert snapshot(
file(process.out.dwi_corrected.get(0).get(1)).name,
process.out.bval_corrected,
file(process.out.bvec_corrected.get(0).get(1)).name,
process.out.b0_mask,
process.out.versions
).match() }
)
}
}

test("eddy_full") {
when {
process {
"""
ch_split_test_data = LOAD_DATA.out.test_data_directory
.branch{
raw_dwi: it.simpleName == "raw_DWIss1000-dir32"
topup_results: it.SimpleName == "TOPUP"
rev_dwi: it.simpleName == "topup_eddy_light.zip"
}
input[0] = ch_split_test_data.rev_dwi
.map{ test_data_directory -> [
[ id:'test', single_end:false ], // meta map
file("\${test_data_directory}/sub-01_dir-AP_dwi.nii.gz", checkIfExists: true),
file("\${test_data_directory}/sub-01_dir-AP_dwi.bval", checkIfExists: true),
file("\${test_data_directory}/sub-01_dir-AP_dwi.bvec", checkIfExists: true),
file("\${test_data_directory}/sub-01_dir-PA_dwi.nii.gz", checkIfExists: true),
file("\${test_data_directory}/sub-01_dir-PA_dwi.bval", checkIfExists: true),
file("\${test_data_directory}/sub-01_dir-PA_dwi.bvec", checkIfExists: true),
file("\${test_data_directory}/sub-01__corrected_b0s.nii.gz", checkIfExists: true),
file("\${test_data_directory}/topup_results_fieldcoef.nii.gz", checkIfExists: true),
file("\${test_data_directory}/topup_results_movpar.txt", checkIfExists: true)]}
"""
}
}
then {
assertAll(
{ assert process.success },
Expand Down
32 changes: 32 additions & 0 deletions modules/nf-neuro/preproc/eddy/tests/main.nf.test.snap
Original file line number Diff line number Diff line change
@@ -1,4 +1,36 @@
{
"eddy_light": {
"content": [
"test__dwi_corrected.nii.gz",
[
[
{
"id": "test",
"single_end": false
},
"test__bval_eddy:md5,7995daabbd74fcf7c365a39a779f67e9"
]
],
"test__dwi_eddy_corrected.bvec",
[
[
{
"id": "test",
"single_end": false
},
"test__b0_bet_mask.nii.gz:md5,2dd16e0c664c910f1970b96056866fea"
]
],
[
"versions.yml:md5,137e3ce0fd25e5b16de2d8cc5a5aefca"
]
],
"meta": {
"nf-test": "0.9.0",
"nextflow": "24.04.4"
},
"timestamp": "2024-10-31T13:17:58.524376706"
},
"eddy": {
"content": [
"test__dwi_corrected.nii.gz",
Expand Down

0 comments on commit 6704412

Please sign in to comment.