Summary of what happened:
I am trying to run a subject level model in fitlins for a faces>all localizer. I keep getting errors including:
KeyError: "['extension'] not found in axis"
It is difficult for me to debug this as it takes 45 minutes before fitlins reaches this error. Does anyone know what is wrong with my model? Thank you!
Command used (and if a helper script was used, a link to the helper script or the command generated):
command:
singularity run --cleanenv \
-B /om2 \
/om2/user/jsmentch/fitlins-latest.simg \
/om2/scratch/Mon/jsmentch/cneuromod/hcptrt ./ participant \
-d /om2/scratch/Mon/jsmentch/hcptrt \
-w /om2/scratch/Mon/jsmentch/fitlins/work_subject/ \
-m /om2/scratch/Mon/jsmentch/faces_v_all_sub.json \
--desc-label '' \
--participant-label 01 \
--space fsLR -v --n-cpus 1 --mem-gb 48
BIDS stats model:
{
"Name": "FacesVsAll",
"BIDSModelVersion": "1.0.0",
"Input": {"task":["wm"]},
"Nodes": [
{
"Level": "Run",
"Name": "run_level",
"GroupBy": ["run"],
"Model": {"X":
["stim_type.Face",
"a_comp_cor_00",
"a_comp_cor_01",
"a_comp_cor_02",
"a_comp_cor_03",
"a_comp_cor_04",
"cosine*",
"csf",
"framewise_displacement",
"rot_x",
"rot_y",
"rot_z",
"trans_x",
"trans_y",
"trans_z"],
"Type": "glm"},
"DummyContrasts":{
"Contrasts":[
"stim_type.Face"],
"Test":"t"
},
"Transformations":{
"Transformer":"pybids-transforms-v1",
"Instructions":[
{
"Name": "Factor",
"Input": ["stim_type"]
},
{
"Name":"Convolve",
"Input":[
"stim_type.Face"
],
"Model":"spm"
}
]
}
},
{
"Level": "Subject",
"Name": "subject_level",
"GroupBy": ["subject", "contrast"],
"Model": {"X": [1], "Type": "meta"},
"DummyContrasts": {"Test": "t"}
}
]
}
Version:
fitlins-latest singular container
Environment (Docker, Singularity / Apptainer, custom installation):
Data formatted according to a validatable standard? Please provide the output of the validator:
the BIDS Stats Model Validator didn’t complain
Relevant log outputs (up to 20 lines):
Node: fitlins_wf.loader
Working directory: /om2/scratch/Mon/jsmentch/fitlins/work_subject/fitlins_wf/loader
Node inputs:
database_path = /om2/scratch/Mon/jsmentch/fitlins/work_subject/dbcache
model = {'Name': 'FacesVsAll', 'BIDSModelVersion': '1.0.0', 'Input': {'task': ['wm']}, 'Nodes': [{'Level': 'Run', 'Name': 'run_level', 'GroupBy': ['run'], 'Model': {'X': ['stim_type.Face', 'a_comp_cor_00', 'a_comp_cor_01', 'a_comp_cor_02', 'a_comp_cor_03', 'a_comp_cor_04', 'cosine*', 'csf', 'framewise_displacement', 'rot_x', 'rot_y', 'rot_z', 'trans_x', 'trans_y', 'trans_z'], 'Type': 'glm'}, 'DummyContrasts': {'Contrasts': ['stim_type.Face'], 'Test': 't'}, 'Transformations': {'Transformer': 'pybids-transforms-v1', 'Instructions': [{'Name': 'Factor', 'Input': ['stim_type']}, {'Name': 'Convolve', 'Input': ['stim_type.Face'], 'Model': 'spm'}]}}, {'Level': 'Subject', 'Name': 'subject_level', 'GroupBy': ['subject', 'contrast'], 'Model': {'X': [1], 'Type': 'meta'}, 'DummyContrasts': {'Test': 't'}}]}
selectors = {'desc': None, 'space': 'fsLR', 'subject': ['01']}
Traceback (most recent call last):
File "/opt/miniconda-latest/envs/neuro/lib/python3.9/site-packages/nipype/pipeline/plugins/multiproc.py", line 67, in run_node
result["result"] = node.run(updatehash=updatehash)
File "/opt/miniconda-latest/envs/neuro/lib/python3.9/site-packages/nipype/pipeline/engine/nodes.py", line 527, in run
result = self._run_interface(execute=True)
File "/opt/miniconda-latest/envs/neuro/lib/python3.9/site-packages/nipype/pipeline/engine/nodes.py", line 645, in _run_interface
return self._run_command(execute)
File "/opt/miniconda-latest/envs/neuro/lib/python3.9/site-packages/nipype/pipeline/engine/nodes.py", line 771, in _run_command
raise NodeExecutionError(msg)
nipype.pipeline.engine.nodes.NodeExecutionError: Exception raised while executing Node loader.
Traceback:
Traceback (most recent call last):
File "/opt/miniconda-latest/envs/neuro/lib/python3.9/site-packages/nipype/interfaces/base/core.py", line 398, in run
runtime = self._run_interface(runtime)
File "/opt/miniconda-latest/envs/neuro/lib/python3.9/site-packages/fitlins/interfaces/bids.py", line 246, in _run_interface
graph.load_collections(**selectors)
File "/opt/miniconda-latest/envs/neuro/lib/python3.9/site-packages/bids/modeling/statsmodels.py", line 198, in load_collections
collections = self.layout.get_collections(node.level, drop_na=drop_na,
File "/opt/miniconda-latest/envs/neuro/lib/python3.9/site-packages/bids/layout/layout.py", line 860, in get_collections
index = load_variables(self, types=types, levels=level,
File "/opt/miniconda-latest/envs/neuro/lib/python3.9/site-packages/bids/variables/io.py", line 97, in load_variables
dataset = _load_tsv_variables(layout, t, dataset, scope=scope,
File "/opt/miniconda-latest/envs/neuro/lib/python3.9/site-packages/bids/variables/io.py", line 463, in _load_tsv_variables
ent_cols.drop(columns=to_drop, inplace=True)
File "/opt/miniconda-latest/envs/neuro/lib/python3.9/site-packages/pandas/util/_decorators.py", line 311, in wrapper
return func(*args, **kwargs)
File "/opt/miniconda-latest/envs/neuro/lib/python3.9/site-packages/pandas/core/frame.py", line 4906, in drop
return super().drop(
File "/opt/miniconda-latest/envs/neuro/lib/python3.9/site-packages/pandas/core/generic.py", line 4150, in drop
obj = obj._drop_axis(labels, axis, level=level, errors=errors)
File "/opt/miniconda-latest/envs/neuro/lib/python3.9/site-packages/pandas/core/generic.py", line 4185, in _drop_axis
new_axis = axis.drop(labels, errors=errors)
File "/opt/miniconda-latest/envs/neuro/lib/python3.9/site-packages/pandas/core/indexes/base.py", line 6017, in drop
raise KeyError(f"{labels[mask]} not found in axis")
KeyError: "['extension'] not found in axis"