[BioC] limma topTable doesn't work without replicates [was: Help with limma]

Venu Pullabhatla venu.pullabhatla at kcl.ac.uk
Tue Oct 16 12:30:54 CEST 2012


Dear Gordon

Thank you very much for your help. I got it working now and also sorry 
for not keeping the discussion on the list.

Best wishes

Venu



On 15/10/12 23:02, Gordon K Smyth wrote:
> Dear Venu,
>
> Please keep the discussion on the list.
>
> log2-fold-changes are contained in fit2$coefficients.
>
> Best wishes
> Gordon
>
>
>
> On Mon, 15 Oct 2012, Venu Pullabhatla wrote:
>
>> Dear Gordon
>>
>> Many thanks for your reply. Apologies I should have been a little 
>> more descriptive in my problem. I am aware that Limma cannot 
>> calculate any statistics without replicates. So I wanted to get the 
>> fold change only using topTable, but I am not aware that topTable 
>> does not work without replicates. I assumed I can get the toptable 
>> output, but without the statistics due to lack of replicates. Can you 
>> please guide me how to find out fold changes without replicates using 
>> Limma. I am using agilent single channel. Once again thanks a lot for 
>> your continued help and support with Limma.
>>
>> Best wishes
>>
>> Venu
>>
>> On 14/10/12 23:47, Gordon K Smyth wrote:
>>> 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
>>>>
>>
>>
>> -- 
>> Venu Pullabhatla, Ph.D.
>> Bioinformatician
>> NIHR GSTFT/KCL Comprehensive Biomedical Research Centre
>> Guy's & St. Thomas' NHS Foundation Trust
>> 8th Floor, Tower Wing, Guy's Hospital
>> Great Maze Pond, London SE1 9RT
>>
>>
>>
>
> ______________________________________________________________________
> The information in this email is confidential and inte...{{dropped:17}}



More information about the Bioconductor mailing list