Error with cpac build-models

Hello everyone!

I’m using C-PAC (v1.8.8.dev1:nightly) on a HPC (singularity v3.11.5). I’m trying to run an analysis comparing two groups pre-post, for which I’ve created a group analysis file with the model builder (I’m not able to use the presets at the moment). My configuration file for group-level analysis is this:

group_config.txt (16.1 KB)

When I try to build the model to run the analysis I get the following error:

INFO:    Converting SIF file to temporary sandbox...
/usr/share/fsl/6.0/bin/cpac:4: DeprecationWarning: pkg_resources is deprecated as an API. See https://setuptools.pypa.io/en/latest/pkg_resources.html
  __import__('pkg_resources').require('CPAC==1.8.8.dev1')
Traceback (most recent call last):
  File "/usr/share/fsl/6.0/lib/python3.10/site-packages/pandas/core/indexes/base.py", line 3653, in get_loc
    return self._engine.get_loc(casted_key)
  File "pandas/_libs/index.pyx", line 147, in pandas._libs.index.IndexEngine.get_loc
  File "pandas/_libs/index.pyx", line 176, in pandas._libs.index.IndexEngine.get_loc
  File "pandas/_libs/hashtable_class_helper.pxi", line 7080, in pandas._libs.hashtable.PyObjectHashTable.get_item
  File "pandas/_libs/hashtable_class_helper.pxi", line 7088, in pandas._libs.hashtable.PyObjectHashTable.get_item
KeyError: 'Derivative'
The above exception was the direct cause of the following exception:
Traceback (most recent call last):
  File "/usr/share/fsl/6.0/bin/cpac", line 7, in <module>
    exec(compile(f.read(), __file__, 'exec'))
  File "/code/scripts/cpac", line 5, in <module>
    main()
  File "/usr/share/fsl/6.0/lib/python3.10/site-packages/click/core.py", line 1157, in __call__
    return self.main(*args, **kwargs)
  File "/usr/share/fsl/6.0/lib/python3.10/site-packages/click/core.py", line 1078, in main
    rv = self.invoke(ctx)
  File "/usr/share/fsl/6.0/lib/python3.10/site-packages/click/core.py", line 1688, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
  File "/usr/share/fsl/6.0/lib/python3.10/site-packages/click/core.py", line 1688, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
  File "/usr/share/fsl/6.0/lib/python3.10/site-packages/click/core.py", line 1688, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
  File "/usr/share/fsl/6.0/lib/python3.10/site-packages/click/core.py", line 1434, in invoke
    return ctx.invoke(self.callback, **ctx.params)
  File "/usr/share/fsl/6.0/lib/python3.10/site-packages/click/core.py", line 783, in invoke
    return __callback(*args, **kwargs)
  File "/code/CPAC/__main__.py", line 160, in build_models
    cgr.build_feat_models(group_config)
  File "/code/CPAC/pipeline/cpac_group_runner.py", line 1138, in build_feat_models
    analysis_dict = prep_feat_inputs(group_config_file)
  File "/code/CPAC/pipeline/cpac_group_runner.py", line 722, in prep_feat_inputs
    keys[keys["Derivative"] == "yes"][keys["Space"] == "template"][
  File "/usr/share/fsl/6.0/lib/python3.10/site-packages/pandas/core/frame.py", line 3761, in __getitem__
    indexer = self.columns.get_loc(key)
  File "/usr/share/fsl/6.0/lib/python3.10/site-packages/pandas/core/indexes/base.py", line 3655, in get_loc
    raise KeyError(key) from err
KeyError: 'Derivative'
INFO:    Cleaning up image...

I’ve checked GitHub (/code/CPAC/pipeline/cpac_group_runner.py) and prep_feat_inputs calls resources/cpac_outputs.tsv, which doesn’t have any column named Derivative, could that be the issue?

Thanks!!!

Hi @luisagulleiro,

Thanks for bringing this to our attention. Looks like this code is out of date - as I mentioned in an earlier thread, the C-APC group-level builder hasn’t been updated/supported for quite some time.

Our team is working on a fix for this issue and I’ll update you as soon as we have it!

-Tamsin