From 2828727dc3f2f0d14438130df5191efb7218aa17 Mon Sep 17 00:00:00 2001 From: Roy Lardenoije <39619971+lardenoije@users.noreply.github.com> Date: Thu, 12 Dec 2019 18:07:46 +0100 Subject: [PATCH] Added compatibility with logical pheno variables When the pheno variable is a logical vector it interfered with the color selection for the dendrogram labels when not converted to the character class. --- R/champ.QC.R | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/R/champ.QC.R b/R/champ.QC.R index c33d265..46bbdd3 100644 --- a/R/champ.QC.R +++ b/R/champ.QC.R @@ -66,9 +66,9 @@ champ.QC <- function(beta = myLoad$beta, dend <- as.dendrogram(hc) MyColor <- rainbow(length(table(pheno))) names(MyColor) <- names(table(pheno)) - labels_colors(dend) <- MyColor[pheno[order.dendrogram(dend)]] + labels_colors(dend) <- MyColor[as.character(pheno[order.dendrogram(dend)])] dend <- dend %>% set("labels_cex",0.8) - dend <- dend %>% set("leaves_pch", 19) %>% set("leaves_cex",0.6) %>% set("leaves_col",MyColor[pheno[order.dendrogram(dend)]]) + dend <- dend %>% set("leaves_pch", 19) %>% set("leaves_cex",0.6) %>% set("leaves_col",MyColor[as.character(pheno[order.dendrogram(dend)])]) if(Rplot) {