[BioC] BioC problem with result.summary in simpleaffy

James W. MacDonald jmacdon at med.umich.edu
Mon Jan 12 15:05:50 CET 2009


Hi Marietta,

Marietta Herrmann wrote:
> Hi, 
> 
> I have a problem with result.summary in simpleaffy:
> 
>> raw.data <- read.affy("covdesc.txt")
>> x.rma<-call.exprs(raw.data, "rma")
> Background correcting
> Normalizing
> Calculating Expression
>> pw <- pairwise.comparison(x.rma,"genotype")
>> pw.filtered<-pairwise.filter(pw)
>> summary<-results.summary(pw.filtered, "mouse4302.db")
> Loading required package: AnnotationDbi
> Loading required package: DBI
> Error in get(paste(cdfname, "SYMBOL", sep = "")) :
>  variable "mouse4302.dbSYMBOL" was not found
> 
> I also tried:
> "mouse4302cdf" which gave the same error
> 
> and
> 
>> summary<-results.summary(pw.filtered, "mouse4302")
> Error in library(cdfname, character.only = TRUE) :
>   there is no package called 'mouse4302'

Theoretically speaking the above function call is correct. It's a bit 
misleading IMO that the second argument is called 'cdfname' when in fact 
what you want is the annotation package name.

The problem is arising because it appears the function is not aware of 
the new SQLite-based annotation packages, which are loaded by a call to 
library(mouse4302.db), but data are accessed by dropping the .db in the 
name.

You don't give your sessionInfo() (tsk, tsk), so it is hard to tell you 
how to fix this for the short term. If you are on a *nix of some sort, 
you can simply get the sources and change the function get.annotation to 
read thusly:

get.annotation <- function (x, cdfname, verbose = FALSE) {
     library(cdfname, character.only = TRUE)
     cdfname <- sub("\\.db$", "", cdfname) ## add this line
<snip>
}

If you are on Windows or MacOS and aren't set up to install packages, 
you may still be able to simply paste a modified version into a working 
R session (after loading simpleaffy) that will mask the version in 
simpleaffy (not tested):

get.annotation <- function (x, cdfname, verbose = FALSE) {
     library(cdfname, character.only = TRUE)
     cdfname <- sub("\\.db$", "", cdfname)
     symb <- simpleaffy:::.strip.list(mget(x, envir = get(paste(cdfname, 
"SYMBOL",
         sep = "")), ifnotfound = 
list(simpleaffy:::.if.probeset.not.found)))
     desc <- simpleaffy:::.strip.list(mget(x, envir = get(paste(cdfname, 
"GENENAME",
         sep = "")), ifnotfound = 
list(simpleaffy:::.if.probeset.not.found)))
     accno <- simpleaffy:::.strip.list(mget(x, envir = 
get(paste(cdfname, "ACCNUM",
         sep = "")), ifnotfound = 
list(simpleaffy:::.if.probeset.not.found)))
     uni <- simpleaffy:::.strip.list(mget(x, envir = get(paste(cdfname, 
"UNIGENE",
         sep = "")), ifnotfound = 
list(simpleaffy:::.if.probeset.not.found)))
     ok <- (symb != "NoAnno") & (desc != "NoAnno") & (accno !=
         "NoAnno") & (uni != "NoAnno")
     names(ok) <- x
     if (!ok && verbose) {
         warning(paste("value for '", names(ok)[ok], "' not found",
             sep = ""), call. = FALSE)
     }
     acc.lnk <- 
paste("=HYPERLINK(\"http://www.ncbi.nlm.nih.gov/entrez/query.fcgi?cmd=search&db=nucleotide&term=", 

         accno, "\",\"", accno, "\")", sep = "")
     acc.lnk[!ok] <- "NoAnno"
     uni.lnk <- 
paste("=HYPERLINK(\"http://www.ncbi.nlm.nih.gov/entrez/query.fcgi?cmd=search&db=unigene&term=", 

         uni, "&dopt=unigene\",\"", uni, "\")", sep = "")
     uni.lnk[!ok] <- "NoAnno"
     res <- cbind(symb, acc.lnk, uni.lnk, desc)
     res[res == "NoAnno"] <- "No Annotation Found"
     colnames(res) <- c("gene name", "accession", "unigene", "description")
     return(res)
}


And you might write Crispin Miller directly about this bug in case he 
missed this on the list.

Best,

Jim




> 
> When I try to go on despite the error I get the next problem, perhaps as
> result of the previous error?!
> 
>> write.annotation(file="result_simpleaffy.xls",summary)
> Error in as.data.frame.default(x[[i]], optional = TRUE) :
>   cannot coerce class "standardGeneric" into a data.frame
> 
> Perhaps I just made some stupid mistakes?!
> 
> Best regards,
> Marietta Herrmann
> 
> _______________________________________________
> 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

-- 
James W. MacDonald, M.S.
Biostatistician
Hildebrandt Lab
8220D MSRB III
1150 W. Medical Center Drive
Ann Arbor MI 48109-5646
734-936-8662



More information about the Bioconductor mailing list