> pheatmap(cellratio,show_colnames=T,show_rownames=T,annotation_row = annotation_row,annotation_colors = ann_colors)#,annotation_colors=ann_colors)
Error in if (!(names(annotation)[i] %in% names(annotation_colors))) { :
argument is of length zero
查看annotation_row类型,发现不是data.frame,改后成功
> class(annotation_row)
[1] "matrix" "array"
> annotation_row=as.data.frame(annotation_row)
> pheatmap(cellratio,show_colnames=T,show_rownames=T,annotation_row = annotation_row,annotation_colors = ann_colors)#,annotation_colors=ann_colors)
>