microbiome/mia

plotRDA feature loadings

Opened this issue · 6 comments

The mia runRDA and plotRDA do not seem to support visualizing feature loadings. This would be very useful to add.

Also in OMA chapter 7.4.1 the examples on this are very base R.

@ElySeraidarian you could check if this issue is already dealt with in the other issues/PRs?

I believe this will still not work, loadings are not stored either in rotation or loadings slot which makes it impossible for me to detect loadings without a wrapper

Should be checked if there is a bug

mia/R/runCCA.R

Line 370 in f193173

attr(ans, "rotation") <- X$v

I've tried running that code example found in OMA book and the attribute rotation is not what expected

library(mia)
data("GlobalPatterns", package = "mia") 
tse <- GlobalPatterns
tse <- transformAssay(tse, MARGIN = "cols", method="relabundance")
tse$Group <- tse$SampleType == "Feces"
tse <- runRDA(
    tse,
    assay.type = "relabundance",
    formula = assay ~ Group,
    distance = "bray",
    na.action = na.exclude)
attr(reducedDim(tse, "RDA"), "rotation")

I think we can close this:

data("enterotype", package = "mia")
> tse <- enterotype
> tse <- addCCA(
         tse,
         formula = data ~ ClinicalStatus,
       na.action = na.exclude
          )
plotLoadings(tse, "RDA", layout = "heatmap", ncomponents = 2)

Can you check that we have an example in OMA, then close?