Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Problems running some BIDS Apps (--participant-label bug) #184

Open
jacobsanz97 opened this issue Feb 14, 2025 · 1 comment
Open

Problems running some BIDS Apps (--participant-label bug) #184

jacobsanz97 opened this issue Feb 14, 2025 · 1 comment
Labels
bug Issues noting problems and PRs fixing those problems.

Comments

@jacobsanz97
Copy link

Summary

Certain BIDS Apps (Such as FreeSurfer and ANTs, for example) run into errors when executed with BABS.

For these two apps (and most of the others listed on the BIDS Apps website) the parameter is --participant_label rather than --participant-label, which I think is producing an error:
'run.py: error: unrecognized arguments: --participant-label sub-01'

Additionally, as far as I can tell from the logs, BABS generates the singularity commands using the --participant-label parameter in the format sub-ID (e.g., sub-01 in our test case), but these two BIDS Apps (and many of the others) state in their GitHub repository README's that this parameter should not include the sub- prefix. The containers won't run if it is included, producing errors, for example
ANTs: 'Exception: No T1w files found for participant sub-01',
FreeSurfer: 'No T1w nii files found for subject sub-01. Skipping subject.'.

I went through the documentation but couldn’t find a way to specify these parameter variations in BABS. It’s totally possible that I’m just overlooking something—maybe this isn’t a bug at all, and is just me being clueless! :)

Let me know if I should be asking this somewhere else instead.
Thanks for your help!!

Additional details

  • BABS version (pip show babs): 0.0.8
  • DataLad version (datalad --version): 1.1.5
  • Git version (git --version): 2.40.1
  • git-annex version (git-annex version; pasting the first printed line is sufficient): 10.20230926-g44a7b4c9734adfda5912dd82c1aa97c615689f57
  • datalad-container version (datalad containers-add --version): 1.2.5
  • Singularity version (singularity --version): apptainer version 1.3.5
  • Please copy and paste the printed messages from babs-check-setup:
Will check setups of BABS project located at: /home/jacobsr/scratch/other_reruns/babs/my_BABS_project
Did not request `--job-test`; will not submit a test job.
Below is the configuration information saved during `babs-init` in file 'analysis/code/babs_proj_config.yaml':

type_session: single-ses
type_system: slurm
input_ds:
  $INPUT_DATASET_#1:
    name: dsONtest
    path_in: /home/jacobsr/scratch/other_reruns/babs/test_dataset/ds005072
    path_data_rel: inputs/data/dsONtest
    is_zipped: false
container:
  name: antscontainer
  path_in: /home/jacobsr/scratch/other_reruns/babs/ANTScont

Checking the BABS project itself...
✓ All good!

Check status of 'analysis' DataLad dataset...
nothing to save, working tree clean
✓ All good!

Checking input dataset(s)...
✓ All good!

Checking container datalad dataset...
✓ All good!

Checking `analysis/code/` folder...
✓ All good!

Checking input and output RIA...
	Datalad dataset `analysis`'s siblings:
.: here(+) [git]
.: output(-) [/home/jacobsr/scratch/other_reruns/babs/my_BABS_project/output_ria/f5f/14ebc-c4ee-49b8-a312-a8be0416d7b4 (git)]
.: input(-) [/home/jacobsr/scratch/other_reruns/babs/my_BABS_project/input_ria/f5f/14ebc-c4ee-49b8-a312-a8be0416d7b4 (git)]
.: output-storage(+) [ora]
✓ All good!

Not to submit a test job as it's not requested. We recommend running a test job with `--job-test` if you haven't done so; It will gather setup information in the designated environment and make sure future BABS jobs with current setups will be able to finish successfully.

`babs-check-setup` was successful! 

What were you trying to do?

Runs the two aforementioned BIDS Apps on the OpenNeuro dataset ds005072

What did you expect to happen?

I followed the documentation walkthrough steps but instead of the defaults, used the aforementioned OpenNeuro dataset and BIDS App images.
I initialized the project successfully, and successfully launched the jobs on a SLURM HPC (All as expected).

babs-init --where_project ${PWD} --project_name my_BABS_project --input dsONtest /home/jacobsr/scratch/other_reruns/babs/test_dataset/ds005072 --container_ds ${PWD}/ANTScont --container_name antscontainer --container_config_yaml_file ${PWD}/config_antsbidsapp.yaml --type_session single-ses --type_system slurm

The HPC submissions fail after launching (not expected until I saw the participant label mismatches).

What actually happened?

During job execution (babs-submit --project-root $PWD) it fails as described above. Relevant logs from analysis/logs/ant_sub-01.e40202214:

