Entering edit mode
4.9 years ago
zizigolu
★
4.3k
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
Where categories are my pathways and treatment my groups
You have two structures:
data
anddd
. 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.
Hello A!
It appears that your post has been cross-posted to another site: https://bioinformatics.stackexchange.com/questions/11374/converting-this-data-frame-to-a-heatmap
This is typically not recommended as it runs the risk of annoying people in both communities.