Teichlab / SpatialDE

Test genes for Spatial Variation
MIT License
145 stars 54 forks source link

p value #18

Open sokratiag opened 3 years ago

sokratiag commented 3 years ago

Hi,

Shouldn't the test statistics for the LLR be 2LLR in mll_results['pval'] = 1 - stats.chi2.cdf(mll_results['LLR'], df=1), so that ['pval'] = 1 - stats.chi2.cdf(2 mll_results['LLR'], df=1)?

vals commented 3 years ago

Hm, you're right, it should be! Not sure why we missed that.

Looking at simulations from null model, the FDR is calibrated: https://github.com/Teichlab/SpatialDE/blob/master/Analysis/Theory/Simulation%20from%20null%20model.ipynb . But the black bar might be even closer to the 5% FDR with 2 * LLR.

Usually the null hypothesis is very clearly rejected, with large LLR's that give infinitesimal p-values. So in practice it probably makes a pretty small difference. But we should change this.

sokratiag commented 3 years ago

Hi vals, I think if you take pval=1 - ss.chi2.cdf(2*df['LLR'], df=1) on the MOUSEOB example, would result to 345 SV genes which makes a big difference so it is worth looking at it because you lose power!