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

load_collections not loading variables in participants.tsv? #855

Open
jdkent opened this issue May 6, 2022 · 0 comments
Open

load_collections not loading variables in participants.tsv? #855

jdkent opened this issue May 6, 2022 · 0 comments

Comments

@jdkent
Copy link
Contributor

jdkent commented May 6, 2022

cannot access the 'group' variable in 'participants.tsv' in the narps dataset https://github.com/jdkent/model-zoo/tree/typical/narps

this line

this output:

---------------------------------------------------------------------------
ValueError                                Traceback (most recent call last)
Input In [60], in <cell line: 2>()
      1 get_ipython().run_line_magic('pdb', '')
----> 2 ds1_specs = ds1_node.run(sub_contrasts, group_by=ds1_node.group_by, **next_node.children[1].filter)

File /opt/conda/lib/python3.9/site-packages/bids/modeling/statsmodels.py:444, in BIDSStatsModelsNode.run(self, inputs, group_by, force_dense, sampling_rate, invalid_contrasts, **filters)
    442 # group all collections and inputs
    443 all_objects = inputs + collections
--> 444 groups = self._build_groups(all_objects, group_by)
    446 results = []
    448 for grp_ents, grp_objs in list(groups.items()):
    449 
    450     # split group's objects into inputs and collections

File /opt/conda/lib/python3.9/site-packages/bids/modeling/statsmodels.py:347, in BIDSStatsModelsNode._build_groups(objects, group_by)
    345 missing_vars = list(group_by - set(df.columns))
    346 if missing_vars:
--> 347     raise ValueError("group_by contains variable(s) {} that could not "
    348                      "be found in the entity index.".format(missing_vars) )
    350 # Restrict DF to only grouping columns
    351 df = df.loc[:, list(group_by)]

ValueError: group_by contains variable(s) ['group'] that could not be found in the entity index.

the simple addition of entities and collections is not the behavior we want:

all_objects = inputs + collections

collections contain the variables (e.g., group), but the filename does not contain the information required.

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

1 participant