Question: topGO geneSelectionFun error
0
gravatar for ig.yakunin
5 months ago by
ig.yakunin0
ig.yakunin0 wrote:

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.

topgo R genesel • 274 views
ADD COMMENTlink modified 5 months ago • written 5 months ago by ig.yakunin0
0
gravatar for Kevin Blighe
5 months ago by
Kevin Blighe65k
Kevin Blighe65k wrote:

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 COMMENTlink modified 5 months ago • written 5 months ago by Kevin Blighe65k

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 REPLYlink written 5 months ago by ig.yakunin0

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

ADD REPLYlink written 5 months ago by Kevin Blighe65k

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 REPLYlink modified 5 months ago by Kevin Blighe65k • written 5 months ago by ig.yakunin0

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

ADD REPLYlink modified 5 months ago • written 5 months ago by Kevin Blighe65k

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 REPLYlink written 5 months ago by ig.yakunin0
Please log in to add an answer.

Help
Access

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.
Powered by Biostar version 2.3.0
Traffic: 717 users visited in the last hour