scRNAtoolVis安装多次报错,分享我摸索出的安装方法,并附加自定义averageHeatmap常用参数,在此感谢俊俊老师!
# 安装
download.file("https://github.com/junjunlab/scRNAtoolVis/archive/master.zip", "scRNAtoolVis.zip")
unzip("scRNAtoolVis.zip")
install.packages("scRNAtoolVis-master", repos = NULL, type = "source")
# 如提示需附加packages,可执行以下命令
devtools::install_github("sajuukLyu/ggunchull", type = "source")
devtools::install_github('junjunlab/jjAnno')
devtools::install_github('junjunlab/jjPlot')
install.packages('geomtextpath')
install.packages('ggh4x')
# 加载scRNAtoolVis包
library(scRNAtoolVis)
#创建颜色向量
celltype_colors <- RColorBrewer::brewer.pal(n = length(unique(yourobject$celltype)), name = "Paired")
#画图
p1=averageHeatmap(object = yourobject,
markerGene = top5$gene,
group.by = 'celltype',
gene.order = top5$gene,
column_split = 1:7,#分割列
annoCol = T,#是否自定义注释集群颜色,默认是F,需修改为T,方可自定义
myanCol = celltype_colors,#自定义注释集群颜色
row_split = paste("cluster",top5$cluster,sep = ' '),#分割行
border = T)
p1
#大功告成
#其他自定义项目
averageHeatmap(
object = NULL,
markerGene = NULL,
group.by = "ident",
assays = "RNA",
slot = "data",
htCol = c("#0099CC", "white", "#CC0033"),
colseed = 666,
htRange = c(-2, 0, 2),
annoCol = FALSE,
myanCol = NULL,
annoColType = "light",
annoColTypeAlpha = 0,
row_title = "Cluster top Marker genes",
clusterAnnoName = TRUE,
showRowNames = TRUE,
row_names_side = "left",
markGenes = NULL,
border = FALSE,
fontsize = 10,
column_names_rot = 45,
width = NULL,
height = NULL,
cluster.order = NULL,
cluster_columns = FALSE,
cluster_rows = FALSE,
gene.order = NULL)