PyMVPA BIDS-App in Singularity Container

Hello!

I am testing out the new PyMVPA BIDS-App on one of my datasets (I am excited about the promise of this new tool)! However, I am unable get past the participant_prep stage.

I created a singularity image using this command:

sudo singularity pull pymvpa-4.0.3.simg docker://bids/pymvpa:v4.0.3

Then, I tried running participant_prep for one subject using the following command:

singularity run \
--bind /SR/subjects:/bids_dataset \
--cleanenv \
pymvpa-4.0.3.simg \
/bids_dataset \
/bids_dataset/derivatives/pymvpa \
participant_prep \
--participant_id 501 \
--task faces \
--skip_bids_validator

This creates /SR/subjects/derivatives/pymvpa and /SR/subjects/derivatives/pymvpa/masks, but the data for that subject is not prepped (no output folder named “sub-501”).

I get the following warnings (this is everything that is written to the terminal):

/usr/lib/python2.7/dist-packages/sklearn/cross_validation.py:41: DeprecationWarning: This module was deprecated in version 0.18 in favor of the model_selection module into which all the refactored classes and functions are moved. Also note that the interface of the new CV iterators are different from that of this module. This module will be removed in 0.20.
  "This module will be removed in 0.20.", DeprecationWarning)
/usr/lib/python2.7/dist-packages/sklearn/grid_search.py:42: DeprecationWarning: This module was deprecated in version 0.18 in favor of the model_selection module into which all the refactored classes and functions are moved. This module will be removed in 0.20.
  DeprecationWarning)
/usr/lib/python2.7/dist-packages/sklearn/learning_curve.py:22: DeprecationWarning: This module was deprecated in version 0.18 in favor of the model_selection module into which all the functions are moved. This module will be removed in 0.20
  DeprecationWarning)
/usr/lib/python2.7/dist-packages/statsmodels/compat/pandas.py:56: FutureWarning: The pandas.core.datetools module is deprecated and will be removed in a future version. Please use the pandas.tseries module instead.
  from pandas.core import datetools
/bin/bash: warning: setlocale: LC_ALL: cannot change locale (en_US.UTF-8)
/bin/bash: warning: setlocale: LC_ALL: cannot change locale (en_US.UTF-8)

I suspect it is somehow not looping through sub_IDs at lines 168-186 in run.py. Could it also be related at all to the LC_ALL locale warning?

I can confirm that my directory is BIDS compliant. I added the --skip_bids_validator flag because it appears that bids-validator is not installed in the container? This is the additional warning I get when I run the command above without skipping validation.

/tmp/tmpNy73ic: line 1: bids-validator: command not found

Any suggestions/feedback are greatly appreciated! Thanks so much!

Hi @shawnrhoads,

This sounds like a bug that might be better addressed on the github repo: Sign in to GitHub · GitHub

Best,
Steven

1 Like

Hi @shawnrhoads

Could you show me your data’s tree structure, specifically where you have your preprocessed functionals? I wanna see both the folder tree and your file names.

Sajjad

Sure – here’s the tree starting from the BIDS parent directory (e.g., /SR/subjects/*) with two example subjects. Preprocessed data are in ./derivatives/fmriprep/*

tree.txt (149.2 KB)

As another minor update, I also tried this command without success:

singularity run \
--bind /SR/subjects:/bids_dataset \
--cleanenv \
pymvpa-4.0.3.simg \
/bids_dataset/derivatives/fmriprep \
/bids_dataset/derivatives/pymvpa \
participant_prep \
--participant_id 501 \
--task faces \
--skip_bids_validator

Ok I think I know where the issue is coming from. In older versions of fmriprep when you preprocessed your images, they were placed under BIDSroot/derivatives/fmriprep which is the case with your data, but the more recent versions place files directly under BIDSroot/derivatives. So the most straightforward fix is to move everything you have under the fmriprep folder to their parent directory (derivatives).

Ah I see, thanks!

To confirm/clarify, the BIDS app needs the preprocessed data to be located in BIDSroot/derivatives?

Then, I should run:

singularity run \
--bind /SR/subjects:/BIDSroot \
--cleanenv \
pymvpa-4.0.3.simg \
/BIDSroot \
/BIDSroot/derivatives/pymvpa \
participant_prep \
--participant_id 501 \
--task faces \
--skip_bids_validator

I must admit I am hesitant to reorganize given previous analysis scripts that already rely on the BIDSroot/derivatives/fmriprep file structure for this dataset :sweat_smile:

Would it worth adding functionality for users to specify an alternative BIDS compliant directory for the preprocessed data? Happy to help contribute to that.

As a side note, Figure 1 in the paper suggests that the structure should be BIDSroot/derivatives/fmriprep.

Thanks again!

Yes, the preprocessed data should be under derivatives. We can add this flexibility, but I encourage you to make other things compatible with this newer organization of fmriprep. And yes in our paper we show the fmriprep folder because the figure was built when we worked with older versions of fmriprep :slight_smile:

Let me know if you have more questions when you move to the test phase!