ropensci / iheatmapr

Complex, interactive heatmaps in R
https://docs.ropensci.org/iheatmapr
Other
267 stars 36 forks source link

Reverse dependency checks fail with `ggdendro` #103

Closed andrie closed 10 months ago

andrie commented 10 months ago

Hi, I'm the maintainer of ggdendro and am preparing an update to ggdendro to go to CRAN. I have run all reverse dependency checks, and 59 out of 61 packages pass all tests. But iheatmapr fails a test with the new version of ggdendro.

I would appreciate if you can help me trace the root cause. It's not immediately obvious to me where the problem is.

══ Failed tests ════════════════════════════════════════════════════════════════
── Failure ('test_clustering.R:8:3'): can add row clustering with dendrogram to single horizontal heatmap ──
Not equal to reference from `reference/row_clustering_hclust_horizontal.rds`.
Component "layout": Component "shapes": Component 3: Component 1: Mean relative difference: 0.3567627
Component "layout": Component "shapes": Component 3: Component 2: Mean relative difference: 0.3567627
Component "layout": Component "shapes": Component 3: Component 3: Mean relative difference: 0.5721393
Component "layout": Component "shapes": Component 3: Component 4: Mean relative difference: 0.8987342
Component "layout": Component "shapes": Component 4: Component 1: Mean relative difference: 0.3567627
Component "layout": Component "shapes": Component 4: Component 2: Mean relative difference: 0.4238062
Component "layout": Component "shapes": Component 4: Component 3: Mean relative difference: 0.8987342
Component "layout": Component "shapes": Component 4: Component 4: Mean relative difference: 0.8987342
Component "layout": Component "shapes": Component 5: Component 1: Mean relative difference: 0.3745406
...
Backtrace:
    ▆
 1. └─iheatmapr:::expect_iheatmap(test_plot, "row_clustering_hclust_horizontal") at test_clustering.R:8:3
 2.   └─iheatmapr:::expect_ihm_equal_to_reference(...) at C:\Users\apdev
alanocallaghan commented 10 months ago

Thanks for the heads up, I'll grab the latest ggdendro from your github and have a look

andrie commented 10 months ago

Some additional context: the change that's probably causing this is a performance optimisation of the algorithm that computes hclust. The code that does this in ggdendro originates in the rpart package, and in my recent update I pulled in the necessary changes from rpart.

It's possible that your package is comparing the actual clustering results from ggdendro. If that's the case, you may want to prove to yourself that any changes in the results correspond to doing the analysis in rpart directly. Let me know if I can provide any help with this.

alanocallaghan commented 10 months ago

This is just a plotting library; I checked over the visual differences in the plots corresponding to the unit tests and I'm satisfied the actual clustering results are identical. Therefore I'm just updating the reference material for the plots and will push to CRAN

alanocallaghan commented 10 months ago

(tl;dr for you, no worries count it as resolved)

alanocallaghan commented 10 months ago

Should be on the way to CRAN or there already, thanks again