[BioC] limma topTable doesn't work without replicates [was: Help with limma]
Gordon K Smyth
smyth at wehi.EDU.AU
Mon Oct 15 00:47:51 CEST 2012
Dear Venu,
limma requires replicates. Pretty much any statistical testing method
requires replicates.
You can run lmFit() without replicates, which gives you fold changes, but
you cannot go on to compute eBayes statistics or to use topTable().
The same answer has been given to many posts asking this question over
the years.
I am a bit puzzled what you expect limma to do for you in the absence of
replication.
Best wishes
Gordon
> Date: Fri, 12 Oct 2012 10:06:40 +0100
> From: Venu Pullabhatla <venu.pullabhatla at kcl.ac.uk>
> To: <bioconductor at stat.math.ethz.ch>
> Subject: [BioC] Help with Limma
>
> 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
>
______________________________________________________________________
The information in this email is confidential and intend...{{dropped:4}}
More information about the Bioconductor
mailing list