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

Issue with label alignment #11

Open
dsgregoire opened this issue Jul 30, 2021 · 0 comments
Open

Issue with label alignment #11

dsgregoire opened this issue Jul 30, 2021 · 0 comments

Comments

@dsgregoire
Copy link

dsgregoire commented Jul 30, 2021

Hello,

First off thank you for the wonderful packages ggtree and aplot. They've made plotting my phylogenetic data very easy.

I am running into multiple issues in R using the 'aplot' package, where I am trying to connect a multi-faceted heatmap made with geom_tile in ggplot2, to a tree I have visualized using ggtree. This heatmap includes numeric data for how complete metabolic pathways are for a subset of genomes in my larger phylogenetic tree. Producing this heatmap using gheatmap or appending it to the tree data %<+% hasn't worked because the code for the heatmap is too complex due to the faceting required. Simply trying to insert the tree to the left with common labels returns the error:

Error in xy.coords(x, y, xlabel, ylabel, log) : 'x' is a list, but does not have components 'x' and 'y'

The issues include:

  • The labels on the y-axis between the tree and heat map are not aligning properly at all despite making sure the syntax and ordering them as a factor are identical
  • I can only connect the two figures using the following code tree_heatmap<- heatmap %>% insert_left(tree), and I cannot do it the other way around, inserting the heatmap to the right of the tree. When I do so, it says I am supplying discrete values to a continuous scale.
  • I cannot export the final figure as a PDF, it just shows up blank in the file

Outside of these trials, I can't figure out how to connect these plots working from Figure 7B from this link: https://yulab-smu.top/treedata-book/chapter7.html. I've attached a rough copy and paste image from R studio here to illustrate the alignment issues I am having with the labels.

image

Really, I am trying to produce the first two panels of Figure 7B, with the proper alignment, label order, and labels dropped for those that are not in the heatmap dataset.

Any help you can provide on this matter would be much appreciated.

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

1 participant