Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

--drop-missing still throws errors with missing regressors #371

Open
smeisler opened this issue Jun 6, 2022 · 2 comments
Open

--drop-missing still throws errors with missing regressors #371

smeisler opened this issue Jun 6, 2022 · 2 comments

Comments

@smeisler
Copy link
Contributor

smeisler commented Jun 6, 2022

Environment

FitLins v 0.10.1 run on Singularity 3.9.5 on CentOs 7.6

Expected Behavior

I am trying to implement a GLM that includes 5 aCompCor components as nuisance variables (among other variables). However, some of my functional runs do not have 5 aCompCor components. That is, in these runs, <5 components explained 50% of the variance. FitLins throws an error when trying to run my model on these runs since the 4th or 5th component (e.g. a_comp_cor04) are not present. I expected this error to not happen when including the --drop-missing argument, but it persists.

Observed Behavior

	 [Node] Error on "fitlins_wf.loader" (/om2/scratch/Sat/smeisler/fitlins_MIND/sub-MIND3000_phono/fitlins_wf/loader)
220603-16:30:25,900 nipype.workflow ERROR:
	 Node loader failed to run on host node032.
220603-16:30:25,900 nipype.workflow ERROR:
	 Saving crash info to /om2/scratch/Sat/smeisler/fitlins_MIND/sub-MIND3000_phono/crash-20220603-163025-smeisler-loader-ace8a2cb-f86e-4a04-bb1c-8c156966532f.txt
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 521, 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 639, 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 750, in _run_command
    raise NodeExecutionError(
nipype.pipeline.engine.nodes.NodeExecutionError: Exception raised while executing Node loader.

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 250, in _run_interface
    self._results['all_specs'] = self._load_graph(runtime, graph)
  File "/opt/miniconda-latest/envs/neuro/lib/python3.9/site-packages/fitlins/interfaces/bids.py", line 258, in _load_graph
    specs = node.run(inputs, group_by=node.group_by, **filters)
  File "/opt/miniconda-latest/envs/neuro/lib/python3.9/site-packages/bids/modeling/statsmodels.py", line 464, in run
    node_output = BIDSStatsModelsNodeOutput(
  File "/opt/miniconda-latest/envs/neuro/lib/python3.9/site-packages/bids/modeling/statsmodels.py", line 619, in __init__
    raise ValueError("X specification includes variable(s) {}, but "
ValueError: X specification includes variable(s) ['a_comp_cor_04'], but these were not found in data matrix.

Steps to Reproduce

  1. Identify fMRIPrep run with fewer than 5 acompcor components (or otherwise expected regressors)
  2. Run FitLins with --drop-missing argument: singularity run -e -B ${scratch},${bids_dir} $IMG ${scratch}/${subject}_db ${scratch}/${subject}_db/derivatives/fitlins_${model} run -m $scratch/${subject}_db/models/${task}-model-${model}.json -d ${scratch}/${subject}_db/derivatives/fmriprep/ -w $scratch --participant-label ${subject:4} --space $space --desc-label preproc -s 6 --drop-missing
@adelavega
Copy link
Collaborator

I have replicated this issue as well. This must be a new bug since this flag used to work.

Thanks for the report!

@adelavega
Copy link
Collaborator

Obviously as a work around I would suggest using fewer comp cor components, but this should be a "easy" fix, so hopefully we can push it through soon

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants