caitiecollins / treeWAS

treeWAS: A Phylogenetic Tree-Based Tool for Genome-Wide Association Studies in Microbes
Other
92 stars 18 forks source link

Error in phangorn dependency - non-binary tree #46

Closed mycologenomics closed 4 years ago

mycologenomics commented 4 years ago

Hiya,

I'm trying to run treeWAS on my own tree (RAxML), but I'm getting the following error:

Error in fitch.phangorn(tree, x.phyDat, site = "site") : Tree must be binary!

I have a three way split at the base of my tree - is there any way to force this through?

Thanks

xavierdidelot commented 4 years ago

Hi Jo,

Presumably the three way split at the base of the tree is there to indicate that the tree is unrooted? In that case you could simply root the tree using phangorn::midpoint and all should be fine. It does not actually matter where the root is, but the input tree has to be rooted.

Alternatively, if it's not just about the rooting, you could resolve non binary splits using ape::multi2di

Best wishes, Xavier

mycologenomics commented 4 years ago

Thanks Xav! The ape fix works :)

On 26 Feb 2020, at 17:54, Xavier Didelot notifications@github.com<mailto:notifications@github.com> wrote:

ape::multi2di