[BioC] mget function - newbie question

Jenny Drnevich drnevich at illinois.edu
Tue Nov 11 20:12:59 CET 2008

Hi Tim,

"get" returns a list object for that entrezID, where the names of the 
items in the list are the GO ids. "mget" combines the individuals 
lists together in another list, so to get the same output you have to 
go down one level:

 > names(mget(ids,ent2GO)[[1]])
[1] "GO:0008150" "GO:0005576" "GO:0003674"

 > names(mget(ids,ent2GO)[[2]])
  [1] "GO:0007584" "GO:0010037" "GO:0051260" "GO:0051384" "GO:0005576"
  [6] "GO:0005576" "GO:0031093" "GO:0004867" "GO:0017114" "GO:0019899"
[11] "GO:0019959" "GO:0019966" "GO:0043120"

so get(ids[1],ent2GO) is the same as mget(ids,ent2GO)[[1]]


At 12:23 PM 11/11/2008, Tim Smith wrote:
>I was trying to get GO terms that were annotated to my set of genes. 
>Although the 'get' function returns what I want when I do it one 
>gene at a time, the 'mget' function does not appear to do the same 
>for a set of genes. For example:
> > library(org.Hs.eg.db)
> >  ent2GO <- org.Hs.egGO
> > ids <- c('1','2')
> > names(get('1',ent2GO))
>[1] "GO:0008150" "GO:0005576" "GO:0003674"
> > names(get('2',ent2GO))
>  [1] "GO:0006886" "GO:0007584" "GO:0010037" "GO:0051260" "GO:0051384"
>"GO:0005576" "GO:0004867" "GO:0008320" "GO:0017114" "GO:0019899"
>[12] "GO:0019966" "GO:0043120"
> > names(mget(ids,ent2GO))
>[1] "1" "2"
>What else do I need to do for the mget function to return a set of GO ids?
>         [[alternative HTML version deleted]]
>Bioconductor mailing list
>Bioconductor at stat.math.ethz.ch
>Search the archives: 

Jenny Drnevich, Ph.D.

Functional Genomics Bioinformatics Specialist
W.M. Keck Center for Comparative and Functional Genomics
Roy J. Carver Biotechnology Center
University of Illinois, Urbana-Champaign

330 ERML
1201 W. Gregory Dr.
Urbana, IL 61801

ph: 217-244-7355
fax: 217-265-5066
e-mail: drnevich at illinois.edu

More information about the Bioconductor mailing list