Skip to content

Ordering heatmap columns #116

Answered by david-barnett
KidneyNode asked this question in Q&A
Discussion options

You must be logged in to vote

Yes, you can set the sample_seriation argument to the "Identity" method, which keeps the samples in the original order.

You can sort the samples beforehand using ps_arrange and whichever variable(s) in the sample data you like, e.g.

data("dietswap", package = "microbiome")
dietswap %>%
    ps_filter(timepoint == 2) %>% 
    tax_agg("Genus") %>% 
    tax_sort(by = sum) %>%
    ps_arrange(nationality, sample) %>% 
    comp_heatmap(taxa = 1:20, sample_seriation = "Identity", sample_names_show = TRUE)

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@KidneyNode
Comment options

Answer selected by david-barnett
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants