Hy4m / linkET

Everything is Linkable
145 stars 39 forks source link

Error in calcCurveGrob(x, x$debug) : 端点两头的值是不能相等的 #7

Open AITCM opened 1 year ago

AITCM commented 1 year ago

为什么demo的数据可以跑出图,但是用自己的数据会出现这个问题

Hy4m commented 1 year ago

这个问题之前有人报告过,但是在我的电脑一直没有重复出来。大概原因是因为标签文本太长了,手动把标签处理的更短一点能解决。

Cogito7460 commented 11 months ago

为什么demo的数据可以跑出图,但是用自己的数据会出现这个问题

把显示plot的那个区域拉大一点就不会报错了

Hy4m commented 11 months ago

为什么demo的数据可以跑出图,但是用自己的数据会出现这个问题

这个我也没太搞明白,不知道是底层grid的问题,还是linkET内部的代码有问题。直接原因就是标签太长了,手动截短一点应该就正常。

susheelbhanu commented 3 months ago

Hi,

I'm running into possibly a similar issue here, see below

> qcorrplot(correlate(amr_class), type = "upper", diag = FALSE) +
+   geom_square() +
+   geom_couple(aes(colour = pd, size = rd), 
+               data = class_mantel, 
+               curvature = nice_curvature()) +
+   scale_fill_gradientn(colours = RColorBrewer::brewer.pal(11, "RdBu")) +
+   scale_size_manual(values = c(0.5, 1, 2)) +
+   scale_colour_manual(values = color_pal(3)) +
+   guides(size = guide_legend(title = "Mantel's r",
+                              override.aes = list(colour = "grey35"), 
+                              order = 2),
+          colour = guide_legend(title = "Mantel's p", 
+                                override.aes = list(size = 3), 
+                                order = 1),
+          fill = guide_colorbar(title = "Pearson's r", order = 3))
Error in calcCurveGrob(x, x$debug) : end points must not be identical

However, can't understand the above text so could you please explain how this was fixed?

class_mantel was generated as follows:

class_mantel <- linkET::mantel_test(filtered_meta, amr_class, 
                         spec_select = list(bac_chao1 = "bac_chao1", 
                                              euk_chao1 = "euk_chao1",
                                              Alkyl_pH = "Alky pH 4.5")) %>% 
  mutate(rd = cut(r, breaks = c(-Inf, 0.2, 0.4, Inf),
                  labels = c("< 0.2", "0.2 - 0.4", ">= 0.4")),
         pd = cut(p, breaks = c(-Inf, 0.01, 0.05, Inf),
                  labels = c("< 0.01", "0.01 - 0.05", ">= 0.05")))

Thanks!

Hy4m commented 3 months ago

Hi,

I'm running into possibly a similar issue here, see below

> qcorrplot(correlate(amr_class), type = "upper", diag = FALSE) +
+   geom_square() +
+   geom_couple(aes(colour = pd, size = rd), 
+               data = class_mantel, 
+               curvature = nice_curvature()) +
+   scale_fill_gradientn(colours = RColorBrewer::brewer.pal(11, "RdBu")) +
+   scale_size_manual(values = c(0.5, 1, 2)) +
+   scale_colour_manual(values = color_pal(3)) +
+   guides(size = guide_legend(title = "Mantel's r",
+                              override.aes = list(colour = "grey35"), 
+                              order = 2),
+          colour = guide_legend(title = "Mantel's p", 
+                                override.aes = list(size = 3), 
+                                order = 1),
+          fill = guide_colorbar(title = "Pearson's r", order = 3))
Error in calcCurveGrob(x, x$debug) : end points must not be identical

However, can't understand the above text so could you please explain how this was fixed?

class_mantel was generated as follows:

class_mantel <- linkET::mantel_test(filtered_meta, amr_class, 
                         spec_select = list(bac_chao1 = "bac_chao1", 
                                              euk_chao1 = "euk_chao1",
                                              Alkyl_pH = "Alky pH 4.5")) %>% 
  mutate(rd = cut(r, breaks = c(-Inf, 0.2, 0.4, Inf),
                  labels = c("< 0.2", "0.2 - 0.4", ">= 0.4")),
         pd = cut(p, breaks = c(-Inf, 0.01, 0.05, Inf),
                  labels = c("< 0.01", "0.01 - 0.05", ">= 0.05")))

Thanks!

I don’t know what happened, but it maybe work fine with shorter labels (variable name of correlation)