How to use org.Mm.eg.db as chip in topGO printGenes function
1
0
Entering edit mode
komalr • 0
@komalr-7482
Last seen 9.1 years ago
United States

Hi,

I am using the topGO package and this is my code:

# input data
head(dat)
ID Entrezid            Ensembl     logFC   AveExpr         t      P.Value    adj.P.Val        B        fc      ctrl
1 17500195    20845 ENSMUSG00000031574  1.350722  8.794343  35.00267 3.322001e-09 2.994419e-05 11.46955  2.550397  8.148782
2 17514553    17394 ENSMUSG00000005800  1.474257  7.718298  34.09233 4.000494e-09 2.994419e-05 11.33943  2.778406  6.971868
3 17435584   231070 ENSMUSG00000045294  1.290198 12.451859  32.98903 5.044790e-09 2.994419e-05 11.17338  2.445615 11.817585
4 17404821    12428 ENSMUSG00000027715 -1.579461 10.139447 -30.63328 8.502606e-09 3.112320e-05 10.78515 -2.988581 10.871834
5 17530311    81907 ENSMUSG00000042757 -1.229960 10.666388 -30.51421 8.739034e-09 3.112320e-05 10.76421 -2.345604 11.303222
6 17358591    77836 ENSMUSG00000024806  2.499764  8.350270  29.64428 1.071285e-08 3.179395e-05 10.60707  5.655928  7.209390

# get geneList
geneList <-as.vector(dat$adj.P.Val)
names(geneList) <- as.character(dat$Ensembl)

# gene selection function
GetGeneList <- function(input){
  input < 0.01 
}

# GOdata
GOdata <-new ("topGOdata", 
              ontology = "BP", 
              allGenes = geneList, 
              geneSel = GetGeneList,
              nodeSize = 10, 
              annot = annFUN.org,
              mapping="org.Mm.eg.db", 
              ID = "ensembl"
)

# run tests
resultKS <- runTest(GOdata, algorithm = "classic", statistic = "ks")
resultKS.elim <- runTest(GOdata, algorithm = "elim", statistic = "ks")

# run GenTable
allRes <- GenTable(GOdata,
                   classicKS = resultKS,
                   orderBy = "elimKS", 
                   topNodes = 25)

# results
head(allRes)
GO.ID                                    Term Annotated Significant Expected classicKS
1 GO:0044699                 single-organism process      9632        1200   975.38   < 1e-30
2 GO:0044763        single-organism cellular process      8661        1094   877.06   1.8e-30
3 GO:0008150                      biological_process     14717        1523  1490.32   4.1e-26
4 GO:0009987                        cellular process     10696        1242  1083.13   6.5e-22
5 GO:0048522 positive regulation of cellular process      3521         443   356.55   7.4e-19
6 GO:0044710       single-organism metabolic process      3547         488   359.19   1.0e-18

# get top 5 GO ids
goid <- as.character(allRes$GO.ID)[1:5]
goid
[1] "GO:0044699" "GO:0044763" "GO:0008150" "GO:0009987" "GO:0048522"

# printGenes function
printGenes(object = GOdata, 
           whichTerms = goid, 
           geneCutOff = 500,
           chip = 'org.Mm.eg.db')

Error in get(paste(chip, "ENTREZID", sep = "")) : 
  object 'org.Mm.egENTREZID' not found

# sessionInfo
R version 3.2.0 (2015-04-16)
Platform: x86_64-apple-darwin13.4.0 (64-bit)
Running under: OS X 10.10 (Yosemite)

locale:
  [1] en_US.UTF-8/en_US.UTF-8/en_US.UTF-8/C/en_US.UTF-8/en_US.UTF-8

attached base packages:
  [1] stats4    parallel  stats     graphics  grDevices utils     datasets  methods   base     

other attached packages:
  [1] mogene20sttranscriptcluster.db_8.3.1 org.Mm.eg.db_3.1.2                   topGO_2.20.0                        
[4] SparseM_1.6                          GO.db_3.1.2                          RSQLite_1.0.0                       
[7] DBI_0.3.1                            AnnotationDbi_1.30.1                 GenomeInfoDb_1.4.0                  
[10] IRanges_2.2.4                        S4Vectors_0.6.0                      Biobase_2.28.0                      
[13] graph_1.46.0                         BiocGenerics_0.14.0                 

loaded via a namespace (and not attached):
  [1] lattice_0.20-31 grid_3.2.0      tools_3.2.0   

In the printGenes function, instead of mogene20sttranscriptcluster.db, I want to use org.Mm.eg.db to make the code more generalized but it is throwing an error.
How can I use org.Mm.eg.db or org.Hs.eg.db instead of specific chip in the printGenes function?

topgo org.mm.eg.db • 2.6k views
ADD COMMENT
0
Entering edit mode
@fletchkatie-7182
Last seen 9.4 years ago
United Kingdom

Hi there. Just wondering if you worked out how to do this, as I am having a similar problem using the org.Hs.eg.db?

Thank you.

ADD COMMENT

Login before adding your answer.

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