david-barnett/microViz

how can i order my samples and show their names?

we32i225 opened this issue · 3 comments

Hello, i am using the comp_heatmap function and have been able to generate a heat map. However, i would like to show the names of each sample on the column axis and order the columns according to the metadata from the phlyoseq object used to create the heatmap.

the code tried: physeq_no1percent %>% tax_transform("compositional", rank = "genus") %>%
comp_heatmap( sample_anno = sampleAnnotation(
State1 = anno_sample("sample")))

This displays the correct sample names but they are not ordered in any way, can i re-order the columns as well as add the sample names above each column?

many thanks
Will

this new example should hopefully help you with the sample ordering (see the section "arranging samples")

https://david-barnett.github.io/microViz/articles/web-only/heatmaps.html#arranging-samples

oh and for showing the sample names, add sample_names_show = TRUE to the comp_heatmap call

Hi David, just tried this and its exactly what i was looking for !
many thanks
Will