GreenleafLab / ArchR

ArchR : Analysis of Regulatory Chromatin in R (www.ArchRProject.com)
MIT License
385 stars 138 forks source link

Bug in differential peak calling #194

Closed CSBioAzim closed 4 years ago

CSBioAzim commented 4 years ago

I'm seeing some weird patterns in the MA plot of differential peaks calling. It looks that there is a bug in the function. I've attached a plot where I highlighted the points where they need to be colored but still they are gray. Have a look inside of the circles! It would be nice to have your explanation on it. Bug MA_Test PV_Test

``

jgranja24 commented 4 years ago

Have you looked at the FDR and LFC? Variability within a group are not conveyed in this plot.

CSBioAzim commented 4 years ago

@jgranja24 @rcorces , I updated log2FC vs FDR plot as well. I'm wondering how does the p-value is computed for the differential peaks. Is it the only function of log FC or log FC and mean accessibility? If yes, then why some of the points that have high mean accessibility and high log FC are gray next to the red points with very similar characteristics?

rcorces commented 4 years ago

I'm not sure I understand your question. Having a high average fold change does not necessarily mean that you will have a significant fold change. If the variance / standard deviation is also very high, you will not pass significance. Presumably this is why you see some points with a high fold change but not passing significance.

CSBioAzim commented 4 years ago

@rcorces , I completely agree. Is it possible: i) To incorporate covariates to the differential analysis (like age, sex, etc). Without regressing out the effect of covariates, the results might not be very accurate. ii) Having p-value and also SD for each peak would be very helpful as well. Currently, your function does not output it.

jgranja24 commented 4 years ago

i) This is currently a bit difficult to incorporate with the current set up.

ii) I can add p-value, but SD is tricky because certain tests dont use this. I can add it for ttest

jgranja24 commented 4 years ago

This is updated in the dev branch. Closing this issue.