theislab / diffxpy

Differential expression analysis for single-cell RNA-seq data.
https://diffxpy.rtfd.io
BSD 3-Clause "New" or "Revised" License
193 stars 23 forks source link

class tuple not recognized when running de.test.pairwise #154

Open fairliereese opened 4 years ago

fairliereese commented 4 years ago

I'm trying to run multi-way tests and following this tutorial. On the webpage, as referenced in issue #135, I see an assertion error. However, when trying to run this on my own machine, I get a different error, both when using my own data and when copy pasting the tutorial code. Here's the stack trace I get.

`

test = de.test.pairwise( ... data=adata, ... grouping="batch", ... test="z-test", ... lazy=False, ... noise_model="nb" ... ) Traceback (most recent call last): File "", line 6, in File "/Users/fairliereese/Documents/programming/mortazavi_lab/bin/diffxpy/diffxpy/testing/tests.py", line 1256, in pairwise **kwargs File "/Users/fairliereese/Documents/programming/mortazavi_lab/bin/diffxpy/diffxpy/testing/tests.py", line 193, in _fit cast_dtype=dtype File "/Users/fairliereese/Documents/programming/mortazavi_lab/bin/batchglm/batchglm/models/base_glm/input.py", line 96, in init param_names=design_loc_names File "/Users/fairliereese/Documents/programming/mortazavi_lab/bin/batchglm/batchglm/models/base_glm/utils.py", line 41, in parse_design raise ValueError("type %s not recognized" % type(design_matrix)) ValueError: type <class 'tuple'> not recognized`

fairliereese commented 4 years ago

An addendum: I'm also getting an error when trying to run de.test.versus_rest on the tutorial:

`

test = de.test.versus_rest( ... data=adata, ... grouping="condition", ... test="wald", ... noise_model="nb" ... ) Traceback (most recent call last): File "", line 5, in File "/Users/fairliereese/Documents/programming/mortazavi_lab/bin/diffxpy/diffxpy/testing/tests.py", line 1492, in versus_rest **kwargs File "/Users/fairliereese/Documents/programming/mortazavi_lab/bin/diffxpy/diffxpy/testing/tests.py", line 1026, in two_sample raise ValueError("Less than two groups detected:\n\t%s", groups) ValueError: ('Less than two groups detected:\n\t%s', array(['group'], dtype='<U5')) `

Though this is explainable, the "grouping" argument passed is wrong. It should be "batch", as the sample generated does not contain multiple values for "condition". Substituting grouping='batch' for grouping='condition' resulted in it running for me.

kawairine commented 4 years ago

Hi,

Has this issue already been solved ? I have the same issue.

I think it is to due with test = 'z-test' when it complains about class 'tuple', because all other tests seem to work.

Any helps will be appreciated!

Thank you.

eveolsza commented 4 years ago

I am having the same error... but I couldn't run any other tests either

Any helps will be appreciated!

Thank you.