Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
29 changes: 22 additions & 7 deletions assets/multiqc_config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,18 +3,23 @@ report_comment: >
analysis pipeline.

report_section_order:
pre_qc_rgb:
framewise_displacement:
order: -200
pre_qc_sampling_mqc:
pre_qc_rgb:
order: -300
registration_qc:
pre_qc_sampling_mqc:
order: -500
dti_qc:
registration_qc:
order: -600
dti_qc:
order: -700
tracking_mask_qc:
order: -700
order: -800
tracking_qc:
order: -800
order: -900

module_order:
- framewise_displacement

custom_data:
pre_qc_rgb:
Expand Down Expand Up @@ -78,6 +83,8 @@ custom_data:
plot_type: "image"

sp:
framewise_displacement:
fn: "*dwi_eddy_restricted_movement_rms.txt"
pre_qc_rgb:
fn: "*rgb_mqc.png"
pre_qc_sampling_mqc:
Expand All @@ -89,4 +96,12 @@ sp:
tracking_mask_qc:
fn: "*_mask_tracking_mqc.png"
tracking_qc:
fn: "*local_tracking_mqc.png"
fn: "*local_tracking_mqc.png"

# Customisable module parameters
framewise_displacement:
warn_threshold: 0.05
fail_threshold: 0.12
unit: "µm"

export_plots: true
6 changes: 4 additions & 2 deletions main.nf
Original file line number Diff line number Diff line change
Expand Up @@ -145,6 +145,7 @@ workflow {
ch_after_eddy = PREPROC_SINGLEEDDY.out.dwi_corrected.join(
PREPROC_SINGLEEDDY.out.bval_corrected).join(
PREPROC_SINGLEEDDY.out.bvec_corrected)
ch_multiqc_files = ch_multiqc_files.mix(PREPROC_SINGLEEDDY.out.eddy_fd_mqc)
}
else {
ch_after_eddy = ch_eddy
Expand All @@ -160,8 +161,9 @@ workflow {
}
else {
ch_nnunet = ch_after_eddy.join(UTILS_EXTRACTB0.out.b0)
.map { meta, dwi, bval, bvec, b0 ->
[meta, dwi, bval, b0 ?: [ ]]}
.join(data.mask, by: 0, remainder: true)
.map { meta, dwi, bval, bvec, b0, mask ->
[meta, dwi, bval, b0, mask ?: [ ]]}

NNUNET(ch_nnunet)

Expand Down
2 changes: 1 addition & 1 deletion modules.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
"nf-core": {
"multiqc": {
"branch": "master",
"git_sha": "e10b76ca0c66213581bec2833e30d31f239dec0b",
"git_sha": "98403d15b0e50edae1f3fec5eae5e24982f1fade",
"installed_by": ["modules"]
}
}
Expand Down
14 changes: 9 additions & 5 deletions modules/local/preproc/singleeddy/main.nf
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,11 @@ process PREPROC_SINGLEEDDY {
input:
tuple val(meta), path(dwi), path(bval), path(bvec)
output:
tuple val(meta), path("*__dwi_eddy_corrected.nii.gz") , emit: dwi_corrected
tuple val(meta), path("*__dwi_eddy_corrected.bval") , emit: bval_corrected
tuple val(meta), path("*__dwi_eddy_corrected.bvec") , emit: bvec_corrected
path "versions.yml" , emit: versions
tuple val(meta), path("*__dwi_eddy_corrected.nii.gz") , emit: dwi_corrected
tuple val(meta), path("*__dwi_eddy_corrected.bval") , emit: bval_corrected
tuple val(meta), path("*__dwi_eddy_corrected.bvec") , emit: bvec_corrected
tuple val(meta), path("*__dwi_eddy_restricted_movement_rms.txt") , emit: eddy_fd_mqc, optional:true
path "versions.yml" , emit: versions

when:
task.ext.when == null || task.ext.when
Expand Down Expand Up @@ -42,9 +43,11 @@ process PREPROC_SINGLEEDDY {

echo "--nthr=$extra_thr --very_verbose $extra_args --niter=$extra_ite" >> eddy.sh
sh eddy.sh
mv ${prefix}__.nii.gz ${prefix}__dwi_eddy_corrected.nii.gz
mv ${prefix}__.nii.gz ${prefix}__dwi_eddy_corrected.nii.gz
mv ${prefix}__.eddy_rotated_bvecs ${prefix}__dwi_eddy_corrected.bvec
mv ${bval} ${prefix}__dwi_eddy_corrected.bval
mv ${prefix}__.eddy_restricted_movement_rms ${prefix}__dwi_eddy_restricted_movement_rms.txt


cat <<-END_VERSIONS > versions.yml
"${task.process}":
Expand All @@ -63,6 +66,7 @@ process PREPROC_SINGLEEDDY {
touch ${prefix}__dwi_eddy_corrected.nii.gz
touch ${prefix}__dwi_eddy_corrected.bval
touch ${prefix}__dwi_eddy_corrected.bvec
touch ${prefix}__dwi_eddy_restricted_movement_rms.txt

cat <<-END_VERSIONS > versions.yml
"${task.process}":
Expand Down
9 changes: 9 additions & 0 deletions modules/local/preproc/singleeddy/meta.yml
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,15 @@ output:
description: B-vectors corrected in FSL format
pattern: "*__dwi_eddy_corrected.bvec"

- eddy_fd_mqc:
- "*__dwi_eddy_restricted_movement_rms.txt":
type: file
description: |
Text file containing framewise displacement (restricted movement)
information from eddy. Made for use in MultiQC report.
pattern: "*__dwi_eddy_restricted_movement_rms.txt"
ontologies: []

- versions:
type: file
description: File containing software versions
Expand Down
Loading
Loading