diff --git a/R/prettyOncoplot.R b/R/prettyOncoplot.R index 6c08681..63520e7 100644 --- a/R/prettyOncoplot.R +++ b/R/prettyOncoplot.R @@ -700,8 +700,10 @@ prettyOncoplot = function(maf_df, replace(is.na(.), "NA") # Only keep the annotation colors for the remaining patients for(column in colnames(metadata_df)){ - remaining <- unique(metadata_df[column]) %>% pull() - colours[[column]] <- (colours[column] %>% unname %>% unlist)[remaining] + if((!missing(numericMetadataColumns)) & (!column %in% numericMetadataColumns)){ + remaining <- unique(metadata_df[column]) %>% pull() + colours[[column]] <- (colours[column] %>% unname %>% unlist)[remaining] + } } ch = ComplexHeatmap::oncoPrint(mat[intersect(genes, genes_kept),patients_kept],