neurogenomics / MAGMA_Celltyping

Find causal cell-types underlying complex trait genetics
https://neurogenomics.github.io/MAGMA_Celltyping
71 stars 31 forks source link

`magma_tileplot`: `rror in q < 1e-05 : comparison (3) is possible only for atomic and list types` #112

Closed bschilder closed 2 years ago

bschilder commented 2 years ago
rror in q < 1e-05 : 
comparison (3) is possible only for atomic and list types
bschilder commented 2 years ago

Occurs when all q values == 1.

Solution

replace:

 ggplot2::geom_point(
            ggplot2::aes_string(x = "GCOV_FILE", y = "Celltype", 
                      size = ifelse(q < 0.00001, "HUGEdot", 
                                    ifelse(q < 0.0001, "BIGdot", 
                                           ifelse(q < 0.001, "BiiGdot", 
                                                  ifelse(q < 0.05, "dot",
                                                         "no_dot"))))), 
            col = "black") +

with:

results$dotsize <- cut(x = results$q, 
                           breaks = c(0,0.00001, 0.0001, 0.001, 0.05,1),
                           labels = c(4,3,2,1,NA)) 

...
ggplot2::geom_point(
            ggplot2::aes_string(x = "GCOV_FILE", y = "Celltype", 
                                size = "dotsize"), 
            col = "black") 
...