How to add column name in facet_plot of ggtree
1
0
Entering edit mode
7.0 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?

image created with ggtree and facet_plot

ggtree ggplot2 heatmap R • 2.7k views
ADD COMMENT

Login before adding your answer.

Traffic: 1777 users visited in the last hour
Help About
FAQ
Access RSS
API
Stats

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.

Powered by the version 2.3.6