diff --git a/main.nf b/main.nf index 6eeea69..4d55601 100644 --- a/main.nf +++ b/main.nf @@ -57,6 +57,7 @@ workflow get_data { workflow { + log.warn('During the first execution, nf-mouse may take some time to download the necessary modules.') log.info("Uses GPU: $params.use_gpu") // Define channel for multiqc files ch_multiqc_files = Channel.empty() diff --git a/modules/local/mouse/preqc/main.nf b/modules/local/mouse/preqc/main.nf index 435605d..2170f4e 100644 --- a/modules/local/mouse/preqc/main.nf +++ b/modules/local/mouse/preqc/main.nf @@ -20,12 +20,16 @@ process PRE_QC { script: def prefix = task.ext.prefix ?: "${meta.id}" def b0_threshold = task.ext.b0_thr_extract_b0 ? "--b0_threshold $task.ext.b0_thr_extract_b0" : "" + def threshold = task.ext.b0_thr_extract_b0 ? "$task.ext.b0_thr_extract_b0" : "" """ echo "This module is highly experimental" echo "Be careful with the output." echo "" + # Fetch b-values. + awk -v thr=${threshold} '{for(i=1;i<=NF;i++) if(\$i < thr) \$i=0.0; else \$i=int(\$i*10+(\$i>=0?0.5:-0.5))/10; print}' $bval > ${prefix}__stride_dwi.bval + # Fetch strides. strides=\$(mrinfo $dwi -strides) # Compare strides @@ -36,7 +40,6 @@ process PRE_QC { mrconvert $dwi ${prefix}__stride_dwi.nii.gz -strides 1,2,3,4 scil_gradients_modify_axes.py $bvec ${prefix}__stride_dwi.bvec -1 2 3 - cp $bval ${prefix}__stride_dwi.bval elif [ "\$strides" == "1 -2 3 4" ]; then echo "Strides are not (1,2,3,4), converting to 1,2,3,4." @@ -45,17 +48,14 @@ process PRE_QC { mrconvert $dwi ${prefix}__stride_dwi.nii.gz -strides 1,2,3,4 cp $bvec ${prefix}__stride_dwi.bvec - cp $bval ${prefix}__stride_dwi.bval elif [ "\$strides" == "1 2 3 4" ]; then echo "Strides are already 1,2,3,4" cp $dwi ${prefix}__stride_dwi.nii.gz - cp $bval ${prefix}__stride_dwi.bval cp $bvec ${prefix}__stride_dwi.bvec else echo "Strides are: \$strides" echo "There is no automatic way to transform to 1,2,3,4." - cp $bval ${prefix}__stride_dwi.bval cp $bvec ${prefix}__stride_dwi.bvec fi