[BioC] limma: no residual degrees of freedom

Straubhaar, Juerg Juerg.Straubhaar at umassmed.edu
Fri Jan 23 16:23:50 MET 2004

Dear Dr. Smyth,

As other limma users I got a 'no residual degrees of freedom' when trying to calculate the Bayes statistics:

fit <- lmFit(MA, design)
contrast.matrix <- makeContrasts(R10, R40, N2L, R10-R40, R40-N2L, R10-N2L, levels=design)
cfit <- contrasts.fit(fit, contrast.matrix)
eb <- eBayes(cfit)

As you indicated in an earliner message, the reason for this is that all fit$df.residual are missing.

There is this code segment in the lm.series function which is called by lmFit():

if(!is.null(weights)) {
        weights <- as.matrix(weights)
        if(any(dim(weights) != dim(M))) weights <- array(weights,dim(M))
        weights[weights <= 0] <- NA
        M[!is.finite(weights)] <- NA

This replaces elements of the weight matrix which are 0 or less and also the corresponding elements in MA$M with NA. My weight matrix consists of zeros and negative numbers which were generated when reading in the Stanford Microarray Database (SMD) files with the command:

RG<-read.maimages(targets$FileName, source="smd", fill=T, wt.fun=function(x) {return(x$FLAG)})

This copies the FLAG column values into the weight matrix and in the raw smd file this column consists of zeros and negative numbers.

Modifying the wt.fun parameter of read.maimages and using


didn't work and generated an error message since there is no column named 'Flags', the SMD file has a 'FLAG' column. A simple change in the wtflags function clears all this error messages.

wtflags <- function(w=0.1)
#   Quality weights based on Flags from GenePix output
#   Gordon Smyth
#   9 March 2003.  Last revised 11 June 2003.

function(gpr) {
# changed "Flags" to "FLAG"
    flagged <- (gpr[,"FLAG"] < 0)
    w*flagged + !flagged

Kind regards,
Juerg Straubhaar, PhD
Umass Med

More information about the Bioconductor mailing list