Question: sc3_plot_expression, colour labels
gravatar for cfustero
2.4 years ago by
Madrid (Spain)
cfustero20 wrote:


I have been using the "SC3" R package to analyse single cell expression data. We expect to find four different groups of cells within our data, so I've included a column corresponding to our cell labels.
When using the sc3_plot_expression, our cell labels are coloured automatically, but the colours are really similar between each other and it's hard to discern between groups. Is there any parameter I can use to manually adjust the label colours?

Thanks a lot!

single-cell sc3 • 538 views
ADD COMMENTlink modified 2.4 years ago by Vladimir Kiselev150 • written 2.4 years ago by cfustero20
Answer: sc3_plot_expression, colour labels
gravatar for Vladimir Kiselev
2.4 years ago by
Sanger Institute, Cambridge, UK
Vladimir Kiselev150 wrote:


Unfortunately, it is not possible through sc3_plot_expression itself. However, since all heatmaps in SC3 are based on the pheatmap package, you can use the source code of sc3_plot_expression and add some manual colour annotations to it via pheatmap arguments.

So if object is your scater object and k is the number of clusters (4 in your case) then you can plot the expression matrix (without coloured cell labels) using this code:


hc <- object@sc3$consensus[[as.character(k)]]$hc
dataset <- get_exprs(object, "exprs")

    cluster_cols = hc, 
    kmeans_k = 100, 
    cutree_cols = k, 
    show_rownames = FALSE, 
    show_colnames = FALSE

Then you will need to add both annotation_col and annotation_colors arguments to the last pheatmap call. For mored details and examples on how to do it please refer to the pheatmap documentation using:

ADD COMMENTlink modified 2.4 years ago • written 2.4 years ago by Vladimir Kiselev150

Thanks a lot for your quick response, Vladimir!

ADD REPLYlink modified 2.4 years ago • written 2.4 years ago by cfustero20
Please log in to add an answer.


Use of this site constitutes acceptance of our User Agreement and Privacy Policy.
Powered by Biostar version 16.09
Traffic: 242 users visited in the last hour