ggloor/ALDEx_bioc

aldex.corr giving unexpected results

Opened this issue · 2 comments

Hi,

I have a matrix with read counts for 91 samples per KEGG module.
I wanted to calculate the correlation with salinity, which I did as follows:

conditions <- model.matrix(~salinity, metadata)
x <- aldex.clr(reads= t(module_counts), conditions, mc.samples=1000, denom="all", verbose=F)
x.corr.modules <- aldex.corr(x, metadata$salinity)

In the results, I see for example that module M00015 has a Pearson correlation of 0.2924729 and this is significant (Pearson.eBH = 2.896241e-02)
If I plot the CLR transformed counts for module M00015 across salinity (ranging from 0-30) however, the correlation looks to be negative rather than positive (if it is significant at all):
image

Is there something I am doing wrong?

ggloor commented

this is unexpected. what is the correlation of the plot you show? it could simply be a direction issue
I will check the code to see if aldex.corr accepts a mm, but if it did not throw an error that is likely not the problem

The Pearson correlation of the plot is -0.2542577, spearman = -0.3036871, and kendall = -0.1935915 (uncorrected for multiple comparisons).
Whereas the aldex.corr results give pearson correlation = 0.2925046, spearman rho = 0.2933636, and kendall tau = 0.1961180 (all are significant when BH corrected).