PennLINC / babs

BIDS App Bootstrap (BABS)
https://pennlinc-babs.readthedocs.io
MIT License
5 stars 5 forks source link

babs-init raises exception when there is no ses- folders in a non sub- folder. #142

Closed Michael-Sun closed 9 months ago

Michael-Sun commented 9 months ago

When attempting to run babs-init, it determined that a folder in my BIDS directory 'code' was a subject and raised an exception:

Checking whether each input dataset is a zipped or unzipped dataset... input dataset '1080_wasabi' is considered as an unzipped dataset. Performing sanity check for any unzipped input dataset...

babs-init failed! Below is the error message: Traceback (most recent call last): File "/dartfs-hpc/rc/home/j/f003z4j/miniconda3/lib/python3.9/site-packages/babs/cli.py", line 234, in babs_init_main babs_proj.babs_bootstrap(input_ds, File "/dartfs-hpc/rc/home/j/f003z4j/miniconda3/lib/python3.9/site-packages/babs/babs.py", line 400, in babs_bootstrap check_validity_unzipped_input_dataset(input_ds, self.type_session) File "/dartfs-hpc/rc/home/j/f003z4j/miniconda3/lib/python3.9/site-packages/babs/utils.py", line 95, in check_validity_unzipped_input_dataset raise Exception( Exception: In input dataset #1 '1080_wasabi', there is no ses-* folder in subject folder 'code'!

zhao-cy commented 9 months ago

Hi Michael! What's that code folder within your BIDS dataset used for? My understanding is that code should not be located within your BIDS dataset. Could you please remove this code folder?

mattcieslak commented 9 months ago

@zhao-cy I think it's fairly common to have code directories in BIDS, along with other directories like source_data. We should have BABS only look for sub-* directories directly under the BIDS root

zhao-cy commented 9 months ago

Ah sorry about this! Yes that's indeed a bug in BABS - thanks for letting us know, Michael! I'll fix it asap.

Note to myself: see function check_validity_unzipped_input_dataset() in utils.py. Seems this issue is only in validating the input datasets, but not when listing the subjects/sessions for analysis.

zhao-cy commented 9 months ago

Hi @Michael-Sun, I just fixed the issue - could you please re-install BABS from GitHub main branch (instead of using pip install), and test it out on your dataset?