topGO geneSelectionFun error
1
0
Entering edit mode
4.0 years ago
ig.yakunin • 0

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.

R topGO geneSel • 2.0k views
ADD COMMENT
0
Entering edit mode
4.0 years ago

Hey, what is the output of tail(sort(UniversalGenes),100) ?

Also note these 2 lines:

UnivesrsalGenes <- as.vector(MS$Counts)
names(UniGenesList) <- MS$GeneNames

The variables UnivesrsalGenes and UniGenesList should have the same name, and they should both have the same name as the object being passed to new(), i.e., UniversalGenes

Kevin

ADD COMMENT
0
Entering edit mode

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.

ADD REPLY
0
Entering edit mode

No, but, judging by your code, you want to select the top 100 genes based on their count? Is the function returning that?

ADD REPLY
0
Entering edit mode

yeah it works well outside of the "new" function.

#if I apply the function to my set of genes
> top100(UniversalGenes)

the output is:

Gene1  Gene2 Gene3... Gene100
value1  value 2 Value3... Value 100

where each name is associated with its value

ADD REPLY
0
Entering edit mode

Only certain tests actually utilise the ranking information of your genes. Can you confirm which subsequent step(s) you are doing?

ADD REPLY
0
Entering edit mode

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.

ADD REPLY

Login before adding your answer.

Traffic: 2862 users visited in the last hour
Help About
FAQ
Access RSS
API
Stats

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.

Powered by the version 2.3.6