Entering edit mode
7.6 years ago
Tonny
▴
20
I'd like to plot a multiple gheatmap with a phylogenetic tree using ggtree and facet_plot. my data is like this:
>head(resis)
A B C
1 SAMN00138235 MphC 0
2 SAMN00138235 MecR1 0
3 SAMN00138235 Aac6Ie 0
4 SAMN00138235 AadD 0
5 SAMN00138235 aad9Ib 0
6 SAMN00138235 BcrA 0
as following codes:
p1 <- ggtree(tree)
## ST type
p2 <- facet_plot(p1, panel='ST Type', ST, geom_tile, aes(x=as.numeric(as.factor(B)), fill=as.factor(C)))
## Antibiotic Resistance
p3 <- facet_plot(p2, panel='Antibiotic Resistance', resis, geom_tile, aes(x=as.numeric(as.factor(B)), fill=as.factor(C)))
## Virulence
p4 <- facet_plot(p3, panel="Virulence Factor", virulence, geom_title, aes(x=as.numeric(as.factor(B)), fill=as.factor(C))) + theme_tree2(legend.position='bottom')
How could I add the column names for the heatmap?