[BioC] How to load annotations for pkgENTREZID, pkgGENENAME dynamically?

Sean Davis sdavis2 at mail.nih.gov
Sat Sep 27 17:35:21 CEST 2008


On Sat, Sep 27, 2008 at 9:57 AM, Jani, Saurin D <jani at musc.edu> wrote:
> Dear BioC,
>
> Here is my R script code which is running on  server in background.
> ##################################
> chiptype <- annotation(affy_batch_object);
>
> if(chiptype == "hu6800")
> {
> library(hu6800cdf);
> library(hu6800probe);
> library(hu6800);
> library(humanCHRLOC);
> library(humanLLMappings);
> envGeneNames <- hu6800GENENAME; # very important
> envPath2Probes <- hu6800PATH2PROBE;
> envGO2AllPROBES <- hu6800GO2ALLPROBES;
> envGENEIDS <- hu6800ENTREZID; # very important
> }
>
> and so on for commonly used AFFY Chips....
> ##################################
>
> I have written this manually, how can I load annotations and packageENGREZID, packageGENENAME..etc. dynamically?
>
> I am currently working with Affy chips but I also like to work on Agilent chips in futureI.

Hi, Saurin.  You didn't give your sessionInfo(), but you will want to
be using the .db packages and R-2.7 if possible, since those are now
the standard for distributing annotation packages.  You can look at
the AnnotationDbi package vignette for details.  That said, this will
work for the older environment-base packages, if you like, thanks to
the environment API.

> annot <- 'hu6800'
> l <- paste(annot,'.db',sep="")
> library(l,character.only=TRUE)
> geneNames <- as.list(get(paste(annot,'GENENAME',sep="")))
> geneNames[1:5]
$A28102_at
[1] "gamma-aminobutyric acid (GABA) A receptor, alpha 3"

$AB000114_at
[1] "osteomodulin"

$AB000115_at
[1] "interferon-induced protein 44-like"

$AB000220_at
[1] "sema domain, immunoglobulin domain (Ig), short basic domain,
secreted, (semaphorin) 3C"

$AB000381_s_at
[1] "glycosylphosphatidylinositol anchored molecule like protein"

> geneIDs <- as.list(get(paste(annot,'ENTREZID',sep="")))
> geneIDs[1:5]
$A28102_at
[1] "2556"

$AB000114_at
[1] "4958"

$AB000115_at
[1] "10964"

$AB000220_at
[1] "10512"

$AB000381_s_at
[1] "2765"


> I just write a perl/php scripts which prints above information...thats my thinking.

You could certainly do that, also, but I challenge you to do what was
done above in 4 lines of code.  : )

Sean



More information about the Bioconductor mailing list