[Bioc-devel] add function to "annotate" package

Stefan McKinnon Høj-Edwards Stefan.Hoj-Edwards at agrsci.dk
Fri Jul 15 17:43:11 CEST 2011


Hi Robert,

I had the same issue as what you describe, so I went ahead and made my own package for it, "AnnotationFuncs". It can be downloaded from BioC. One of the main functions in my package is "translate", which does what you are looking for.

Basically, you example would go like this:
library(org.Hs.eg.db)
library(AnnotationFuncs)

testEntrez <- c("1","10","100","1000")
translate(testEntrez, org.Hs.egSYMBOL)

There are some options, e.g. if you had a list of symbols that you wanted to map to RefSeq IDs; with "translate", it can be done with one line. There are additional examples in the vignette.

Kind regards,

Stefan McKinnon Høj-Edwards     Dept. of Genetics and Biotechnology
PhD student                     Faculty of Agricultural Sciences
stefan.hoj-edwards at agrsci.dk    Aarhus University
Tel.: +45 8999 1291             Blichers Allé 20, Postboks 50
Web: www.iysik.com              DK-8830 Tjele
                                Tel.: +45 8999 1900
                                Web: www.agrsci.au.dk




-----Oprindelig meddelelse-----
Date: Wed, 13 Jul 2011 14:47:08 -0400
From: "Robert M. Flight" <rflight79 at gmail.com>
To: bioc-devel at r-project.org
Subject: [Bioc-devel] add function to "annotate" package
Message-ID:
	<CAJLyBTUqdKQwsH=WVca6phMJGY18CP_Qt+6OLLu01B4m_dwBVw at mail.gmail.com>
Content-Type: text/plain; charset=ISO-8859-1

Would it make sense to add one extra level of convenience to the
"getAnnMap" function in "annotate", that represents what I am sure is
one of the largest number of uses of the bimaps as an environment,
which is getting information about a particular set of genes or other
identifier?

getAnnotation <- function(id,annPackage,mapID,doUnlist=TRUE){
	annEnv <- getAnnMap(mapID, annPackage, load=TRUE)
  tmpDat <- mget(id, annEnv, ifnotfound=NA)
  if (doUnlist){
  	tmpDat <- unlist(tmpDat, use.names=FALSE)
  }
  return(tmpDat)
}

# simple example, but I do this for a lot of different things frequently
library(annotate)
testEntrez <- c("1","10","100","1000")
getAnnotation(testEntrez,"org.Hs.eg.db","SYMBOL")

Thanks,

-Robert

Robert M. Flight, Ph.D.
University of Louisville Bioinformatics Laboratory
University of Louisville
Louisville, KY

PH 502-852-1809 (HSC)
PH 502-852-0467 (Belknap)
EM robert.flight at louisville.edu
EM rflight79 at gmail.com

Williams and Holland's Law:
? ? ?? If enough data is collected, anything may be proven by
statistical methods.



More information about the Bioc-devel mailing list