Scale parameter in cim function has no effect


I have analyzed methylation data using mixOmics. Methylation signal obtained with RRBS technic consists in a methylation percentage for each CG genomic position studied. Therefore, the methylation is always positive.

After having applied a SPLS/DA, I wanted to visualize selected variables using cim function. I was quite astonished to see a color scale gradient starting at a negative value.

I tried to use scale parameter (TRUE/FALSE), but it had no effect : the gradient still started at a negative value.

I realized (with the help of S.Dejean) that scale parameter in splsda has TRUE for defaut value. Therefore, I got a scaled matrix after having applied splsda and when I pass it to cim, the scale parameter of this function has no more effect.

Can you confirm this interpretation ?
Thank you in advance

Best regards

In fact, if we set scale parameter to FALSE in splsda AND cim, we still begin the gradient with a negative value.

So the explanation above does not seem to be the right one.

Best regards

Hi @ljouneau,

Thank you for posting your question.

Please note that cim uses the reduced dimensions to create the plot. If you wish to visualise the original values you can simply input the X matrix into the cim function. You can find the extensive elaboration of this in ?cim. Please see the example below.

#> Loading required package: MASS
#> Loading required package: lattice
#> Loading required package: ggplot2
#> Loaded mixOmics 6.14.0
#> Thank you for using mixOmics!
#> Tutorials:
#> Bookdown vignette:
#> Questions, issues: Follow the prompts at
#> Cite us:  citation('mixOmics')
X <- breast.tumors$gene.exp
# create toy methylation data from [0,1]
X <- matrix(sample(x = seq(0,1,0.01), size = length(X), replace = TRUE), nrow = nrow(X), dimnames = dimnames(X))
Y <- as.factor(breast.tumors$sample$treatment)
res <- splsda(X, Y, ncomp = 2, keepX = c(25, 25))
# this will plot the matrix created using PLS variates
cim(res, comp = 1)

cim(res, comp = 1:2)

# this is the cim of the original matrix where only the selected features on the first component are shown & there are no negative values
selected.comp1 <- selectVar(res, comp = 1)$name

cim(X[,selected.comp1], symkey = FALSE)

Created on 2021-04-07 by the reprex package (v2.0.0)

Hope it helps,