topGo error loading data
1
0
Entering edit mode
peter • 0
@6754c2c6
Last seen 23 months ago
United Kingdom

Hello, im struggling to load my data into topGo. I have been able to load in the preinstalled data but when i try my own i get the error

Error in split.default(names(sort(nl)), f.index): first argument must be a vector

I have found some similar post/problems but i still cannot identify the issue.

Im bringing over gene lists and p values from a DESEQ2 output and loading that as a genelist, along with a GO file for my organism as follows;

# extract the adjusted p-values from  our results object
geneList <- res$padj

# add the gene names from our results to our list of adjusted p-values
names(geneList) <- rownames(res)

# remove genes with an adjusted p-value recorded as NA
geneList<-na.omit(geneList)

#load in GO data from B.imp
geneID2GO <- readMappings(file = "Bombus_impatiens_BP_All.txt", IDsep = ",", sep = "\t")
sessionInfo( )

these data look like; enter image description here

but when i run topGo, i get the error

sampleGOdata <- new("topGOdata",
              ontology = "BP", 
             allGenes = geneList,
              geneSel = topDiffGenes,
              nodeSize = 10,
              annot = annFUN.gene2GO, 
              gene2GO = geneID2GO
                   )

Building most specific GOs .....

    ( 0 GO terms found. )


Build GO DAG topology ..........

    ( 0 GO terms and 0 relations. )

Nothing to do:

Error in split.default(names(sort(nl)), f.index): first argument must be a vector
Traceback:

1. new("topGOdata", ontology = "BP", allGenes = geneList, geneSel = topDiffGenes, 
 .     nodeSize = 10, annot = annFUN.gene2GO, gene2GO = geneID2GO)
2. initialize(value, ...)
3. initialize(value, ...)
4. .local(.Object, ...)
5. buildLevels(g, leafs2root = TRUE)
6. split(names(sort(nl)), f.index)
7. split.default(names(sort(nl)), f.index)

Based on other posts i thought maybe my genelist file wasnt a vector but;


typeof(geneList)
'double'

And if i run

v.geneList <- as.vector(geneList,'numeric')

sessionInfo( )

and put that through, i still get the error.

Could it be the geneID2GO file? the format looks like it should so im pretty stumped! Any suggestions appreciated!

topGO GO • 1.5k views
ADD COMMENT
1
Entering edit mode
peter • 0
@6754c2c6
Last seen 23 months ago
United Kingdom

Realised the issue, i needed to use IDsep = ";" when loading the GO data;

#load in GO data from B.imp

geneID2GO <- readMappings(file = "Bombus_impatiens_BP_All.txt", IDsep = ";", sep = "\t")

all working now - thank you!

ADD COMMENT

Login before adding your answer.

Traffic: 597 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