This is a test version of Biostars. For the public version, visit https://www.biostars.org.
issue with visualising cladogram/phylogenetic tree with multiple sequence alignment data in R?

I would like to visualize tree with multiple sequence alignment. So, I have followed the following code in R. 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)
tree = read.tree("din.newick") 
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.

r bioconductor alignment r sequencing

@SMK, hereafter I would not repeat this mistake.

No problem, just remember to cross-reference at both sites.

2 answers

Something like this?

ggtree

By:

msaplot(p = ggtree(tree) + geom_tiplab(align = TRUE, hjust = 1, vjust = -1), fasta = "din.fasta")

@SMK, It works fine. Thank you.

Check the ggmsa R package written by Dr. Yu Guangchuang's lab. It may help you. http://yulab-smu.top/ggmsa/articles/ggmsa.html

Log in to answer this question.