# Issue with visualising cladogram/phylogenetic tree with multiple sequence alignment data in R?

I would like to visualize tree with multiple sequence alignment. My din.newick file is shown below,

(org1:0.49999997,org2:0.47298786,org3:28.37858179);


My din.fasta alignment file shown below,

>org1
ATGCTA
>org2
TAGCAT
>org3
AGTAGT


I have tried the following code,

library(tidyverse)
library(ggtree)
library(seqinr)
msaplot(p=ggtree(tree), fasta = "din.fasta")
msaplot(p=ggtree(tree) + geom_tiplab(align=TRUE), fasta = "din.fasta")


The above mentioned code is generating tree with the alignment matrix, but the tree root tip labels are not visible. It is either overlapped with matrix or it is not at all visible. Kindly help me to fix this issue.

You were very close, you just need to supply the offset argument to msaplot().

So using your code block above with one extra argument in msaplot()

library(tidyverse)
library(ggtree)
library(seqinr)
msaplot(p=ggtree(tree), fasta = "din.fasta")
msaplot(p=ggtree(tree) + geom_tiplab(align=TRUE), fasta = "din.fasta", offset = 5)


yields

Thank you for supplying a minimal and reproducible example!

• Thank you @Kohl Kinning. – K. Dineshkumar Jun 18 '19 at 4:45

I suspect the solution is to realign the two plots within "ggarrange", available here

The problem is stacking ggtree with geom_tiplab. The ggarrange library is described on STHDA here

I have not used this library however, but it should be easy because you are working singly within R. I tend to use ggplot2 within Python via rpy2, which is much more difficult and restricted.