- Joined
- Mar 12, 2013
- Messages
- 12,652
- Reaction score
- 8,429
Last edited:
Are you familiar with R and ggplot? You could make a dataframe with the point A and B averages in the first two columns, and the degree you see that combination as the 3rd. Then plot column 1 vs 2 and use geom_tile to color the combination with the values in column 3. I am on mobile but can link sample code later if you'd like
Are you familiar with R and ggplot? You could make a dataframe with the point A and B averages in the first two columns, and the degree you see that combination as the 3rd. Then plot column 1 vs 2 and use geom_tile to color the combination with the values in column 3. I am on mobile but can link sample code later if you'd like
That would be awesome. Thank you so much
-snip-
# Plotting the heatmap
ggplot(heatmap, aes(x = samp1, y=samp2)) +
geom_tile(aes(fill = overlap)) +
scale_fill_gradient(low = "white", high = "red", name = "Number of Overlapping Clonotypes") +
theme_classic() +
labs(x = "", y = "") +
ggtitle("Clonotype Overlap Between TCR Repertoires") +
geom_text(aes(fill = overlap, label = overlap))
# Creating a data frame containing the number of overlapping clonotypes for each unique combination of samples
heatmap = data.frame(
samp1 = c('+ Stim','+ Stim','+ Stim','+ Unstim','+ Unstim','- Stim'),
samp2 = c('+ Unstim','- Stim','- Unstim','- Stim','- Unstim','- Unstim'),
overlap=c(nrow(ps_pu),nrow(ps_ns),nrow(ps_nu),nrow(pu_ns),nrow(pu_nu),nrow(ns_nu))
)
Same question but does anyone know how to make a circular heatmap? (I have zero coding experience, is there a superfast way to teach myself enough to know how to use R?)
Wow, you guys are lightyears ahead of me in terms of this kinda stuff haha. I have zero background in coding/engineering and this stuff is all new to me. I was really hoping there was something where I can just plug in the numbers and it would create something for me, haha.
@Seihai can i send you a PM?