Entering edit mode
Hello,
While I Analysis data using a linear model , I faced the following error in lmfit !!
any advice please?
.....................................................................................
fit<-lmFit(dat.m, design)
Error in lmFit(dat.m, design) :
row dimension of design doesn't match column dimension of data object
regards,
Tahani,
Gordon,
Thanks for reply, but do you mean that dim(dat.m) should be equal with dim(design) ?
In my work :
> dim(dat.m)
[1] 1354896 9
> dim(design)
[1] 1354896 10
how could I fix it to get lmfit??
Tahani,
Your dataset (
dat.m
) has 9 columns (i.e., 9 libraries) but your design has 1354896 rows. Clearly, you have set updesign
incorrectly - it should have 9 rows, one for each library, and less than 9 columns (one for each coefficient of the model, which should be less than the number of libraries if you want to estimate the variance properly). If you want more advice, you'll have to give more details on your experimental setup, because this is not an issue that can be fixed bylmFit
.Hi Aaron Lun,
Thanks for reply. my codes of my experimental setup as the following :
>getwd()
>source("http://www.bioconductor.org/biocLite.R")
>library(affy)
>dat<-ReadAffy()
>dat
I think there is some mistakes in the next step:
>ZZ<-as.factor(dat.m)
>design<-model.matrix(~ZZ)
>fit<-lmFit(dat.m, design)
Using
ZZ
to construct the design matrix makes no sense. The design matrix should be holding information about the experimental design (e.g., treated or untreated, cell types), and should not be dependent on the observed expression values (advanced applications excepted, e.g., when estimating batch effects). A brief look at the GEO accessions for the files (GSM679719, GSM679720, and so on) indicates that you've got a data set with three different breast cancer cell lines, with three samples for each of the cell lines. So, perhaps a good start might be:The first coefficient will represent the average expression of the B6TC cell line, while the second and third coefficients will represent the log-fold change of the next two cell lines relative to the B6TC 'baseline'. This should be enough to get you going - check out the
limma
user's guide for more details on how to parametrize the design and DE contrasts.