Skip to content
Open
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
1 change: 1 addition & 0 deletions main.nf
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down
8 changes: 4 additions & 4 deletions modules/local/mouse/preqc/main.nf
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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."
Expand All @@ -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

Expand Down