jokergoo / simplifyEnrichment

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

Error: None of the keys entered are valid keys for 'GOID' #41

Closed anabbi closed 3 years ago

anabbi commented 3 years ago

Hi Zuguang,

your new anno_word_cloud_from_GO function is a real help for me. I am trying to annotate a heatmap from a categorical vector with their respective GO terms.

My align_to is just a vector with genes as names:

RF00026'1' AL669831.1'1' C1orf159'1' AL139287.1'1' CCNL2'1' AL391244.2'1'

My go_list is a list, where names matches elements in my align_to and their elements are GO terms:

List of 24 $ 7 : chr [1:8] "GO:0006139" "GO:0046483" "GO:0006725" "GO:0016070" ... $ 2 : chr [1:4] "GO:00160701" "GO:00061391" "GO:00346411" "GO:00464831" $ 3 : chr [1:2] "GO:0010793" "GO:0034067" $ 14: chr [1:4] "GO:0006396" "GO:0000959" "GO:0008380" "GO:0002939" $ 22: chr [1:3] "GO:1990074" "GO:1903690" "GO:1904261" $ 24: chr [1:7] "GO:0006119" "GO:0046034" "GO:0042775" "GO:0042773" ... $ 26: chr [1:10] "GO:0001568" "GO:0001944" "GO:0072358" "GO:0072144" ...

The following command does not seem to find my GO terms:

mmy_ha = rowAnnotation(go = anno_word_cloud_from_GO(myalign_to, mygo_id, max_words = 30))

it gives me the following error:

Error in .testForValidKeys(x, keys, keytype, fks): None of the keys entered are valid keys for 'GOID'. Please use the keys method to see a listing of valid arguments.

Any comments?

Best, Arash

jokergoo commented 3 years ago

Sorry, I was working on other projects and did see your question.

Can you also send me the two variables myalign_to and mygo_id?

anabbi commented 3 years ago

No worries. Thanks for getting back to me. See attached.

Archive.zip

jokergoo commented 3 years ago

It is because align_to was in the wrong format. Since go_list is a list of 24, align_to should also be a list of 24.

anabbi commented 3 years ago

Thanks. In this example from your vignette, km is a vector with elements overlapping go_list names?

load(system.file("extdata", "golub_sig_go.RData", package = "simplifyEnrichment")) head(km) str(go_list) library(circlize) Heatmap(t(scale(t(sig_mat))), name = "z-score", col = colorRamp2(c(-2, 0, 2), c("green", "white", "red")), show_row_names = FALSE, show_column_names = FALSE, row_title = NULL, column_title = NULL, show_row_dend = FALSE, show_column_dend = FALSE, row_split = km) + rowAnnotation(go = anno_word_cloud_from_GO(km, go_list, max_words = 30))

jokergoo commented 3 years ago

That is a second format for the align_to which is a categorical variable.

If align_to is set as a categorical variable, internally it will be converted to split(seq_along(km), km)