Skip to content
Back to formatted view

Raw Message

Message-ID: <1C56F3EE22DF4F458FE02F58B96D4150555EBC2465@DJFEXMBX01.djf.agrsci.dk>
Date: 2011-07-15T15:43:11Z
From: Stefan McKinnon Høj-Edwards
Subject: [Bioc-devel] add function to "annotate" package
In-Reply-To: <mailman.21.1310637607.12642.bioc-devel@r-project.org>

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.