Skip to content

Commit

Permalink
bug fix: handling of custom colors for numeric annotations
Browse files Browse the repository at this point in the history
  • Loading branch information
Kdreval committed Jun 18, 2024
1 parent cabfacf commit 0d1e234
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions R/prettyOncoplot.R
Original file line number Diff line number Diff line change
Expand Up @@ -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],
Expand Down

0 comments on commit 0d1e234

Please sign in to comment.