ReadGPR.R

From Organic Design wiki
Revision as of 03:30, 23 February 2006 by Sven (talk | contribs)

readGPR <- function(sourceType="median", dataDir="/Volumes/HD2/Data/Nutrigenomics/MultipleScans/GPR",...) {

 require(limma) 
  1. 0) Provide log of session information
 print(sessionInfo())
  1. 1) Read medians or means...
 source.type <- switch(sourceType,
                       mean   = "genepix",
                       median = "genepix.median"
                       )
 print(paste("source =",source.type))
 if(exists("targets", inherits=FALSE)) {
   RG <- read.maimages(targets$Filename, path = dataDir, source=source.type, names=paste(targets$Filetype, targets$Scan), ...)
 } else {
   RG <- read.maimages(dir(dataDir, pattern=".gpr"), path = dataDir, source=source.type, wt.fun=wtflags(0), ...)
 }
   RG$printer <- getLayout(RG$genes)
 return(RG)

}