FitLins: Error on fitlins.wf loader

Dear Neurostars crowd,

we are currently implementing a new fMRI pipeline in the lab and are testing FitLins as a follow up to MRIQC and fMRIPrep. I am running FitLins through Docker on a fMRIPrep-processed dataset (simple output, no cifti). BIDS validation passes for both the raw data and the derivatives files. FitLins is ver 0.7.0 (BIDS 1.1.0), fMRIPrep is ver 20.1.1 (BIDS 1.1.1). I carefully matched the model file to the online examples and at minimum, it passes json.load() when testing for obvious errors.

Before any real processing happens, I get the following errors:

######################

201012-10:05:39,305 nipype.utils WARNING:
A newer version (1.5.1) of nipy/nipype is available. You are using 1.5.0
201012-10:05:45,210 nipype.workflow WARNING:
Storing result file without outputs
201012-10:05:45,211 nipype.workflow WARNING:
[Node] Error on “fitlins_wf.loader” (/working_dir/fitlins_wf/loader)
201012-10:05:45,521 nipype.workflow ERROR:
Node loader failed to run on host df292346edbc.
201012-10:05:45,524 nipype.workflow ERROR:
Saving crash info to /working_dir/crash-20201012-100545-UID1541801116-loader-20a1a3c4-0f46-4096-a162-6bfae5e11684.txt
Traceback (most recent call last):
File “/opt/miniconda-latest/envs/neuro/lib/python3.6/site-packages/nipype/pipeline/plugins/multiproc.py”, line 148, in init
mp_context=mp_context,
TypeError: init() got an unexpected keyword argument ‘initializer’

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File “/opt/miniconda-latest/envs/neuro/lib/python3.6/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.6/site-packages/nipype/pipeline/engine/nodes.py”, line 516, in run
result = self._run_interface(execute=True)
File “/opt/miniconda-latest/envs/neuro/lib/python3.6/site-packages/nipype/pipeline/engine/nodes.py”, line 635, in _run_interface
return self._run_command(execute)
File “/opt/miniconda-latest/envs/neuro/lib/python3.6/site-packages/nipype/pipeline/engine/nodes.py”, line 741, in _run_command
result = self._interface.run(cwd=outdir)
File “/opt/miniconda-latest/envs/neuro/lib/python3.6/site-packages/nipype/interfaces/base/core.py”, line 397, in run
runtime = self._run_interface(runtime)
File “/opt/miniconda-latest/envs/neuro/lib/python3.6/site-packages/fitlins/interfaces/bids.py”, line 221, in _run_interface
self._load_level1(runtime, analysis)
File “/opt/miniconda-latest/envs/neuro/lib/python3.6/site-packages/fitlins/interfaces/bids.py”, line 304, in _load_level1
names.extend(col for col in dense.columns if col.startswith(‘non_steady_state’))
File “/opt/miniconda-latest/envs/neuro/lib/python3.6/site-packages/fitlins/interfaces/bids.py”, line 304, in
names.extend(col for col in dense.columns if col.startswith(‘non_steady_state’))
AttributeError: ‘tuple’ object has no attribute ‘startswith’

201012-10:05:47,518 nipype.workflow ERROR:
could not run node: fitlins_wf.loader
Traceback (most recent call last):
File “/opt/miniconda-latest/envs/neuro/bin/fitlins”, line 8, in
sys.exit(main())
File “/opt/miniconda-latest/envs/neuro/lib/python3.6/site-packages/fitlins/cli/run.py”, line 271, in main
sys.exit(run_fitlins(sys.argv[1:]))
File “/opt/miniconda-latest/envs/neuro/lib/python3.6/site-packages/fitlins/cli/run.py”, line 265, in run_fitlins
write_full_report(report_dict, run_context, deriv_dir)
File “/opt/miniconda-latest/envs/neuro/lib/python3.6/site-packages/fitlins/viz/reports.py”, line 132, in write_full_report
Path(target_file).write_text(html)
File “/opt/miniconda-latest/envs/neuro/lib/python3.6/pathlib.py”, line 1215, in write_text
with self.open(mode=‘w’, encoding=encoding, errors=errors) as f:
File “/opt/miniconda-latest/envs/neuro/lib/python3.6/pathlib.py”, line 1183, in open
opener=self._opener)
File “/opt/miniconda-latest/envs/neuro/lib/python3.6/pathlib.py”, line 1037, in _opener
return self._accessor.open(self, flags, mode)
File “/opt/miniconda-latest/envs/neuro/lib/python3.6/pathlib.py”, line 387, in wrapped
return strfunc(str(pathobj), *args)
FileNotFoundError: [Errno 2] No such file or directory: ‘/output/fitlins/reports/model-3cond.html’

##################

Following some (layman-level) digging, it seems to me the AttributeError during execution of bids.py is linked to reading input json files (can’t make out which) where at some point during transformation to dataframes and reading of columns, a tuple is extracted instead of a single value. All help is very much appreciated!

Best,

André

This seems like a bug. Can you please open an issue on https://github.com/poldracklab/fitlins/issues? It will be easier to track there.

Done: https://github.com/poldracklab/fitlins/issues/258.
Thanks for the quick reaction and the amazing work!