GGtree flips my tree
1
0
Entering edit mode
15 months ago
M. ▴ 40

Hi,

I am generating a tree figure with ggtree. But the output keeps coming upside down no matter which parameter I use or change. Does anyone have any idea about this?

This is my command line:

ggtree_obj <- ggtree(species_tree, ladderize = FALSE, layout = "rectangular")+
    theme_tree2(legend.position="none")

Thank you for your help.

ggtree phylogenetics R • 1.5k views
ADD COMMENT
1
Entering edit mode

Please show your output and an example from the ggtree manual that demonstrates that your tree is indeed upside down.

ADD REPLY
0
Entering edit mode

My output is really big, it contains 2k species. I'm not sure how can I show it from here, but it is completely reversed with the newick format. The first leaf in newick, takes place at the bottom of the tree in ggtree. The topology stays the same. Is there any parameter you know that could solve something like this? I tried to use grid.arrange(p, flip(p, node1, node2) but it didnt worked either.

ADD REPLY
0
Entering edit mode

There has to be something you're able to show to demonstrate that it's flipped. Also, consult the manual - maybe that'll give you a hint on what to expect and where to start if your expectations don't align with ggtree's features.

ADD REPLY
0
Entering edit mode

Dear Ram,

The time I asked this question for the first time, I was a newbie and wasn't able to produce a tree that I can show in one picture :) Now I gained some expertise but my question remains same. Here are a figtree screen shot and the figure I produced with ggtree for the same tree. I circled the corresponding clade to the red clade in the first picture so you would understand the topology. I am also adding the code.

Thanks in advance.

p <- ggtree(tree, ladderize = FALSE, layout = "rectangular")

enter image description here

enter image description here

ADD REPLY
0
Entering edit mode

M. please stop deleting your post. It has started a conversation and received feedback so the information does not belong to you alone.

ADD REPLY
2
Entering edit mode
15 months ago
Beatriz ▴ 20

It is possible to flip/rotate specific branches of your tree with flip.

Command example: https://guangchuangyu.github.io/2015/07/flip-and-rotate-branches-in-ggtree/

Otherwise, You can also try it with the ape::rotate command (it uses R basic plot and not ggplot2)

ADD COMMENT

Login before adding your answer.

Traffic: 1783 users visited in the last hour
Help About
FAQ
Access RSS
API
Stats

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.

Powered by the version 2.3.6