+ dssource=ria+file:///home/jacobsr/scratch/other_reruns/babs/my_BABS_project/input_ria#f5f14ebc-c4ee-49b8-a312-a8be0416d7b4
+ pushgitremote=/home/jacobsr/scratch/other_reruns/babs/my_BABS_project/output_ria/f5f/14ebc-c4ee-49b8-a312-a8be0416d7b4
+ subid=sub-01
+ cd /home/jacobsr/scratch/other_reruns/babs
+ BRANCH=job-40202214-sub-01
+ mkdir job-40202214-sub-01
+ cd job-40202214-sub-01
+ datalad clone ria+file:///home/jacobsr/scratch/other_reruns/babs/my_BABS_project/input_ria#f5f14ebc-c4ee-49b8-a312-a8be0416d7b4 ds
[INFO] Attempting a clone into /home/jacobsr/scratch/other_reruns/babs/job-40202214-sub-01/ds
[INFO] Attempting to clone from file:///home/jacobsr/scratch/other_reruns/babs/my_BABS_project/input_ria/f5f/14ebc-c4ee-49b8-a312-a8be0416d7b4 to /home/jacobsr/scratch/other_reruns/babs/job-40202214-sub-01/ds
[INFO] Completed clone attempts for Dataset(/home/jacobsr/scratch/other_reruns/babs/job-40202214-sub-01/ds)
+ cd ds
+ git remote add outputstore /home/jacobsr/scratch/other_reruns/babs/my_BABS_project/output_ria/f5f/14ebc-c4ee-49b8-a312-a8be0416d7b4
+ git checkout -b job-40202214-sub-01
Switched to a new branch 'job-40202214-sub-01'
+ datalad get -n inputs/data/dsONtest/sub-01
[INFO] Attempting a clone into /home/jacobsr/scratch/other_reruns/babs/job-40202214-sub-01/ds/inputs/data/dsONtest
[INFO] Attempting to clone from file:///home/jacobsr/scratch/other_reruns/babs/my_BABS_project/input_ria/204/f4852-c5cd-4b93-ac20-6366a6d5fbec to /home/jacobsr/scratch/other_reruns/babs/job-40202214-sub-01/ds/inputs/data/dsONtest
[INFO] Attempting to clone from /home/jacobsr/scratch/other_reruns/babs/test_dataset/ds005072 to /home/jacobsr/scratch/other_reruns/babs/job-40202214-sub-01/ds/inputs/data/dsONtest
[INFO] Completed clone attempts for Dataset(/home/jacobsr/scratch/other_reruns/babs/job-40202214-sub-01/ds/inputs/data/dsONtest)
+ cd inputs/data/dsONtest
++ grep -v sub-01
++ find . -type d -name 'sub*'
+ rm -rf
+ datalad run -i code/antscontainer_zip.sh -i inputs/data/dsONtest/sub-01 -i 'inputs/data/dsONtest/*json' -i containers/.datalad/environments/antscontainer/image --expand inputs --explicit -o sub-01_ANTsCT-test.zip -m 'antscontainer sub-01' 'bash ./code/antscontainer_zip.sh sub-01'
[INFO] Making sure inputs are available (this may take some time)
[INFO] Attempting a clone into /home/jacobsr/scratch/other_reruns/babs/job-40202214-sub-01/ds/containers
[INFO] Attempting to clone from file:///home/jacobsr/scratch/other_reruns/babs/my_BABS_project/input_ria/5d5/bbb5c-02b5-424c-af03-2ac0f4e75285 to /home/jacobsr/scratch/other_reruns/babs/job-40202214-sub-01/ds/containers
[INFO] Attempting to clone from /home/jacobsr/scratch/other_reruns/babs/ANTScont to /home/jacobsr/scratch/other_reruns/babs/job-40202214-sub-01/ds/containers
[INFO] Completed clone attempts for Dataset(/home/jacobsr/scratch/other_reruns/babs/job-40202214-sub-01/ds/containers)
[INFO] == Command start (output follows) =====
+ subid=sub-01
+ mkdir -p /home/jacobsr/scratch/other_reruns/babs/job-40202214-sub-01/ds/.git/tmp/wkdir
+ singularity run --cleanenv -B /home/jacobsr/scratch/other_reruns/babs/job-40202214-sub-01/ds containers/.datalad/environments/antscontainer/image inputs/data/dsONtest outputs participant --stage brain_extraction --participant-label sub-01
usage: run.py [-h]
              [--participant_label PARTICIPANT_LABEL [PARTICIPANT_LABEL ...]]
              [--n_cpus N_CPUS]
              [--stage {brain_extraction,template_registration_improved,qc,tissue_segmentation,template_registration,cortical_thickness}]
              [-v]
              bids_dir output_dir {participant}
run.py: error: unrecognized arguments: --participant-label sub-01
[INFO] == Command exit (modification check follows) =====

Reproducing the bug

@jacobsanz97 jacobsanz97 added the bug Issues noting problems and PRs fixing those problems. label Feb 14, 2025
@yibeichan
Copy link
Collaborator

hi @jacobsanz97 i submitted a PR here #185, waiting for review

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Issues noting problems and PRs fixing those problems.
Projects
None yet
Development

No branches or pull requests

2 participants