Skip to content

Commit

Permalink
Merge pull request #36 from morinlab/kdreval-viz-setup
Browse files Browse the repository at this point in the history
bug fix: keep only relevant annotations in prettyOncoplot
  • Loading branch information
Kdreval authored Jan 31, 2024
2 parents 8cbdddc + ad92d16 commit e4bbc78
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 e4bbc78

Please sign in to comment.