[BioC] Problem with Limma - Possible Limma/affy bug - minimal code not working - Solved - Minor doubt
James W. MacDonald
jmacdon at uw.edu
Sat Apr 6 19:47:39 CEST 2013
Hi Atul,
On 4/5/2013 7:08 PM, Atul Kakrana wrote:
> Hi Jim,
>
> Thanks. So, I turned the code upside down just to know that it was a
> typo. Your suggestion fixed my problem.
>
> I just have minor doubt:
>
> What is the difference in using
> fit<- lmFit(exprs(esetRMA), design)
>
> OR
> fit<- lmFit(esetRMA, design)
>
> Does this effect result in any possible way?
No. From ?lmFit:
|object|
object of class |numeric|, |matrix|, |MAList|, |EList|, |marrayNorm|,
|ExpressionSet| or |PLMset| containing log-ratios or log-values of
expression for a series of microarrays
In the first case you are feeding lmFit a matrix, in the second an
ExpressionSet. Internally lmFit will then do exprs(esetRMA) to get the
data, so the results will be identical.
Best,
Jim
>
> Thanks
>
> AK
>
>
>
>
>
>
> On 04/05/2013 06:41 PM, James W. MacDonald wrote:
>> Hi Atul,
>>
>> I think the problem arises because you are using ebayes() instead of
>> eBayes(). See ?eBayes, particularly the part after the Value heading.
>>
>> Best,
>>
>> Jim
>>
>> On 4/5/2013 6:07 PM, Atul Kakrana wrote:
>>> Hello All and Abdul,
>>>
>>> The fix suggested by Abdul didn't work. I reduced the code to minimal
>>> basic and tried work on other publicly available datasets but the
>>> problem is still the same.
>>>
>>>
>>> It seems to a bug with Limma or Affy?
>>>
>>> Dataset used: http://www.ncbi.nlm.nih.gov/geosuppl/?acc=GSE9711
>>>
>>> CODE:
>>> library(affy)
>>> library(limma)
>>>
>>> setwd("/home/atul/Dropbox/Analysis/1.iSyTE/test_cel")# Need to change
>>> the directory to where the CEL files are stored
>>> mydata<- ReadAffy()
>>> mydata
>>>
>>> esetRMA<- rma(mydata)# RMA from affy was used in iSYTE paper - Ready
>>> made - does Background correction and Normalization by default algos -
>>> See 'affy' manual
>>> esetRMA
>>>
>>> sampletype<- c('1','1','1','2','2','2')
>>> design<- model.matrix(~0+factor(sampletype))## required to avoid
>>> intercept
>>> colnames(design)<- c('Cont','Test') ## Personalize the design with col
>>> names
>>>
>>> # fit<- lmFit(exprs(esetRMA), design)
>>> fit<- lmFit(exprs(esetRMA), design)
>>> contrast.matrix<-makeContrasts(Test-Cont, levels=design)
>>> fit2<- contrasts.fit(fit,contrast.matrix)
>>> fit2<- ebayes(fit2)
>>> topTable(fit2, coef = 1, adjust = "BH", number = 50)
>>>
>>> Error in array(x, c(length(x), 1L), if (!is.null(names(x)))
>>> list(names(x), :
>>> 'data' must be of a vector type
>>>
>>> I am trying to fix this error from last few days but couldn't find a
>>> solution. I would really appreciate your help.
>>>
>>> AK
>>>
>>>
>>> On 04/05/2013 01:13 AM, abdul rawoof wrote:
>>>> Hello Atul,
>>>>
>>>> Please follow the following script. You need to convert your
>>>> normalised data into expression set value using exprs.
>>>> I hope your problem will solve.
>>>>
>>>>> fit<- lmFit*(exprs(esetRMA)*, design)
>>>>> contrast.matrix<-makeContrasts(Ten-WB, levels=design)
>>>>> fit2<- contrasts.fit(fit,contrast.matrix)
>>>>> fit2<- ebayes(fit2).
>>>> On Fri, Apr 5, 2013 at 4:31 AM, Atul Kakrana<atulkakrana at gmail.com
>>>> <mailto:atulkakrana at gmail.com>> wrote:
>>>>
>>>> Hello All,
>>>>
>>>> I wrote a script to analyse affymetrix data but its giving an
>>>> error
>>>> while using the topTable from limma:
>>>>
>>>> Error in array(x, c(length(x), 1L), if (!is.null(names(x)))
>>>> list(names(x), :
>>>> 'data' must be of a vector type
>>>>
>>>> I checked all the steps that might be causing the error but
>>>> couldn't
>>>> find out. So, I trimmed my script to minimal basic and it still
>>>> gives me
>>>> same error.
>>>>
>>>> > mydata<- ReadAffy()
>>>> > esetRMA<- rma(mydata)
>>>> Background correcting
>>>> Normalizing
>>>> Calculating Expression
>>>> > esetRMA
>>>> ExpressionSet (storageMode: lockedEnvironment)
>>>> assayData: 45101 features, 12 samples
>>>> element names: exprs
>>>> protocolData
>>>> sampleNames: 00.0A.CEL 00.0B.CEL ... 12.5C.CEL (12 total)
>>>> varLabels: ScanDate
>>>> varMetadata: labelDescription
>>>> phenoData
>>>> sampleNames: 00.0A.CEL 00.0B.CEL ... 12.5C.CEL (12 total)
>>>> varLabels: sample
>>>> varMetadata: labelDescription
>>>> featureData: none
>>>> experimentData: use 'experimentData(object)'
>>>> Annotation: mouse4302
>>>> > sampletype<- c('1','1','1','2','2','2','3','3','3','4','4','4')
>>>> > group<-factor(sampletype)
>>>> > design<- model.matrix(~0+group)
>>>> > colnames(design)<- c('WB','Ten','Eleven','Twelve')
>>>> > fit<- lmFit(esetRMA, design)
>>>> > contrast.matrix<-makeContrasts(Ten-WB, levels=design)
>>>> > fit2<- contrasts.fit(fit,contrast.matrix)
>>>> > fit2<- ebayes(fit2)
>>>>
>>>> > topTable(fit2, adjust = "fdr", number = 50)
>>>> Error in 1:ncol(fit) : argument of length 0
>>>>
>>>> > topTable(fit2,coef = 1, adjust = "fdr", number = 50)
>>>> Error in array(x, c(length(x), 1L), if (!is.null(names(x)))
>>>> list(names(x), :
>>>> 'data' must be of a vector type
>>>>
>>>> > results<- decideTests(fit2)
>>>> Error in decideTests(fit2) : Need MArrayLM object
>>>>
>>>>
>>>> Could anybody please explain me or point out what I am missing
>>>> here? Its
>>>> strange that I wrote a similar script for Illumina which works
>>>> just fine.
>>>>
>>>> AK
>>>>
>>>> --
>>>> Atul Kakrana
>>>> Delaware Technology Park
>>>>
>>>> _______________________________________________
>>>> Bioconductor mailing list
>>>> Bioconductor at r-project.org<mailto:Bioconductor at r-project.org>
>>>> https://stat.ethz.ch/mailman/listinfo/bioconductor
>>>> Search the archives:
>>>> http://news.gmane.org/gmane.science.biology.informatics.conductor
>>>>
>>>>
--
James W. MacDonald, M.S.
Biostatistician
University of Washington
Environmental and Occupational Health Sciences
4225 Roosevelt Way NE, # 100
Seattle WA 98105-6099
More information about the Bioconductor
mailing list