Error of Groups in R
0
0
Entering edit mode
8.5 years ago
12021560-040 ▴ 70
> fit = lmFit(gse50397eset, design_gse50397)

Error in lmFit(gse50397eset, design_gse50397) : 
 row dimension of design doesn't match column dimension of data object.

Can anyone please help me out of this error.

affy limma oligo bioconductor R • 3.0k views
ADD COMMENT
1
Entering edit mode

Can you check and post:

dim(gse50397eset)
dim(design_gse50397)
ADD REPLY
1
Entering edit mode

dim(gse50397eset) [1] 33297 89 dim(design_gse50397) [1] 77 2 I run these commands but did not find anything useful.. :(

ADD REPLY
1
Entering edit mode

dim(gse50397eset) [1] 33297 89 dim(design_gse50397) [1] 77 2 I run these commands but did not find anything useful.. :(

ADD REPLY
1
Entering edit mode

dim tells you the sizes of your objects. And indeed, these do not match. You should check if you properly created those objects.

ADD REPLY
1
Entering edit mode

which objects aren't created properly?? and how can I make them proper match?

ADD REPLY
1
Entering edit mode

You should have a look at this thread: Error in R Script something rather similar is discussed there

ADD REPLY
1
Entering edit mode

please tell according to my script that which objects are not properly defined?

ADD REPLY
1
Entering edit mode

shouldn't this be fit = lm(gse50397eset, design_gse50397)?

Then you get fit$fitted.values

ADD REPLY
1
Entering edit mode

lmFit does exist (limma)

ADD REPLY
1
Entering edit mode
Please help me and pinpoint the error specifically If you can I am not getting any help from the above responses.. Please help me get out of this error i will be very thankful to you.
gse50397dat = getGEO('GSE50397')
gse50397raw= getGEOSuppFiles("GSE50397")
tarfile <- grep("\\.tar$", rownames(gse50397raw), value = TRUE)
list.files("GSE50397")
untar("GSE50397/GSE50397_RAW.tar", exdir = "GSE50397/CEL")
list.files("GSE50397/CEL")
celfiles <- list.files("GSE50397/CEL", full = TRUE)
rawData <- read.celfiles(celfiles)
rawData
normData <- rma(rawData)
gse50397eset= exprs(normData)
groups = pData(phenoData(gse50397dat[[1]]))$Hba1c
groups=as.character(groups)
groups=sort(groups)
groups[c(11)]="diabetic"
groups[c(17)]="diabetic"
groups[c(25)]="diabetic"
groups[c(27)]="diabetic"
groups[c(29)]="diabetic"
groups[c(32)]="diabetic"
groups[c(35)]="diabetic"
groups[c(38)]="diabetic"
groups[c(42:43)]="diabetic"
groups[c(46)]="diabetic"
groups[c(48)]="diabetic"
groups[c(51)]="diabetic"
groups[c(53:56)]="diabetic"
groups[c(61)]="diabetic"
groups[c(65)]="diabetic"
groups[c(76:78)]="diabetic"
groups[c(82:84)]="diabetic"
groups[c(87)]="diabetic"
groups[c(13:16)]="control"
groups[c(23:24)]="control"
groups[c(30:31)]="control"
groups[c(57:60)]="control"
groups[c(62:64)]="control"
groups[c(66:75)]="control"
groups[c(80:81)]="control"
groups[c(88:89)]="control"
f = factor(groups, levels=c("control","diabetic"))
design_gse50397 = model.matrix(~0+f)
colnames(design_gse50397) = levels(f)
cont.matrix = makeContrasts(T2D-diabetic, levels=design_gse50397)
fit = lmFit(gse50397eset, design_gse50397)
Error in lmFit(gse50397eset, design_gse50397) : 
  row dimension of design doesn't match column dimension of data object
ADD REPLY
1
Entering edit mode

What an absurd way of creating your trait data object, I would like to suggest you first follow a proper introduction to R before you try to do research. I'd suggest http://swirlstats.com/

ADD REPLY

Login before adding your answer.

Traffic: 1807 users visited in the last hour
Help About
FAQ
Access RSS
API
Stats

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.

Powered by the version 2.3.6