How do I add a colour annotation bar to the heatmap generated by DoHeatmap function of Seurat v2?
I am not sure if it's a v3 or also v2 thing, but have you tried by setting group.by and label?

From ?Seurat::DoHeatmap:

group.by   A vector of variables to group cells by; pass 'ident' to group by cell identity classes
label      Label the cell identies above the color bar


If you prefer external tools, you can use pheatmap and setting annotation_col e annotation_colors.

First define a data.frame (df) containing the data you want in the bar (clusters in your case)

Description Condition
liver       Tumour
lung        Normal


Then you have to assign the colours

anno &lt;- as.data.frame(df)
anno_colori &lt;- list(
   Condition = c(Normal = '#FFC000', Tumour = '#0070C0'),
   Description = c(liver = '#D55E00', lung = '#66CC99')
)

pheatmap(mat,
     annotation_col = anno,
     annotation_colors = anno_colori,
)


The code above will add 2 bars on the top of your heatmap, one for Condition and another for Description.