Tedana on Biowulf

Tedana is a Python package for removing noise from multi-echo fMRI data. It started as part of the ME-ICA pipeline but has since become a separate tool. Unlike the original ME-ICA pipeline, which handled both preprocessing and TE-dependent analysis, tedana assumes the data have already been preprocessed.

Documentation
Important Notes

Interactive job
Interactive jobs should be used for debugging, graphics, or applications that cannot be run as batch jobs.

Allocate an interactive session and run the program. Sample session:

[user@biowulf]$ sinteractive
salloc.exe: Pending job allocation 46116226
salloc.exe: job 46116226 queued and waiting for resources
salloc.exe: job 46116226 has been allocated resources
salloc.exe: Granted job allocation 46116226
salloc.exe: Waiting for resource configuration
salloc.exe: Nodes cn4224 are ready for job

[user@cn4224 ~]$ module load tedana
[+] Loading tedana  26.0.3  on cn4244

[user@cn4224 ~]$ cd /data/$USER
[user@cn4224 ~]$ git clone --depth 1 https://github.com/ME-ICA/ohbm-2025-multiecho.git
Cloning into 'ohbm-2025-multiecho'...
remote: Enumerating objects: 121, done.
remote: Counting objects: 100% (121/121), done.
remote: Compressing objects: 100% (99/99), done.
remote: Total 121 (delta 22), reused 114 (delta 22), pack-reused 0 (from 0)
Receiving objects: 100% (121/121), 16.36 MiB | 95.20 MiB/s, done.
Resolving deltas: 100% (22/22), done.

[user@cn4224 ~]$ cd ohbm-2025-multiecho
[user@cn4224 ~]$ curl -L -o five_echo_NIH.tar.xz https://osf.io/ea5v3/download
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100   162  100   162    0     0   4153      0 --:--:-- --:--:-- --:--:--  4153
100   247  100   247    0     0   3337      0 --:--:-- --:--:-- --:--:--  3337
  0     0    0     0    0     0      0      0 --:--:-- --:--:-- --:--:--     0
  0     0    0     0    0     0      0      0 --:--:-- --:--:-- --:--:--     0
100 68.5M  100 68.5M    0     0  46.9M      0  0:00:01  0:00:01 --:--:--  252M

[user@cn4224 ~]$ tar -xf five_echo_NIH.tar.xz -C five-echo-dataset
[user@cn4224 ~]$ rm five_echo_NIH.tar.xz

[user@cn4224 ~]$ tedana \
     -d five-echo-dataset/p06.SBJ01_S09_Task11_e1.sm.nii.gz \
        five-echo-dataset/p06.SBJ01_S09_Task11_e2.sm.nii.gz \
        five-echo-dataset/p06.SBJ01_S09_Task11_e3.sm.nii.gz \
        five-echo-dataset/p06.SBJ01_S09_Task11_e4.sm.nii.gz \
        five-echo-dataset/p06.SBJ01_S09_Task11_e5.sm.nii.gz \
     -e 0.0154 0.0297 0.0440 0.0583 0.0726 \
     --out-dir tedana_output
INFO     tedana:tedana_workflow:636 Using output directory: /data/username/ohbm-2025-multiecho/tedana_output
INFO     utils:check_te_values:792 TE values appear to be in seconds. Converting to milliseconds for internal use.
INFO     tedana:tedana_workflow:655 Initializing and validating component selection tree
WARNING  component_selector:validate_tree:146 Decision tree includes fields that are not used or logged ['_comment']
INFO     component_selector:__init__:345 Performing component selection with tedana_orig_decision_tree
INFO     component_selector:__init__:346 Very similar to the decision tree designed by Prantik Kundu

[...]

