mget function - newbie question
1
0
Entering edit mode
Tim Smith ★ 1.1k
@tim-smith-1532
Last seen 10.2 years ago
Hi, 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" "GO:0019959" [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? thanks! [[alternative HTML version deleted]]
GO GO • 1.5k views
ADD COMMENT
0
Entering edit mode
Jenny Drnevich ★ 2.0k
@jenny-drnevich-2812
Last seen 6 months ago
United States
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]] HTH, Jenny At 12:23 PM 11/11/2008, Tim Smith wrote: >Hi, > >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" >"GO:0019959" >[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? > >thanks! > > > > > [[alternative HTML version deleted]] > >_______________________________________________ >Bioconductor mailing list >Bioconductor at stat.math.ethz.ch >https://stat.ethz.ch/mailman/listinfo/bioconductor >Search the archives: >http://news.gmane.org/gmane.science.biology.informatics.conductor 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 USA ph: 217-244-7355 fax: 217-265-5066 e-mail: drnevich at illinois.edu
ADD COMMENT

Login before adding your answer.

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