YuLab-SMU / ggtree

:christmas_tree:Visualization and annotation of phylogenetic trees
https://yulab-smu.top/contribution-tree-data/
838 stars 173 forks source link

`geom_tiplab2(geom="phylopic",...)`: errors #567

Open bschilder opened 1 year ago

bschilder commented 1 year ago

Prerequisites

Describe you issue

geom_tiplab2 isn't able to recover the correct phylopic image URLs. This is likely closely related to ggimage not having been updated for the new phylopic API released a while ago.

However, documenting here to confirm that this is the case, and to ask whether any short-term fixes might be implemented. Especially considering the next Bioc release is fast approaching on April 8th, after which time any Bioc packages that rely on this functionality will become deprecated by default. @GuangchuangYu

d <- data.table::fread("https://github.com/YuLab-SMU/ggtree/files/11001046/phylo_data.csv")
d <- as.data.frame(d) |> `rownames<-`(d$species)
tr <- rtree(nrow(d), tip.label = d$species)

## Error
ggtree(tr, layout = "circular" )%<+% d  +
    geom_tiplab2(geom="phylopic",
                 ggplot2::aes(image=png_uid))
Error in `geom_image()`:
! Problem while converting geom to grob.
ℹ Error occurred in the 3rd layer.
Caused by error in `download_url()`:
! Failed to download http://phylopic.org/assets/images/submissions/347bc4ab-c1e0-4313-9ea1-939c2ad71232.256.png (HTTP 404)
Run `rlang::last_trace()` to see where the error occurred.

Ask in right place

bschilder commented 1 year ago

@GuangchuangYu any progress on this?