INFO     tedana:tedana_workflow:1236 Generating dynamic report
INFO     html_report:_update_template_bokeh:164 Checking for adaptive mask: adaptive_mask.svg, exists: True
INFO     html_report:_update_template_bokeh:208 T2* files exist: True
INFO     html_report:_update_template_bokeh:209 S0 files exist: True
INFO     html_report:_update_template_bokeh:210 RMSE files exist: True
INFO     html_report:_update_template_bokeh:217 Variance files exist: False
INFO     html_report:_update_template_bokeh:223 External regressors exist: False
INFO     rica:setup_rica_report:787 Rica launcher created. Run 'python /data/username/ohbm-2025-multiecho/tedana_output/open_rica_report.py' to visualize results.
INFO     tedana:tedana_workflow:1242 Workflow completed
INFO     utils:log_newsletter_info:812 Don't forget to subscribe to the tedana newsletter for updates! This is a very low volume email list.
INFO     utils:log_newsletter_info:816 https://groups.google.com/g/tedana-newsletter

[user@cn4224 ~]$ exit
salloc.exe: Relinquishing job allocation 46116226

[user@biowulf ~]$

Batch job
Most jobs should be run as batch jobs.

Create a batch input file (e.g. tedana.sh) similar to the following.

#! /bin/bash

module load tedana

cd /data/$USER/ohbm-2025-multiecho
tedana \
     -d five-echo-dataset/p06.SBJ01_S09_Task11_e1.sm.nii.gz \
        five-echo-dataset/p06.SBJ01_S09_Task11_e2.sm.nii.gz \
        five-echo-dataset/p06.SBJ01_S09_Task11_e3.sm.nii.gz \
        five-echo-dataset/p06.SBJ01_S09_Task11_e4.sm.nii.gz \
        five-echo-dataset/p06.SBJ01_S09_Task11_e5.sm.nii.gz \
     -e 0.0154 0.0297 0.0440 0.0583 0.0726 \
     --out-dir tedana_output

Submit these jobs using the Slurm sbatch command.

sbatch --cpus-per-task=2 --mem=4g tedana.sh
Swarm of Jobs
A swarm of jobs is an easy way to submit a set of independent commands requiring identical resources.

Create a swarmfile (e.g. tedana.swarm) containing 3 subjobs. For example:

cd /data/$USER/multiecho1; \
tedana \
     -d five-echo-dataset/p06.SBJ01_S09_Task11_e1.sm.nii.gz \
        five-echo-dataset/p06.SBJ01_S09_Task11_e2.sm.nii.gz \
        five-echo-dataset/p06.SBJ01_S09_Task11_e3.sm.nii.gz \
        five-echo-dataset/p06.SBJ01_S09_Task11_e4.sm.nii.gz \
        five-echo-dataset/p06.SBJ01_S09_Task11_e5.sm.nii.gz \
     -e 0.0154 0.0297 0.0440 0.0583 0.0726 \
     --out-dir tedana_output

cd /data/$USER/multiecho2; \
tedana \
     -d five-echo-dataset/p06.SBJ01_S09_Task11_e1.sm.nii.gz \
        five-echo-dataset/p06.SBJ01_S09_Task11_e2.sm.nii.gz \
        five-echo-dataset/p06.SBJ01_S09_Task11_e3.sm.nii.gz \
        five-echo-dataset/p06.SBJ01_S09_Task11_e4.sm.nii.gz \
        five-echo-dataset/p06.SBJ01_S09_Task11_e5.sm.nii.gz \
     -e 0.0154 0.0297 0.0440 0.0583 0.0726 \
     --out-dir tedana_output

cd /data/$USER/multiecho3; \
tedana \
     -d five-echo-dataset/p06.SBJ01_S09_Task11_e1.sm.nii.gz \
        five-echo-dataset/p06.SBJ01_S09_Task11_e2.sm.nii.gz \
        five-echo-dataset/p06.SBJ01_S09_Task11_e3.sm.nii.gz \
        five-echo-dataset/p06.SBJ01_S09_Task11_e4.sm.nii.gz \
        five-echo-dataset/p06.SBJ01_S09_Task11_e5.sm.nii.gz \
     -e 0.0154 0.0297 0.0440 0.0583 0.0726 \
     --out-dir tedana_output

Submit this job using the swarm command.

swarm -f tedana.swarm -g 4 -t 2 --module tedana
where
-g # Number of Gigabytes of memory required for each process (1 line in the swarm command file)
-t # Number of threads/CPUs required for each process (1 line in the swarm command file).
--module tedana Loads the tedana module for each subjob in the swarm