mixOmicsTeam / mixOmics

Development repository for the Bioconductor package 'mixOmics '
http://mixomics.org/
157 stars 52 forks source link

Ellipses colour do not match plot points colour #307

Open qutkat opened 4 months ago

qutkat commented 4 months ago

Hello - I am trying to run an sPLSDA showing beta diversity data for 3 different weeks. When the plot is produced the ellipses are correct for all 3 weeks, but the colour of the data points for 2 of the weeks does not match the colour of the ellipses - they are switched around. I tried restarting Rstudio and reloading mixOmics from github but it is still happening.

betaplot$Week <- factor(betaplot$Week, levels = c("1", "5", "11"), labels = c("Week 1", "Week 5", "Week 11")) taxon = taxa %>% rownames_to_column('Sample ID') %>% semi_join(betaplot, taxa, by = 'Sample ID') %>% column_to_rownames('Sample ID')

result = splsda(taxon, betaplot$Week, ncomp = 2, keepX = c(466,466)) plot = plotIndiv(result,centroid = FALSE, ellipse = TRUE,ind.names = FALSE, title = "sPLSDA - Beta diversity by Week", legend=TRUE)

I have tried to upload the resulting image here: Capture

qutkat commented 4 months ago

Hello - please note that I also tried running your Case Study of sPLS-DA with SRBCT dataset using the exact code provided and I encountered the same issue. The blue and orange data points were switched around and did not match the image provided in the tutorial, but the ellipses were correct.

samuelmontgomery commented 2 months ago

I am having the same issue (and have for a few versions now but it seems to have not been fixed) when using plotIndiv - I much prefer using mixOmics for my work, but I am having to find alternative for plotting results at the moment as it makes it hard to interpret