New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
plotDiablo - group colours #119
Comments
Hi @chongchunwie, Thanks for reporting this. I think I fixed it in my devel which will soon be available on all platforms. You can install using data('breast.TCGA')
Y = breast.TCGA$data.train$subtype
data = list(mrna = breast.TCGA$data.train$mrna,
mirna = breast.TCGA$data.train$mirna, prot = breast.TCGA$data.train$protein)
# set number of component per data set
ncomp = 3
# set number of variables to select, per component and per data set (arbitrarily set)
list.keepX = list(mrna = rep(20, 3), mirna = rep(10,3), prot = rep(10,3))
# DIABLO using a full design where every block is connected
BC.diablo = block.splsda(X = data, Y = Y, ncomp = ncomp, keepX = list.keepX, design = 'full')
## default col.per.group
plotDiablo(BC.diablo, ncomp = 1, legend = TRUE, col.per.group = NULL) ## custom col.per.group
col.per.group <- viridisLite::viridis(3)
names(col.per.group) <- levels(Y)
plotDiablo(BC.diablo, ncomp = 1, legend = TRUE, col.per.group = col.per.group) Created on 2021-01-18 by the reprex package (v0.3.0) |
@aljabadi It seems like there is a mismatch between colors and group in the devel. |
@aljabadi best, |
@SchererFIMM @Christoab thanks for pointing this out, not sure how I missed that obvious bug. This should work as expected now. Please follow the installation instruction above. data('breast.TCGA')
Y = breast.TCGA$data.train$subtype
data = list(mrna = breast.TCGA$data.train$mrna,
mirna = breast.TCGA$data.train$mirna, prot = breast.TCGA$data.train$protein)
# set number of component per data set
ncomp = 3
# set number of variables to select, per component and per data set (arbitrarily set)
list.keepX = list(mrna = rep(20, 3), mirna = rep(10,3), prot = rep(10,3))
# DIABLO using a full design where every block is connected
BC.diablo = block.splsda(X = data, Y = Y, ncomp = ncomp, keepX = list.keepX, design = 'full')
## default col.per.group
plotDiablo(BC.diablo, ncomp = 1, legend = TRUE, col.per.group = NULL) ## custom col.per.group
col.per.group <- viridisLite::viridis(3)
names(col.per.group) <- levels(Y)
plotDiablo(BC.diablo, ncomp = 1, legend = TRUE, col.per.group = col.per.group) Created on 2021-04-10 by the reprex package (v2.0.0) |
Thank you so much for your great help, it works well for me now. |
Just wondering how to change the colours of the group under plotDiablo. I have tried col.per.group and col, but to no avail.
The text was updated successfully, but these errors were encountered: