Entering edit mode
4 months ago
clfiore
•
0
Hello
I have run the phangorn code from here previously without a problem: https://f1000research.com/articles/5-1492/v1
However I just updated the taxonomy to my dada2 object and so I am rerunning phangorn (no change to sequence number just the associated taxonomy). I am getting an error that I cannot figure out what it means exactly and what I need to do about it, and have not found any online posts about this one:
The error is:
Error in optim.pml(fitGTR, model = "GTR", optInv = TRUE, optGamma = TRUE, :
rooted / unrooted tree needs at least 2 / 3 tips
The previous steps in my code are:
seqs <- getSequences(seqtab.nochim)
names(seqs) <- row.names(taxa)
mult <- msa(seqs, method="ClustalW", type="dna", order="input")
phang.align <- as.phyDat(mult, type="DNA", names=getSequence(seqtab.nochim))
dm <- dist.ml(phang.align)
treeNJ <- NJ(dm) # creat NJ tree
fit = pml(treeNJ, data=phang.align)
fitGTR <- update(fit, k=4, inv=0.2)
fitGTR <- optim.pml(fitGTR, model="GTR", optInv=TRUE, optGamma=TRUE,
rearrangement = "stochastic", control = pml.control(trace = 0))
# Also when I print 'treeNJ' to check tips, it is this:
Phylogenetic tree with 1359 tips and 1357 internal nodes.
Tip labels:
Dada1, Dada2, Dada3, Dada4, Dada5, Dada6, ...
Unrooted; includes branch lengths.
Thank you for any suggestions!