soybean.mod.qc.affy <- function (unnormalised, normalised = NULL, tau = 0.015, logged = TRUE, cdfn = cleancdfname(cdfName(unnormalised))) { if (is.null(normalised)) { getAllSpikeProbes("hgu133acdf") normalised <- call.exprs(unnormalised, "mas5") } ### ### All lines that have been removed from Crispin Miller's ### original qc.affy() function are delimited with a pound sign ### #if (!haveQCParams(cleancdfname(cdfName(unnormalised)))) { # stop(paste("I'm sorry, I do not know about chip type:", # cleancdfname(cdfName(unnormalised)))) # } ### ### x <- exprs(normalised) ### ### ### Crispin Miller's orginal qc.affy() function contains the following statement: ### det <- detection.p.val(unnormalised, tau = tau, alpha1 = getAlpha1(cdfn), ### alpha2 = getAlpha2(cdfn)) ### ### At this point, hardcode values of your choice for alpha1 and alpha2. ### Note: mas5calls() uses a generic values of 0.04 and 0.06, respectively, ### for alpha1 and alpha2. ### det <- detection.p.val(unnormalised, tau = tau, alpha1 = .04, alpha2 = .06) dpv <- apply(det$call, 2, function(x) { x[x != "P"] <- 0 x[x == "P"] <- 1 x <- as.numeric(x) return(100 * sum(x)/length(x)) }) sfs <- normalised@description@preprocessing$sfs target <- normalised@description@preprocessing$tgt if (!logged) { x <- log2(x) } bgsts <- .bg.stats(unnormalised)$zonebg meanbg <- apply(bgsts, 1, mean) minbg <- apply(bgsts, 1, min) maxbg <- apply(bgsts, 1, max) stdvbg <- sqrt(apply(bgsts, 1, var)) ### ### More code to be commented out... ### # qc.probenames <- getAllQCProbes(cdfn) # qc.probe.vals <- rbind(c(), (sapply(qc.probenames, function(y) { # x[y, ] # }))) # rownames(qc.probe.vals) <- colnames(x) # spike.probenames <- getAllSpikeProbes(cdfn) # spike.vals <- rbind(c(), (sapply(spike.probenames, function(y) { # x[y, ] # }))) # rownames(spike.vals) <- colnames(x) # bb <- getBioB(cdfn) # if (!is.na(bb)) { # biobcalls <- det$call[bb, ] # } # else { # biobcalls <- NULL # } ### ### The original return function from Crispin Miller's qc.affy() function is: ### return(new("QCStats", scale.factors = sfs, target = target, ### percent.present = dpv, average.background = meanbg, minimum.background = minbg, ### maximum.background = maxbg, spikes = spike.vals, qc.probes = qc.probe.vals, ### bioBCalls = biobcalls)) ### ### The return function has been modified as follows: ### return(new("QCStats", scale.factors = sfs, target = target, percent.present = dpv, average.background = meanbg, minimum.background = minbg, maximum.background = maxbg)) }