我无法使用自己的数据创建topGO对象。想知道是否有人可以帮助我!
我正在遵循ViSEAGO原始论文中提到的几个教程和步骤。这是本教程中的部分内容及其链接。
来自publication:ViSEAGO提供了在Bioconductor topGO R软件包中开发的所有统计测试和算法,其中考虑到了通过使用ViSEAGO :: create_topGO-data方法和topGO :: runTestmethod的GO图的拓扑结构。
在tutorial中的'功能GO浓缩下,下面的代码用于生成topGO对象。
# create topGOdata for BP
BP<-ViSEAGO::create_topGOdata(
geneSel=selection,
allGenes=background,
gene2GO=myGENE2GO,
ont="BP",
nodeSize=5
)
我还参考了topGO的tutorial以确保我的数据类型正确。但是,有一些错误我很难处理。
为我的数据,我有以下代码。
> ##################
> # 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值(如下所示的长度为23的差异表达基因)的命名num。正在研究的生物是小家鼠。
> 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
非常感谢任何帮助!!提前致谢! :)
[您需要提供更正批注,并在情况下提供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