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

Feature request: show root edge #183

Closed
7 of 8 tasks
richelbilderbeek opened this issue Jun 11, 2018 · 1 comment
Closed
7 of 8 tasks

Feature request: show root edge #183

richelbilderbeek opened this issue Jun 11, 2018 · 1 comment

Comments

@richelbilderbeek
Copy link

Prerequisites

  • Have you read Feedback and follow the guide?
    • make sure your are using the latest release version
    • read the documents
    • google your quesion/issue

I did not read the documents, as the page is not found. I did read the documents at the present location

Describe you issue

  • Make a reproducible example (e.g. 1)
  • your code should contain comments to describe the problem (e.g. what expected and actually happened?)

I would like to plot a phylogeny, including its root edge or stem.

# A phylogeny with a long stem
phylo <- ape::read.tree(text = "(A:1,B:1):20;")

This can easily be done in ape:

# Plot the phylogeny with the long stem with its stem visible
ape::plot.phylo(phylo, root.edge = TRUE); ape::add.scale.bar()

resulting in:

ape_stem

I was unable to find how achieve the same with ggtree.
As the question how to do so remains unanswered in the google group, I assume it cannot yet be done.
I could get an accent on the root:

# Plot the phylogeny with the long stem with its root node shown, 
# instead of drawing the root edge
ggtree::ggtree(phylo) + ggtree::geom_treescale() + ggtree::geom_rootpoint()

Now I have a workaround by using white edges, but I think ggtree is able to do better.

This Issue is similar to #95, except that I want to draw the root edge, instead of adding space at the center of a fan phylogeny.

Note that FigTree, as mentioned in the documentation does provide to display a stem

Ask in right place

  • for bugs or feature requests, post here (github issue)
  • for questions, please post to google group

As the same question has not been answered in the google group, I mark this as a feature request

@GuangchuangYu
Copy link
Member

GuangchuangYu commented Jun 13, 2018

geom_rootedge was introduced in v >= 1.13.0.006.

## by default, use phylo$root.edge
ggtree(phylo) + geom_rootedge() + geom_treescale(-15, 1, offset=0.01, width=.5)

## you can also specify rootedge directly in geom_rootedge
ggtree(phylo) + geom_rootedge(3) + geom_treescale(-2, 1, offset=0.01, width=.5)

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