Not getting annotated colours in the row annotation in pheatmap
1
0
Entering edit mode
2.4 years ago

Why am I not getting annotated colours in the row annotation box for respective genes?

I am extreme new to R. Can anyone suugest better way to do this?

I have used this code for my dataset to give row annotation and color.

I have converted the .csv file to matrix and then I used folllowing codes to give row annotation and colors

#convert from df to matrix
nitro_mat <- data.matrix(nitro)

annotation_row = data.frame(GeneClass = factor(rep(c("Path1", "Path2", "Path3"), c(20, 14, 15))))

ann_colors = list(GeneClass = c(Path1 = "#7570B3", Path2 = "#E7298A", Path3 = "#66A61E"))

pheatmap(nitro_mat, scale = "row", cellwidth = 10, cellheight = 8, cluster_cols = T, annotation_row = annotation_row, annotation_colors = ann_colors)

Finally I am getting this output, why?

pheatmap image

pheatmap r • 2.9k views
ADD COMMENT
0
Entering edit mode

I've cleaned up your post and title - in the future, please ensure your post doesn't have typos and your title is clear

If you're just starting on heatmap software, I'd recommend using ComplexHeatmap instead of pheatmap - CH has better (and more well-defined) features, and the guide is comprehensive.

ADD REPLY
0
Entering edit mode

Thanks sir for your valuable response, I will take care in the future

ADD REPLY
0
Entering edit mode
2.4 years ago
seidel 11k

Your annotation_row data frame has to have the same row identifiers as your data matrix. You could probably fix it with:

rownames(annotation_row) <- rownames(nitro_mat)

and the annotation_row data frame does not need to have factor() applied to the column.

ADD COMMENT

Login before adding your answer.

Traffic: 1874 users visited in the last hour
Help About
FAQ
Access RSS
API
Stats

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.

Powered by the version 2.3.6