forked from scilus/nf-scil
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request scilus#139 from arnaudbore/migrate_topup_eddy
Migrate Topup and Eddy modules to nf-test
- Loading branch information
Showing
23 changed files
with
283 additions
and
164 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
name: "preproc_eddy" | ||
channels: | ||
- Docker | ||
- Apptainer | ||
dependencies: | ||
- "FSL" | ||
- "scilpy" |
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,61 @@ | ||
nextflow_process { | ||
|
||
name "Test Process PREPROC_EDDY" | ||
script "../main.nf" | ||
process "PREPROC_EDDY" | ||
|
||
tag "modules" | ||
tag "modules_nfcore" | ||
tag "preproc" | ||
tag "preproc/eddy" | ||
|
||
tag "subworkflows" | ||
tag "subworkflows/load_test_data" | ||
|
||
config "./nextflow.config" | ||
|
||
setup { | ||
run("LOAD_TEST_DATA", alias: "LOAD_DATA") { | ||
script "../../../../../subworkflows/nf-scil/load_test_data/main.nf" | ||
process { | ||
""" | ||
input[0] = Channel.from( [ "topup_eddy_light.zip" ] ) | ||
input[1] = "test.load-test-data" | ||
""" | ||
} | ||
} | ||
} | ||
|
||
test("eddy") { | ||
when { | ||
process { | ||
""" | ||
input[0] = LOAD_DATA.out.test_data_directory | ||
.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 }, | ||
{ 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, | ||
).match() } | ||
) | ||
} | ||
} | ||
} |
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,31 @@ | ||
{ | ||
"eddy": { | ||
"content": [ | ||
"test__dwi_corrected.nii.gz", | ||
[ | ||
[ | ||
{ | ||
"id": "test", | ||
"single_end": false | ||
}, | ||
"test__bval_eddy:md5,4c61c53078316c31b4d5daf446a3d6ac" | ||
] | ||
], | ||
"test__dwi_eddy_corrected.bvec", | ||
[ | ||
[ | ||
{ | ||
"id": "test", | ||
"single_end": false | ||
}, | ||
"test__b0_bet_mask.nii.gz:md5,fc1f94e2a5e2cf5197d7fdc28a83ca28" | ||
] | ||
] | ||
], | ||
"meta": { | ||
"nf-test": "0.8.4", | ||
"nextflow": "23.10.1" | ||
}, | ||
"timestamp": "2024-04-29T16:11:13.561798" | ||
} | ||
} |
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,2 @@ | ||
preproc/eddy: | ||
- "modules/nf-scil/preproc/eddy/**" |
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,7 @@ | ||
name: "preproc_topup" | ||
channels: | ||
- Docker | ||
- Apptainer | ||
dependencies: | ||
- "FSL" | ||
- "scilpy" |
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,62 @@ | ||
nextflow_process { | ||
|
||
name "Test Process PREPROC_TOPUP" | ||
script "../main.nf" | ||
process "PREPROC_TOPUP" | ||
|
||
tag "modules" | ||
tag "modules_nfcore" | ||
tag "preproc" | ||
tag "preproc/topup" | ||
|
||
tag "subworkflows" | ||
tag "subworkflows/load_test_data" | ||
|
||
config "./nextflow.config" | ||
|
||
setup { | ||
run("LOAD_TEST_DATA", alias: "LOAD_DATA") { | ||
script "../../../../../subworkflows/nf-scil/load_test_data/main.nf" | ||
process { | ||
""" | ||
input[0] = Channel.from( [ "topup_eddy_light.zip" ] ) | ||
input[1] = "test.load-test-data" | ||
""" | ||
} | ||
} | ||
} | ||
|
||
test("topup") { | ||
when { | ||
process { | ||
""" | ||
input[0] = LOAD_DATA.out.test_data_directory | ||
.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-AP_sbref.nii.gz", 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_dir-PA_sbref.nii.gz", checkIfExists: true)]} | ||
input[1] = [] | ||
""" | ||
} | ||
} | ||
|
||
then { | ||
assertAll( | ||
{ assert process.success }, | ||
{ assert snapshot( | ||
file(process.out.topup_corrected_b0s.get(0).get(1)).name, | ||
file(process.out.topup_fieldcoef.get(0).get(1)).name, | ||
file(process.out.topup_movpart.get(0).get(1)).name, | ||
file(process.out.rev_b0_warped.get(0).get(1)).name, | ||
process.out.rev_b0_mean, | ||
process.out.b0_mean).match() } | ||
) | ||
} | ||
} | ||
} |
Oops, something went wrong.