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

Design matrices with disjoint columns #1

Open
hosseinshn opened this issue Nov 23, 2021 · 0 comments
Open

Design matrices with disjoint columns #1

hosseinshn opened this issue Nov 23, 2021 · 0 comments

Comments

@hosseinshn
Copy link

Hello.
I tried the package with X and C options when they have disjoint columns as follows:

combat = reComBat(model="elastic_net")
combat.fit(data=dataset.data, batches=dataset.integer_batch['batch'],
           X=dataset.annot[['A']], C=dataset.annot[['B','C']])

and got the following error:

KeyError: "None of [Index(['A'], dtype='object')] are in the [columns]"

I think it is because of the following lines (269-270 of reComBat.py:

        if C is not None:
...
            C_categorical = C.loc[:,[c for c in X.columns if '_numerical' not in c]]
            C_numerical = C.loc[:,[c for c in X.columns if '_numerical' in c]].values

Why the for loop goes over columns of X on design matrix C?

The package works fine if I go:

combat = reComBat(model="elastic_net")
combat.fit(data=dataset.data, batches=dataset.integer_batch['batch'],
           X=dataset.annot[['A','B','C']], C=dataset.annot[['A','B','C']])

Is there a bug here or I am missing something?
Thank you.

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