Search
Question: How to use org.Mm.eg.db as chip in topGO printGenes function
0
gravatar for komalr
3.4 years ago by
komalr0
United States
komalr0 wrote:

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?

ADD COMMENTlink modified 3.2 years ago by fletchkatie0 • written 3.4 years ago by komalr0
0
gravatar for fletchkatie
3.2 years ago by
United Kingdom
fletchkatie0 wrote:

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 COMMENTlink written 3.2 years ago by fletchkatie0
Please log in to add an answer.

Help
Access

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.
Powered by Biostar version 2.2.0
Traffic: 197 users visited in the last hour