Thank you for taking the time to help me, you're right with the DOSE, I was panicking and trying anything to get a result. I will add more information :
> gene_list <- paste("/Users/graffj/Desktop/Results-Supp-2/supp2/gene_id_", ref_sample, ".xlsx", sep = "")
> genes <- read_xlsx(gene_list)
New names:
• `` -> `...1`
> genes <- as.data.frame(genes[, 2:3])
> head(genes$GeneID)
[1] "FLO9" "FLO1" "CDC27" "SKT5" "DSF2" "KAP104"
I removed the line, still I have the error :
> gene_ids <- mapIds(org.Sc.sgd.db, keys = genes$GeneID, column = "ENTREZID", keytype = "COMMON")
'select()' returned 1:1 mapping between keys and columns
> head(gene_ids)
FLO9 FLO1 CDC27 SKT5 DSF2 KAP104
"851236" "851289" "852194" "852218" "852292" "852305"
> gene_ids <- as.numeric(gene_ids)
> head(gene_ids)
[1] 851236 851289 852194 852218 852292 852305
> gene_ids <- gene_ids[-which(is.na(gene_ids))]
> geneList <- gene_ids[order(gene_ids, decreasing = T)]
> head(geneList)
[1] 856862 856830 856711 856640 856459 856429
> gseGO(geneList= geneList, ont = "BP", OrgDb = org.Sc.sgd.db, keyType = "ENTREZID")
preparing geneSet collections...
--> Expected input gene ID: 855929,851040,852641,852106,850451,854504
Error in check_gene_id(geneList, geneSets) :
--> No gene can be mapped....
I tried to give as many precision as I could, if something is missing, please let me know. Thank you again to help me.
To my knowledge geneList from DOSE package contains human genes and cannot be applied to S.cerevisiae GO. This is why you get the error. Create a geneList on the same format with your genes input
Yes, indeed, this was a stupid mistake from me. However, I removed the line : data(geneList, package = "DOSE")
I added more detail in another comment! Thank you for your help !
geneList should be a named vector (look at example from DOSE package) :
The names of the vector you provided should be the ENTREZID of your genes. In your code provided below, it is the inverse, ENTREZID are the values while gene symbol are the names.
names(gene_ids) = gene_idsshould solve the problem (considering you list is already ranked), but pay attention that your list is ranked adequately for GSEAI didn't know the values should be named, thank you a lot!! Now I have others error messages but I will try to fix them by myself. I still have a lot to learn about this package.