Difference between revisions of "ReadGPR.R"
From Organic Design wiki
m |
m |
||
(2 intermediate revisions by the same user not shown) | |||
Line 1: | Line 1: | ||
− | + | # {{R}} | |
− | sessionInfo() | + | readGPR <- function(sourceType="median", dataDir="/Volumes/HD2/Data/Nutrigenomics/MultipleScans/GPR",...) { |
+ | require(limma) | ||
+ | # 0) Provide log of session information | ||
+ | print(sessionInfo()) | ||
− | + | # 1) Read medians or means... | |
− | + | source.type <- switch(sourceType, | |
− | + | mean = "genepix", | |
− | + | median = "genepix.median" | |
− | + | ) | |
− | # 1) | + | 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 { | |
− | source.type <- switch( | + | RG <- read.maimages(dir(dataDir, pattern=".gpr"), path = dataDir, source=source.type, wt.fun=wtflags(0), ...) |
− | + | } | |
− | + | RG$printer <- getLayout(RG$genes) | |
− | + | return(RG) | |
− | print(paste("source =",source.type)) | + | } |
− | |||
− | RG <- read.maimages(targets$Filename, path = dataDir, source=source.type, names=paste(targets$Filetype, targets$Scan), | ||
− | |||
− | RG$printer <- getLayout(RG$genes) |
Latest revision as of 00:46, 6 June 2007
Code snipits and programs written in R, S or S-PLUS readGPR <- function(sourceType="median", dataDir="/Volumes/HD2/Data/Nutrigenomics/MultipleScans/GPR",...) {
require(limma)
- 0) Provide log of session information
print(sessionInfo())
- 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)
}