ggloor / ALDEx2_dev

ALDEx tool to examine compositional high-throughput sequence data with Welch's t-test
GNU Affero General Public License v3.0
12 stars 6 forks source link

Use aldex.glm to plot with aldex.plot #15

Closed alopgar closed 4 years ago

alopgar commented 4 years ago

Hello, I would like to know if it is possible to take aldex.glm results to plot them in the same way you do with a ttest and aldex.effect outputs.

As far as I tried, aldex.effect won't run with a multi-level glm model, in my case:

mm <- model.matrix(~ NLACTA + DIASLE + CH4_Rank, metadataset)

Being NLACTA and DIASLE numeric parameters and CH4_Rank a 4-level factor (HIGH, H_MID, L_MID, LOW).

I am interested only in one pairwise contrast: HIGH vs LOW, but with the clr transformation from all the dataset, not only the HIGH-LOW subcomposition. So I tried using aldex.glm, but the output is not similar at all to the one from aldex.ttest + aldex.effect, so I wonder how can I plot it in a similar way.

ggloor commented 4 years ago

Hi,

Please open a feature request in ALDEx_bioc for this

currently, this is not coded into the aldex.effect function. It would be possible to have aldex.effect generate an output on each contrast so that the user can display them.

A workaround would be to generate the aldex.clr object using the desired contrast, then the aldex.effect object. From there, it is easy to plot using the following code snippet that assumes x.e is the output with the desired contrast. In my case the column name is model.B Pr(>|t|).BH that contains the contrast I want to plot, and it is the last column in the aldex.glm output object.

sig <- glm.test[,15] < 0.05 plot(x.e$diff.win, x.e$diff.btw, pch=19, cex=0.3, col=rgb(0,0,0,0.2), lab="Disp", ylab="Diff") points(x.e$diff.win[sig], x.e$diff.btw[sig], pch=19, cex=0.5, col=rgb(1,0,0,0.4)) abline(0,1) abline(0,-1)