[BioC] Help with Limma

Venu Pullabhatla venu.pullabhatla at kcl.ac.uk
Fri Oct 12 11:06:40 CEST 2012


Dear Limma users

After finishing the analysis successfully with replicates, I am now 
trying to analyze the same without replicates. After following a 
suggestion that I can use Limma without applying the fit2 <- 
eBayes(fit2) step (for without replicates), I tried to do the same for 
just one of the patients as a test, but it failed because of the 
following error.

Error in array(x, c(length(x), 1L), if (!is.null(names(x))) 
list(names(x),  :
  attempt to set an attribute on NULL
Calls: topTable ... toptable -> as.matrix -> as.matrix.default -> array
Execution halted

I get this error when applying topTable function to get the list of DE 
genes. I have searched a lot for getting possible answers, but only 
ended in vain. I came across this post in many forums, but with no 
working solution. Can anyone please rectify my mistake in the script.

I used the same script successfully for analyzing with replicates except 
applying the fit2 <- eBayes(fit2) step because of lack of replicates.

Here is the script I am using


library(limma)
library(annotate)
library(hgug4845a.db)

targets <- readTargets("targets_individual_test", sep="\t")
data <- read.maimages(targets, path=".", source="agilent.median", 
green.only=TRUE)
bgdata <- backgroundCorrect(data, method="normexp", offset=16)
normdata <- normalizeBetweenArrays(bgdata, method="quantile")
normdata_avg <- avereps(normdata, ID=normdata$genes$ProbeName)

condition <- factor(targets$Condition, levels = unique(targets$Condition))
design <- model.matrix(~0 + condition)
colnames(design) <- levels(condition)

fit <- lmFit(normdata_avg, design)
fit$genes$Symbol <- getSYMBOL(fit$genes$ProbeName,"hgug4845a.db")

contrast.matrix <- makeContrasts("Healthy-State1", "Healthy-State2", 
"Healthy-State3", levels=design)
fit2 <- contrasts.fit(fit, contrast.matrix)

######## FINE UNTIL THIS STEP ###########################

output <- topTable(fit2, coef="Healthy-State1", genelist=fit$genes, 
number=Inf)

###### I GET THE ERROR AFTER RUNNING THE ABOVE COMMAND #######

Error in array(x, c(length(x), 1L), if (!is.null(names(x))) 
list(names(x),  :
  attempt to set an attribute on NULL
Calls: topTable ... toptable -> as.matrix -> as.matrix.default -> array
Execution halted

#################################################

write.table(output, file="output.txt", sep="\t", quote=FALSE)

Many million thanks for the continued help and support.

Best wishes

Venu



More information about the Bioconductor mailing list