This is a test version of Biostars. For the public version, visit https://www.biostars.org.
Making a heatmap with long format data

Hi

I have a data frame of groups of my patients, genes and related pathways like

> dput(head(data))
structure(list(gene = c("CCL22", "CCL22", "CCL22", "CCL22", "CCL27", 
"CCL27"), value = c(6.64466666666667, 
6.62, 6.2688, 6.34074074074074, 2.076, 0.467727272727273), Pathway = c("Cytokine-cytokine receptor interaction", 
"Cytokine-cytokine receptor interaction", "Cytokine-cytokine receptor interaction", 
"Cytokine-cytokine receptor interaction", "Cytokine-cytokine receptor interaction", 
"Cytokine-cytokine receptor interaction")), row.names = c(NA, 
-6L), class = c("tbl_df", "tbl", "data.frame"))
> 
> length(unique(data$gene))
[1] 44
> unique(data$Pathway)
[1] "Cytokine-cytokine receptor interaction" "IL-17 signaling"                        "NF-kappa B signaling"                  
[4] "TNF signaling "                         "PI3K-Akt signaling "  


>    
> dim(data)
[1] 392   4
>

How can I create a heatmap like this

enter image description here

Where categories are my pathways and treatment my groups

r

You have two structures: data and dd. Understand the difference between the two.

Pick a heatmap package (preferably CoomplexHeatmap) and start by passing your data to a simple heatmap object, then add enhancements step by step.

Show us exactly what you've tried and where you need help, and we will be in a better position to help you.

0 answers

No answers yet.

Log in to answer this question.