Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

DynamicHeatmap 怎么自定义细胞注释的颜色 #266

Open
pengpengyang94 opened this issue Dec 16, 2024 · 0 comments
Open

DynamicHeatmap 怎么自定义细胞注释的颜色 #266

pengpengyang94 opened this issue Dec 16, 2024 · 0 comments

Comments

@pengpengyang94
Copy link

我想自定义 DynamicHeatmap 中细胞注释的颜色,我看到函数里面也有 separate_annotation_palcolorcell_annotation_palette 这两个参数,但是使用的时候回出现如下报错。

Error in DynamicHeatmap(srt = obj, use_fitted = TRUE, lineages = paste0("Lineage",  : 
  separate_annotation_palette and separate_annotation_palcolor must be the same length as separate_annotation

我运行的代码如下,数据中包含4种细胞类型,只要不运行 separate_annotation_palcolorcell_annotation_palette函数,可以正常出图。

cols <- c('#e41a1c','#377eb8','#4daf4a','#984ea3','#ff7f00','#a65628','#f781bf')
ht <- DynamicHeatmap(
  srt = obj, use_fitted = TRUE,
  lineages = paste0("Lineage", 1:3),
  n_split = 5, split_method = "kmeans-peaktime",
  cell_annotation = "celltype2", 
  # cell_annotation_palcolor = cols, cell_annotation_palette = NULL,
  separate_annotation = "celltype2",
  separate_annotation_palette = NULL, separate_annotation_palcolor = cols,
  height = 5, width =4
)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant