theislab / diffxpy

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

Weird q-values when adding constraint to test.wald #166

Open danielStrobl opened 4 years ago

danielStrobl commented 4 years ago

Hey!

I've been getting some weird results when I add a constraint to the model with constraints_loc. Basically all genes are detected as differentially expressed then.

This is the code I used:

test_tmp = de.test.wald(
        data=adata.layers['counts'],
        formula_loc="~ 1 + cond + identifier",
        coef_to_test=["cond[T.control]"],
        sample_description=adata.obs,
        constraints_loc={'identifier':'cond'},
        noise_model='nb',
        gene_names=adata.var_names,
        size_factors='size_factors'
    )

Distrubution of Q-Values with and without constraint: image image