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
5 changes: 5 additions & 0 deletions assets/multiqc_config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,11 @@ custom_data:
description: |
RGB map from RAW data versus RGB map after gradient correction. Corpus callosum should be in red.
### **Using the option use_preqc is highly experimental. Please be careful.**
<div style="background-color: #ffcccc; color: red; padding: 10px; border: 2px solid red;">
Be careful: If the colours match the reference image, it is important to ALSO look at the
eigenvectors of the tensors from the DTI model located in the folder (<code>dwi/sub-01_model-tensor_param-v1_dwimap.nii.gz</code>)
to ensure that the orientation is correct (see <a href="https://scilus.github.io/nf-mouse/guides/faq/" target="_blank">FAQ</a>).
</div>
plot_type: "image"

pre_qc_sampling_mqc:
Expand Down
Binary file modified assets/nf-mouse-light-logo.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/reference_rgb_mqc.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
7 changes: 5 additions & 2 deletions main.nf
Original file line number Diff line number Diff line change
Expand Up @@ -49,10 +49,12 @@ workflow get_data {
mask_channel = Channel.fromPath("$input/**/*mask.nii.gz")
.map { mask_file -> def sid = mask_file.parent.name
[[id: sid], mask_file] }
template_channel = Channel.fromPath("$projectDir/assets/reference_rgb_mqc.png")

emit:
dwi = dwi_channel
mask = mask_channel
template_rgb = template_channel
}

workflow {
Expand All @@ -77,9 +79,10 @@ workflow {
bval: [meta, bval]
bvec: [meta, bvec]
}
ch_ref_rgb = data.template_rgb

if ( params.run_preqc ) {
PRE_QC(ch_dwi_bvalbvec.dwi.join(ch_dwi_bvalbvec.bvs_files))
PRE_QC(ch_dwi_bvalbvec.dwi.join(ch_dwi_bvalbvec.bvs_files).combine(ch_ref_rgb))
ch_multiqc_files = ch_multiqc_files.mix(PRE_QC.out.rgb_mqc)
ch_multiqc_files = ch_multiqc_files.mix(PRE_QC.out.sampling_mqc)
if (params.use_preqc){
Expand Down Expand Up @@ -222,5 +225,5 @@ workflow {
return tuple(meta, files)
}

MULTIQC(ch_multiqc_files, [], ch_multiqc_config.toList(), [], channel.fromPath("${projectDir}/assets/logo_bg.png").toList(), [], [])
MULTIQC(ch_multiqc_files, [], ch_multiqc_config.toList(), [], channel.fromPath("${projectDir}/assets/nf-mouse-light-logo.png").toList(), [], [])
}
6 changes: 3 additions & 3 deletions modules/local/mouse/preqc/main.nf
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ process PRE_QC {
container "scilus/scilus:2.2.0"

input:
tuple val(meta), path(dwi), path(bval), path(bvec)
tuple val(meta), path(dwi), path(bval), path(bvec), path(ref_rgb)

output:
tuple val(meta), path("*__stride_dwi.nii.gz") , emit: dwi
Expand Down Expand Up @@ -115,11 +115,11 @@ process PRE_QC {
${prefix}__sag_slice_\${mid_slice_sagittal}.png \
${prefix}_rgb_\${p}_mqc.png

convert -annotate +20+230 "RGB \${p}" -fill white -pointsize 30 ${prefix}_rgb_\${p}_mqc.png ${prefix}_rgb_\${p}_mqc.png
convert -annotate +20+40 "RGB \${p}" -fill white -pointsize 30 -undercolor black ${prefix}_rgb_\${p}_mqc.png ${prefix}_rgb_\${p}_mqc.png

rm -rf *_slice_*png
done
convert -append ${prefix}_rgb_pre_mqc.png ${prefix}_rgb_post_mqc.png ${prefix}__rgb_mqc.png
convert -append ${prefix}_rgb_pre_mqc.png ${prefix}_rgb_post_mqc.png $ref_rgb ${prefix}__rgb_mqc.png

cat <<-END_VERSIONS > versions.yml
"${task.process}":
Expand Down