Hi all, I am using topGO in R to get GO terms from a set of genes.
example of some entries in my gene list: gene_list_ua COBS01388 COBS01391 COBS01392 COBS01392 COBS01392 COBS01392 COBS01392 COBS01393 COBS01395 COBS01396 0 0 0 0 0 0 0 0 0 0 Levels: 0 1
ontology_type = "MF" GO_data_ua_mf <- new("topGOdata", description="GO_Enrichment", ontology=ontology_type, allGenes=gene_list_ua, annot = annFUN.gene2GO, gene2GO=universe)
GO_data_ua_mf
------------------------- topGOdata object -------------------------
Description:
GO_Enrichment
Ontology:
MF
17639 available genes (all genes from the array):
- symbol: COBS00002 COBS00003 COBS00004 COBS00004 COBS00005 ...
1524 significant genes.
15720 feasible genes (genes that can be used in the analysis):
- symbol: COBS00002 COBS00003 COBS00004 COBS00004 COBS00006 ...
1359 significant genes.
GO graph (nodes with at least 1 genes):
- a graph with directed edges
- number of nodes = 1299
- number of edges = 1691
------------------------- topGOdata object -------------------------
result_topGO_w01_ua_mf <- runTest(GO_data_ua_mf, algorithm = "weight01", statistic = "fisher") result_topGO_w01_ua_mf
Description: GO_Enrichment Ontology: MF 'weight01' algorithm with the 'fisher' test 1299 GO terms scored: 28 terms with p < 0.01 Annotation data: Annotated genes: 15720 Significant genes: 1359 Min. no. of genes annotated to a GO: 1 Nontrivial nodes: 341
result_table_w01_ua_mf <- GenTable(GO_data_ua_mf, Fisher = result_topGO_w01_ua_mf, orderBy = "Fisher", ranksOf = "Fisher", topNodes = numSigGenes(GO_data_ua_mf))
Error in data.frame(infoMat, annoStat, apply(l, 2, format.FUN, dig = 2, : arguments imply differing number of rows: 1359, 1299 In addition: Warning message: In .genesInNode(graph(object), whichGO) : Nodes not present in the graph:NANANANANANANANANANANANANANANANANANANANANANANANANANANANANANANANANANANANANANANANANANANANANANANANANANANANANANANANANANANANA
I don't get an error if I use "BP" and "CC" in the lines above.
R.version
platform x86_64-apple-darwin17.0
arch x86_64
os darwin17.0
system x86_64, darwin17.0
status
major 4
minor 1.2
topGO version 2.46.0 BiocManager version 1.30.16
What could be happening? I do not think the number of nodes and significant genes need to be the same as before it worked with BF and CC.
Thanks for your help!
Luisa
2 answers
Hi Luisa,
It may be that there are NA values in the dataframe. Can you remove any NAs present and see if you are getting the same error?
Thanks
Hi Sarah,
The both objects used (S4 object of class topGOdata and S4 object of class topGOresult), do not have NAs. Not that I could find. For example:
sum(is.na(GO_data_ua_mf@allScores)) [1] 0 sum(is.na(GO_data_ua_mf@feasible)) [1] 0 sum(is.na(result_topGO_w01_ua_mf@score)) [1] 0
Neither the gene list: sum(is.na(gene_list_ua)) [1] 0
And the NANAs problem is a warning but not the error itself. Should I look somewhere else?
Thanks, Luisa
Log in to answer this question.