Dual regression on HPC

Hello, i am trying to do a dual regression on HPC, but it’s not working. Each time it seems to work but I don’t have any output.

Here is my code:

module load GCC/8.3.0

module load OpenMPI/3.1.4

module load FSL/6.0.3-Python-3.7.4

\# The melodic output

MELODIC_IC="/home/users/l/lemarec4/data_ICA/GroupICA_T0_T1.ica/melodic_IC.nii.gz"

\# Output directory for dual regression results

RESULTS_DIR="/home/users/l/lemarec4/Results_dualreg"

\# Must be the SAME list (same order) used for MELODIC

INPUT_LIST="/home/users/l/lemarec4/data_ICA/inputs_4_ica.txt"

\# Perform thresholded dual regression to obtain unbiased timeseries for connectomics analyses (e.g., with FSLnets)

THR_FLAG="--thr"

mkdir -p "${RESULTS_DIR}"

\# ---------------------------

\# 3) Run Dual Regression (Stages 1 & 2 only)

\# ---------------------------

\# Arguments: <groupICs> <des_norm> <design.mat> <design.con> <n_perm> <outdir> <subjects...>

\# Here: "0 -1 0" means: no group-level stage 3 here (stages 1 & 2 only)

echo "Running dual_regression on inputs from: ${INPUT_LIST}"

srun dual_regression   "${MELODIC_IC}"   0 -1 0 ${THR_FLAG}   "${RESULTS_DIR}"   \`cat "${INPUT_LIST}"\`

echo "Done. Main outputs:"

echo " - ${RESULTS_DIR}/dr_stage1/ (time courses)"

echo " - ${RESULTS_DIR}/dr_stage2_icXXXX.nii.gz (subject spatial maps per IC)"

Can you help me ?
Thank you so much !

Dear @Faustine.Lemarechal

Please try with the latest version, this one is very old.

ml GCC/10.3.0  OpenMPI/4.1.1 FSL/6.0.5.1

Which command do you use to start your job?

Hello, thank you so much for your help. But it didn’t work even with your advices. It seems that BAOBAB does not include fsl_sub which the script includes. There is my script:

#!/bin/bash

#SBATCH --time=10:00:00               # NOTE: likely longer than generally needed 

#SBATCH --ntasks 1

#SBATCH --cpus-per-task=16

#SBATCH --partition=shared-cpu

\# Outputs ----------------------------------

#SBATCH --output log/%x-%A-%a.out

#SBATCH --error log/%x-%A-%a.err

#SBATCH --mail-user=faustine.lemarech@hes-so.ch

#SBATCH --mail-type=ALL

\# ------------------------------------------



\# ---------------------------

\# USER PARAMETERS TO EDIT

\# ---------------------------

MELODIC_IC="/home/users/l/lemarec4/data_ICA/GroupICA_T0_T1.ica/melodic_IC.nii.gz"

RESULTS_DIR="/home/users/l/lemarec4/Results_dualreg"

INPUT_LIST="/home/users/l/lemarec4/data_ICA/inputs_4_ica.txt"

THR_FLAG="--thr"



\# Crée le dossier de sortie si nécessaire

mkdir -p "${RESULTS_DIR}"



\# ---------------------------

\# Load FSL (Baobab modules)

\# ---------------------------

ml purge

ml GCC/10.3.0 OpenMPI/4.1.1 FSL/6.0.5.1



\# Permet à FSL de trouver les packages Python (nibabel, etc.)

export PYTHONPATH=/home/users/l/lemarec4/.local/lib/python3.9/site-packages:$PYTHONPATH

export FSLPARALLEL=0

\# ---------------------------

\# Run Dual Regression (Stages 1 & 2 only)

\# ---------------------------

echo "Running dual_regression on inputs from: ${INPUT_LIST}"



dual_regression "${MELODIC_IC}" 0 -1 0 ${THR_FLAG} "${RESULTS_DIR}" $(cat "${INPUT_LIST}") --nobet




echo "Done. Main outputs:"

echo " - ${RESULTS_DIR}/dr_stage1/ (time courses)"

echo " - ${RESULTS_DIR}/dr_stage2_icXXXX.nii.gz (subject spatial maps per IC)"

Thank you again

You can load the module NiBabel/3.2.1 instead.

This is for testing? For production later, be careful to specify the number of cores you request.

I’ll install a newer version, it seems it is now installed by default.