0

我无法使用自己的数据创建 topGO 对象。想知道是否有人可以帮助我!

我正在遵循原始 ViSEAGO 论文中提到的几个教程和步骤。以下是教程中的部分内容及其链接。

来自出版物:ViSEAGO 提供在 Bioconductor topGO R 包中开发的所有统计测试和算法,通过使用 ViSEAGO::create_topGO- 数据方法和 topGO::runTest 方法来考虑 GO 图的拓扑。

在教程中的“功能性 GO 丰富”下,使用以下代码生成 topGO 对象。

# create topGOdata for BP
BP<-ViSEAGO::create_topGOdata(
    geneSel=selection,
    allGenes=background,
    gene2GO=myGENE2GO, 
    ont="BP",
    nodeSize=5
)

我还参考了 topGO 的教程以确保我的数据类型正确。然而,有一些错误,我很难处理。

对于我的数据,我有以下代码。

> ##################
> # create topGOdata for BP
> BP<-ViSEAGO::create_topGOdata(
+   geneSel=geneList_g1,
+   allGenes=topDiffGenes(geneList_g1),
+   gene2GO=myGENE2GO, 
+   ont="BP",
+   nodeSize=5
+ )

#error message:
allGenes contain genes redondancy.
duplicate elements were removed.
Error in .local(.Object, ...) : allGenes must be a factor with 2 levels

在我的例子中,geneList_g1 是一个带有基因符号和 p 值的命名 num(长度为 23 个差异表达的基因,如下所示)。正在研究的有机体是Mus musculus。

> dput(geneList_g1)
c(Klf4 = 0.596, Pdk2 = 0.278, Pink1 = 0.192, Hsp90ab1 = 0.142, 
Cdkn1a = 0.132, App = 0.0197, Lep = 0.0165, Igf1 = 0.00138, Bcl6 = 0.001, 
Pfkm = 0.000264, Rbp4 = 0.000175, Pck1 = 0.000162, Adipoq = 9.13e-05, 
B2m = 1.63e-05, Pde4d = 1.8e-06, Ppargc1a = 1.04e-07, Igfbp4 = 1.01e-07, 
Apod = 5.52e-08, Foxo1 = 7.05e-12, Ide = 1.29e-12, Nr1d1 = 7.68e-17, 
Apoe = 1.48e-25, Pdk4 = 4.5e-57)

使用另一个命令创建 topGO 对象,我收到以下错误。

> mysampleGOdata <- new("topGOdata",
+                     description = "my Simple session",
+                     ontology = "BP",
+                     allGenes = geneList_g1,
+                     geneSel = topDiffGenes,
+                     nodeSize = 1,
+                     annot = annFUN.db,
+                     affyLib = affyLib)

Building most specific GOs .....
    ( 0 GO terms found. )

Build GO DAG topology ..........
    ( 0 GO terms and 0 relations. )
Error in if (is.na(index) || index < 0 || index > length(nd)) stop("vertex is not in graph: ",  : 
  missing value where TRUE/FALSE needed

任何帮助深表感谢!!提前致谢!:)

4

1 回答 1

0

您需要提供更正注释,在您的情况下,需要提供 TRUE / FALSE 向量。所以开始:

geneList_g1 = c(Klf4 = 0.596, Pdk2 = 0.278, Pink1 = 0.192, Hsp90ab1 = 0.142, 
Cdkn1a = 0.132, App = 0.0197, Lep = 0.0165, Igf1 = 0.00138, Bcl6 = 0.001, 
Pfkm = 0.000264, Rbp4 = 0.000175, Pck1 = 0.000162, Adipoq = 9.13e-05, 
B2m = 1.63e-05, Pde4d = 1.8e-06, Ppargc1a = 1.04e-07, Igfbp4 = 1.01e-07, 
Apod = 5.52e-08, Foxo1 = 7.05e-12, Ide = 1.29e-12, Nr1d1 = 7.68e-17, 
Apoe = 1.48e-25, Pdk4 = 4.5e-57)

加载库,org.Mm.eg.db 是鼠标注解:

library(org.Mm.eg.db)
library(topGO)

我们这样做:

UNI=keys(org.Mm.eg.db, keytype ='SYMBOL')
geneList <- factor(as.integer(UNI %in% names(geneList_g1)))
names(geneList) = UNI

If you have a background of other genes, you basically use UNI as your list of genes tested, and follow up with geneList:

mysampleGOdata <- new("topGOdata",
                     description = "my Simple session",
                     ontology = "BP",
                     allGenes = geneList,
                     nodeSize = 1,
                     annot = annFUN.org,
                     mapping="org.Mm.eg.db", 
                     ID = "SYMBOL")

resultFisher <- runTest(mysampleGOdata, algorithm = "classic", statistic = "fisher")

 head(GenTable(mysampleGOdata,fisher=resultFisher),1)
       GO.ID                      Term Annotated Significant
1 GO:0006006 glucose metabolic process       194          12
  Expected  fisher
1     0.19 1.0e-19
于 2020-01-08T13:36:10.473 回答