Make cimDiablo legend title changeable

Hello,

It would be nice if in the cimDiablo legend the word “Expression” on the right bottom could be changeable like in the plotIndiv where it is possible to set the legend title.

As an example in the following plot, I would like to change the word “Expression” to “Storability” as my classes “bad” and “good” describe the storability of my samples and the word “Expression” is a bit misleading in this case.

Please ignore the reasonableness of the plot result itself, as it was only quickly generated to present my idea.

Best regards,
Katharina

Just a heads up that the plot you’ve shown is not the output from cimDiablo(), rather circosPlot().

I’ll see if I can quickly put together a branch for you

Ok, I’ve created a branch on the GitHub (branch "issue-260") which includes the legend.title parameter in circosPlot(). You can use it like so:

suppressMessages(devtools::load_all("D:/My Files/Work/mixOmics/mixOmics"))
data("breast.TCGA")

X <- list(mirna=breast.TCGA$data.train$mirna,
          mrna=breast.TCGA$data.train$mrna)
Y <- breast.TCGA$data.train$subtype

model <- block.splsda(X, Y)

res <- circosPlot(model, cutoff = 0.6, legend=T, line = T, legend.title = "Storability")

Created on 2022-11-15 with reprex v2.0.2

1 Like

To get this build loaded onto your local machine:

  1. Navigate to the R directory on your computer. Ensure the folder is titled like “R-X.X.X” (in my case, R-4.2.1). This can be found using the following command in RStudio:
> file.path(R.home())
[1] "D:/Programs/Work Programs/R-4.2.1"
  1. Go into this folder, then to library and look for mixOmics. Select the mixOmics folder and delete it.

  2. Load the devtools package (ensure you have it installed):

install.packages("devtools")
library(devtools)
  1. Download the package on the "master" branch:
install_github("mixOmicsTeam/mixOmics")
  1. Load the mixOmics library, and voilà!
library(mixOmics)

Great, thanks for adding this so fast!
And sorry for the wrong naming, was thinking about the right plot, but writing something different :grinning: