Skip to content

Commit

Permalink
bug fix: keep only relevant annotations in prettyOncoplot
Browse files Browse the repository at this point in the history
  • Loading branch information
Kdreval committed Jan 30, 2024
1 parent 8cbdddc commit ad92d16
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions R/prettyOncoplot.R
Original file line number Diff line number Diff line change
Expand Up @@ -691,6 +691,13 @@ prettyOncoplot = function(maf_df,
drop = FALSE
]
}

# Only keep the annotation colors for the remaining patients
for(column in colnames(metadata_df)){
remaining <- unique(metadata_df[column] %>% mutate_if(is.factor, as.character)) %>% pull()
colours[[column]] <- (colours[column] %>% unname %>% unlist)[remaining]
}

ch = ComplexHeatmap::oncoPrint(mat[intersect(genes, genes_kept),patients_kept],
alter_fun = alter_fun,
top_annotation = top_annotation,
Expand Down

0 comments on commit ad92d16

Please sign in to comment.