[Robast-commits] r260 - in pkg/RobLoxBioC: R man
noreply at r-forge.r-project.org
noreply at r-forge.r-project.org
Wed Mar 4 09:58:34 CET 2009
Author: stamats
Date: 2009-03-04 09:58:34 +0100 (Wed, 04 Mar 2009)
New Revision: 260
Modified:
pkg/RobLoxBioC/R/robloxAffyBatch.R
pkg/RobLoxBioC/man/robloxbioc.Rd
Log:
added Affymetrix scale normalization
Modified: pkg/RobLoxBioC/R/robloxAffyBatch.R
===================================================================
--- pkg/RobLoxBioC/R/robloxAffyBatch.R 2009-03-03 08:00:21 UTC (rev 259)
+++ pkg/RobLoxBioC/R/robloxAffyBatch.R 2009-03-04 08:58:34 UTC (rev 260)
@@ -2,9 +2,9 @@
## Use robloxbioc to preprocess Affymetrix-data - comparable to MAS 5.0
###############################################################################
setMethod("robloxbioc", signature(x = "AffyBatch"),
- function(x, pmcorrect = "roblox", verbose = TRUE,
+ function(x, pmcorrect = "roblox", normalize = FALSE, verbose = TRUE,
eps = NULL, eps.lower = 0, eps.upper = 0.1, steps = 1L, mad0 = 1e-4,
- contrast.tau = 0.03, scale.tau = 10, delta = 2^(-20)) {
+ contrast.tau = 0.03, scale.tau = 10, delta = 2^(-20), sc = 500) {
n <- length(x)
ids <- featureNames(x)
m <- length(ids)
@@ -57,7 +57,6 @@
l <- t(t(pps.mm >= pps.pm) & (sb[k,] <= contrast.tau))
pps.im[l] <- t(t(pps.pm)/2^(contrast.tau/(1 + (contrast.tau - sb[k,])/scale.tau)))[l]
pm.corrected <- pmax.int(pps.pm - pps.im, delta)
- # pm.corrected[pm.corrected < delta] <- delta
res[[k]] <- pm.corrected
}
}else{
@@ -83,5 +82,15 @@
eset <- new("ExpressionSet", phenoData = phenoData(x),
experimentData = experimentData(x), exprs = exp.mat,
se.exprs = se.mat, annotation = annotation(x))
+ if(normalize){
+ if(verbose) cat("Scale normalization ...")
+ for (i in 1:ncol(exprs(eset))) {
+ slg <- exprs(eset)[, i]
+ sf <- sc/mean(slg, trim = 0.02)
+ reported.value <- sf * slg
+ exprs(eset)[, i] <- reported.value
+ }
+ if(verbose) cat(" done.\n")
+ }
return(eset)
})
Modified: pkg/RobLoxBioC/man/robloxbioc.Rd
===================================================================
--- pkg/RobLoxBioC/man/robloxbioc.Rd 2009-03-03 08:00:21 UTC (rev 259)
+++ pkg/RobLoxBioC/man/robloxbioc.Rd 2009-03-04 08:58:34 UTC (rev 260)
@@ -14,9 +14,9 @@
\S4method{robloxbioc}{matrix}(x, eps = NULL, eps.lower = 0, eps.upper = 0.1, steps = 1L, mad0 = 1e-4)
-\S4method{robloxbioc}{AffyBatch}(x, pmcorrect = "roblox", verbose = TRUE,
+\S4method{robloxbioc}{AffyBatch}(x, pmcorrect = "roblox", normalize = "FALSE", verbose = TRUE,
eps = NULL, eps.lower = 0, eps.upper = 0.1, steps = 1L, mad0 = 1e-4,
- contrast.tau = 0.03, scale.tau = 10, delta = 2^(-20))
+ contrast.tau = 0.03, scale.tau = 10, delta = 2^(-20), sc = 500)
}
\arguments{
\item{x}{ biological data. }
@@ -32,13 +32,15 @@
\item{pmcorrect}{ method used for PM correction; so far only "roblox" and \code{pm.only}
are implemented. The algorithm is comparable to the algorithm of MAS 5.0; confer
\code{\link[affy]{pmcorrect.mas}}. }
+ \item{normalize}{ logical: if \code{TRUE}, Affymetrix scale normalization is performed. }
+ \item{verbose}{ logical: if \code{TRUE}, some messages are printed. }
\item{contrast.tau}{ a number denoting the contrast tau parameter; confer the MAS 5.0
PM correction algorithm. }
\item{scale.tau}{ a number denoting the scale tau parameter; confer the MAS 5.0
PM correction algorithm. }
\item{delta}{ a number denoting the delta parameter; confer the MAS 5.0
PM correction algorithm. }
- \item{verbose}{ logical: if \code{TRUE}, some messages are printed }
+ \item{sc}{ value at which all arrays will be scaled to. }
}
\details{
The optimally-robust resp. the radius-minimax (rmx) estimator for normal location
@@ -118,6 +120,7 @@
if(require(affydata)){
data(Dilution)
eset <- robloxbioc(Dilution)
+ eset1 <- robloxbioc(Dilution, normalize = TRUE)
}
}
\concept{normal location and scale}
More information about the Robast-commits
mailing list