Hi all, I am using ggtree and gheatmap to visualize a tree in R. Tree was generate using phylophlan. I generated the tree in the following manner:
tree2 <- read.tree("mytree.tre")
x <- ggtree(tree2, layout="circular")
Load the metadata file
dd=read.table('metadata.tsv', header=T,check.names=FALSE, sep = "\t")
p1 <- gheatmap(x, dd, width=0.2, offset=0.8, color = NA, colnames_angle=90, colnames_offset_y = 0.25) + scale_fill_viridis_d(option="D", name="Phylum")
The phylum column in my metadata has no NAs. However the plot formed shows all phylum names and NAs too. This results in separate lines in my heatmap instead of continous bars (see attached).
Can anyone help me with what the issue could be here? Why the NAs are present and how to get rid of them?
Any help would be appreciated, thank you. Best DP