Hi all,
I'm trying to perform GO enrichment analysis from MS-MS data and seem to have an issue with the topGO function.
#generating gene2GO mapping
GOid <- mapIds(org.Hs.eg.db,GeneNames,"GO","SYMBOL",multiVals = "list")
#universal gene named vector with spectral counts
UnivesrsalGenes <- as.vector(MS$Counts)
names(UniversalGenes) <- MS$GeneNames
#geneselectionfunction
top100 <- function(x) {
return(tail(sort(x),100))
}
GOdata <- new("topGOdata", ontology = "MF", allGenes = UniversalGenes, geneSel = top100, annot = annFUN.gene2GO, gene2GO = GOid, nodesSize =5)
For some reason the selection function does not work within the "new" function. As a result all of my genes are considered significant instead of the top 100. when I apply the top100 function to the universal gene vector by itself it works fine so I'm not sure what is going wrong.
Any help would be appreciated.
the output of the function is a named vector where the value is the spectral count and the name is the Gene name. I've tried outputting only the names as a character vector, but that also didn't work.
the UniversalGenes and UniGenesList is the same in my code, I just made a mistake copying it over to here.
No, but, judging by your code, you want to select the top 100 genes based on their count? Is the function returning that?
yeah it works well outside of the "new" function.
the output is:
where each name is associated with its value
Only certain tests actually utilise the ranking information of your genes. Can you confirm which subsequent step(s) you are doing?
I was planning to do KS analysis, but have given up on that now. I just applied the top 100 function to my original dataset and made a 2 level factor from the universal gene list and just fed that into top GO. think that was easier than keep trying to battle with it.