aifimmunology / MOCHA

R package for single-cell Open Chromatin Identification & Downstream Analysis
https://aifimmunology.github.io/MOCHA/
GNU General Public License v3.0
2 stars 0 forks source link

wCorr dependency #110

Closed imran-aifi closed 1 year ago

imran-aifi commented 1 year ago

https://github.com/aifimmunology/MOCHA/blob/4d5013d066021fbedad515e262627b9f6127d780/DESCRIPTION#L58

We may need to specify wCorr version as a new update makes it symmetric. From the maintainer:

I updated wCorr to have a Spearman correlation coefficient that is symmetric about zero so

cor(x,y) = - cor(-x,y) = - cor(x,-y)

However, it only seems like we use wCorr when NOT doing ZI correlations:

https://github.com/aifimmunology/MOCHA/blob/4d5013d066021fbedad515e262627b9f6127d780/R/zi_spearman.R#L54

Can we remove this dependency entirely?

markphillippebworth commented 1 year ago

We also use wCorr for the ZI Spearman

rho_11 <- wCorr::weightedCorr(x = x[pospos], y = y[pospos], weights = w[pospos], method = "Spearman")](https://github.com/aifimmunology/MOCHA/blob/4d5013d066021fbedad515e262627b9f6127d780/R/zi_spearman.R#L69)

imran-aifi commented 1 year ago

Got it, I missed that. Based on the newest wCorr update 1.9.6:

I updated wCorr to have a Spearman correlation coefficient that is symmetric about zero so

cor(x,y) = - cor(-x,y) = - cor(x,-y)

should we enforce >-1.9.6 or enforce using an older version?