Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

as.treedata sequence length #91

Open
antoine4ucsd opened this issue Dec 14, 2022 · 1 comment
Open

as.treedata sequence length #91

antoine4ucsd opened this issue Dec 14, 2022 · 1 comment

Comments

@antoine4ucsd
Copy link

hello
thank you for your nice package
I am trying to use it in order to plot my tree along with aminoacid sub (with ggtree).
My input are a nt alignment of 130 sequences and its phylo. the alignement contains some gaps.

My code

sampletree=read.tree(mytree)
tre=midpoint.root(sampletree)
tipseq <- read.phyDat("myfasta.fasta",format="fasta")
fit <- pml(tre, tipseq, k=4)
fit <- optim.pml(fit, optNni=FALSE, optBf=T, optQ=T,
                 optInv=T, optGamma=T, optEdge=TRUE,
                 optRooted=FALSE, model = "GTR")

pmltree <- treeio::as.treedata(fit)
ggtree(pmltree) + geom_text(aes(x=branch, label=AA_subs, vjust=-.5))

but I get this error with treeio::as.treedata(fit):

Error in getSubsLabel(seqs, label[pp[i]], label[i], translate, removeGap) : 
  seqA should have equal length to seqB

any suggestions?
thank you ++

@GuangchuangYu
Copy link
Member

you should provide example data to reproduce this issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants