Thank you for the help, I'm going through the same problem. What I can't understand is how the gene2cat file should look. In my case, I have a table with the gene ids and the GO terms divided by category (GO_Biological, Go_Cellular, etc) (see picture at bottom). I have done a try using GO_Biological with your tip:
annotation1000 <- read_excel("annotation1000.xls")
annotation1000 %>%
select(GeneID, GO_Biological) %>%
separate_rows(GO_Biological, sep=",") -> annotation1000
gene2cat <- split(annotation1000$GO_Biological, annotation1000$Query_Sequence)
The output looks good (each gene with its bunch of GO terms). However, when I run the following:
go.wall <- goseq(pwf.3, gene2cat = gene2cat, test.cats = c("GO:BP"), method="Wallenius")
or
go.wall <- goseq(pwf.3, gene2cat = gene2cat, method="Wallenius")
I obtain this 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.
I don't know how to prepare the gene2cat object properly, in addition, I would like to use all the GO categories at the same time. Do you have any suggestions on how to proceed? Thank you!!

