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

dotTree with missing data #117

Open
HedvigS opened this issue Sep 25, 2022 · 1 comment
Open

dotTree with missing data #117

HedvigS opened this issue Sep 25, 2022 · 1 comment

Comments

@HedvigS
Copy link

HedvigS commented Sep 25, 2022

dear Dr @liamrevell

I like phytools::dotTree(), it's simple and handy!

I have a case where I'm plotting discrete values and there are some missing values. I'd like these to be handled differently, but now they're filled in with white which looks like it's part of the scale.

Here's an example:

poly_tree_example

What I've done here after pruning the tree (poly_tree) and data frame (poly_tree_tip_value_df) with data is this:


colours <- c("#ffffbf","#8856a7")
feature_vec <- poly_tree_tip_value_df$GB409 %>% as.character()

fmode<-as.factor(setNames(poly_tree_tip_value_df$GB409,poly_tree_tip_value_df$Name))


dotTree(ladderize(poly_tree,right = F),x = fmode,colors=setNames(colours,
                                       c("0","1")),fsize=1, legend = F)

I saw your blog post about setting pts to F, but this made no difference I'm afraid.

I see these solutions:

  • somehow setting the black circle outline to white or cex 0 for the values that are missing
  • getting the phylo.heatmap option to work with the slash
  • re-evaluating the missing values to a non-missing values like "?" and map that to a color like grey

What do you think?

Happy for any advice :)

@HedvigS
Copy link
Author

HedvigS commented Apr 22, 2024

I ended up solving this by setting border to "transparent" and those values to white

Not sure if I should leave this issue up in case it ends up going in some documentation somewhere that this is one solution.

Screenshot 2024-04-22 at 22 45 51

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