jokergoo / simplifyEnrichment

Simplify functional enrichment results
https://jokergoo.github.io/simplifyEnrichment
Other
108 stars 16 forks source link

Usage of anno_word_cloud #66

Open hsiaoyi0504 opened 2 years ago

hsiaoyi0504 commented 2 years ago

Hi, thanks for creating such a great series of packages. When I tried to create word_cloud for the heatmap

term <- list("This is the first sentence.")
align_to_index <- list(100)
rna_row_ha <- rowAnnotation(wc = anno_word_cloud(align_to_index, term, add_new_line = TRUE, value_range = c(1, 1), fontsize_range = c(10, 10)))

I will get an error

Error in anno_word_cloud(align_to_index, term, add_new_line = TRUE, value_range = c(1,  : 
  Error in `class<-`(unlist(lapply(x, as.unit), recursive = FALSE), c("unit",  : 
  attempt to set an attribute on NULL
2: stop(oe)
1: anno_word_cloud(align_to_index, term)

Do I misunderstand the data structure of inputs?

jokergoo commented 2 years ago

Sorry I missed this issue!

term and align_to_index should have names so that these two can be matched.

term <- list(a = "This is the first sentence.")
align_to_index <- list(a = 100)