KlausVigo / phangorn

Phylogenetic analysis in R
http://klausvigo.github.io/phangorn/
203 stars 38 forks source link

unexpected tiplabels behavior using network imported from splitstree #88

Open tim-oconnor opened 5 years ago

tim-oconnor commented 5 years ago

Hello!

I'm trying to plot a network imported from SplitsTree. When I simply plot the network, all tips appear to be labeled.

plot(test2, "2D", show.tip.label = T, edge.width = .5, cex = .5)

net1.pdf

However, if I initially omit the tip labels and try to add them back later, some of the tips are skipped. An example node is circled in the plot above.

plot(test2, "2D", show.tip.label = F, edge.width = .5)
tiplabels(pch = 16, col = "red")

net2.pdf

The tip originally labeled "E18-338" does not get a red circle.

I've only noticed this with the very shortest of tip edges, but I may have missed other instances.

Is there a workaround? Am I missing something?

I'm using phangorn 2.5.5, R 3.6.1, and SplitsTree 4.15.1 on a Mac. The network file I'm using is attached.

Thanks for any help, Tim

boo-denovo-west-c90_mac3-spl80-hwe-rep1.nolow.phy.nex.zip

tim-oconnor commented 5 years ago

Well, I solved one of my issues. The workaround is to use the test2$translate$node to identify which nodes correspond to tip termini and then use the nodelabels() function to label them. Still, it's unclear why tiplabels() would not just do this for you.

Thanks again!