zhanghao-njmu / SCP

An end-to-end Single-Cell Pipeline designed to facilitate comprehensive analysis and exploration of single-cell data.
https://zhanghao-njmu.github.io/SCP/
GNU General Public License v3.0
357 stars 81 forks source link

GroupHeatmap might not correctly assigning colors to each group #142

Closed synapse73 closed 1 year ago

synapse73 commented 1 year ago

Hello Zhanghao, I wanted to reach out and express my appreciation for your package as I have been thoroughly enjoying using it.

However, I recently encountered an issue while using the “GroupHeatmap” function. It seems that the “group_palcolor” parameter doesn’t correctly assign colors to each group. Instead, only the first color specified in the parameter is applied to all groups.

I would greatly appreciate your assistance in resolving this issue. Thank you in advance for your help.

Below is the code I am using:

ht <- GroupHeatmap( srt = obj, features = genes, group.by = c("celltype"), group_palcolor= c('#E69F00','#56B4E9','#009E73','#F0E442','#0072B2','#D55E00'), heatmap_palette = "YlOrRd", cell_annotation = c("Phase"), cell_annotation_palette = c("Set2"), show_row_names = TRUE, row_names_side = "left", add_dot = TRUE, add_reticle = FALSE, split.by="Sample",cell_split_palcolor=c('orange',"navy"), dot_size = unit(8, "mm") )

For reference, I have attached a figure showing the current output. CleanShot 2023-08-10 at 20 59 15@2x

hejian41 commented 1 year ago

The group_palcolor should be a list of charaters. group_palcolor= list(c('#E69F00','#56B4E9','#009E73','#F0E442','#0072B2','#D55E00'))

synapse73 commented 1 year ago

🤡 thank you. I appreciate your help and will take note of using the correct object type in R.