Hello everyone,
I have generated a heatmap for a specific list of marker genes I am interested in using the code below:
genesofinterest <- c("ENSG00000170017", "ENSG00000088836", "ENSG00000080493", "ENSG00000164879", "ENSG00000143248", "ENSG00000232995", "ENSG00000124205", "ENSG00000152154", "ENSG00000116675", "ENSG00000180340", "ENSG00000066468", "ENSG00000139329", "ENSG00000139330", "ENSG00000011465", "ENSG00000026025", "ENSG00000039068", "ENSG00000186081", "ENSG00000175793", "ENSG00000189334", "ENSG00000196878", "ENSG00000073282", "ENSG00000186847", "ENSG00000171346", "ENSG00000135925", "ENSG00000196754", "ENSG00000166670", "ENSG00000175063", "ENSG00000123975", "ENSG00000051128", "ENSG00000106066", "ENSG00000171401", "ENSG00000170477", "ENSG00000171345", "ENSG00000205420", "ENSG00000148346", "ENSG00000143546", "ENSG00000187242", "ENSG00000186442", "ENSG00000167916", "ENSG00000197353")
genesofinterest <- assay(rld.sm)[genesofinterest, ]
mart <- useMart("ensembl","hsapiens_gene_ensembl")
gns <- getBM(c("hgnc_symbol","ensembl_gene_id"), "ensembl_gene_id", row.names(genesofinterest), mart)
row.names(genesofinterest)[match(gns[,2], row.names(genesofinterest))] <- gns[,1]
genesofinterest <- genesofinterest - rowMeans(genesofinterest)
anno <- data.frame(Diagnosis = rld.sm$diagnosis)
row.names(anno) <- row.names(coldata)
pheatmap(genesofinterest, annotation_col = anno, labels_col=paste(dds.sm$name))
Can someone please assist me as to how I can add row annotations to this heatmap to group genes by their cell marker types?
I'm hoping to generate something similar to this figure: https://media.springernature.com/lw685/springer-static/image/art%3A10.1038%2Fs41598-021-01015-w/MediaObjects/41598_2021_1015_Fig2_HTML.png?as=webp
Many thanks
Nathan