reading microarray data in R
1
0
Entering edit mode
8.0 years ago
12021560-002 ▴ 30

hi I am reading microarray data through R. please pin point the mistake in the command.

fit = lmFit(gse21340eset, design_gse21340) Error in lmFit(gse21340eset, design_gse21340) : row dimension of design doesn't match column dimension of data object

R limma microarray • 2.4k views
ADD COMMENT
0
Entering edit mode

yes no. of rows are not matching with no. of columns in objects and designs. could you please tell how to same these numbers?

ADD REPLY
0
Entering edit mode

You should have the same samples as rows in your design and as columns in your countdata. How big is the difference? I assume the difference is 1? Did you import the file in R yourself? Does the file have a header? Have a look at colnames(gse21340eset).

You can inspect data with head(design_gse21340) to only see the upper part of a table.

ADD REPLY
0
Entering edit mode

Can you amend your post to include the code that created those two objects? lmfit is a linear model function that fits a given design matrix to your input data. It's not possible to determine where you went wrong with your command without the whole script.

ADD REPLY
0
Entering edit mode

there is a huge difference. you can see.

dim(gse21340eset) [1] 7129 20 dim(design_gse21340) [1] 0 4

is there any error in command or file uploading section?

ADD REPLY
0
Entering edit mode

can you upload the code you used to create the design matrix? based on the code you posted there are no samples in it (dimensions 0 4) while it should be 20 rows and 4 cols

ADD REPLY
0
Entering edit mode

This is the script

library(limma)

groups = pData(phenoData(gse21340dat[[1]]))$description

groups=as.character(groups)

groups[groups=="disease state: control.family history: yes"]="control.FH"

groups[groups=="disease state: control.family history: no"]="control.noFH"

groups[groups=="disease state: replicate control.family history: yes"]="rep.control.FH"

groups[groups=="disease state: DM.family history: yes"]="T2D.FH"

f = factor(groups, levels=c("control.FH","control.noFH","rep.control.FH","T2D.FH"))

design_gse21340 = model.matrix(~0+f)

colnames(design_gse21340) = levels(f)

cont.matrix = makeContrasts(T2DvsCtrlNoFH=T2D.FH-control.noFH, levels=design_gse21340)

fit= lmFit(gse21340eset, design_gse21340)

fit2= contrasts.fit(fit, cont.matrix)

ADD REPLY
0
Entering edit mode

How did you generate gse21340eset? Also what are the results of head(gse21340eset) and head(design_gse21340)?

ADD REPLY
0
Entering edit mode

also, what's the groups variable like? I feel that you need to go through each variable...and also I'd take a very good read from this before continuing any extra coding. https://bioconductor.org/packages/release/bioc/vignettes/limma/inst/doc/usersguide.pdf

ADD REPLY
0
Entering edit mode

i think there is something in design matrix.

head(gse21340eset) GSM533283.CEL.gz GSM533284.CEL.gz GSM533285.CEL.gz GSM533286.CEL.gz A28102_at 8.130513 8.231653 8.175021 8.345722 AB000114_at 5.727701 5.696820 6.137276 5.878570 AB000115_at 6.684548 6.609435 6.887094 6.798657 AB000220_at 6.778942 6.961036 7.292673 7.298336 AB000381_s_at 4.940158 4.902318 4.885254 5.380067 AB000409_at 7.085271 7.080442 7.316466 6.942676 GSM533287.CEL.gz GSM533288.CEL.gz GSM533289.CEL.gz GSM533290.CEL.gz A28102_at 8.959552 8.473907 8.091576 8.414724 AB000114_at 6.517263 6.397724 6.100754 6.380587 AB000115_at 7.227893 7.349000 6.512520 6.769398 AB000220_at 7.967540 7.889100 7.657726 7.140753 AB000381_s_at 4.929813 5.059748 4.954322 4.910361 AB000409_at 7.142482 7.159999 6.572813 6.925385 GSM533291.CEL.gz GSM533292.CEL.gz GSM533293.CEL.gz GSM533294.CEL.gz A28102_at 9.083397 8.226454 7.554394 7.633388 AB000114_at 7.133230 6.469792 5.671915 5.303192 AB000115_at 7.651276 6.185414 6.483042 6.126700 AB000220_at 8.189044 7.843182 6.871853 6.594244 AB000381_s_at 4.934274 4.863728 4.907313 5.061410 AB000409_at 8.136080 6.801106 7.083652 6.524353 GSM533295.CEL.gz GSM533296.CEL.gz GSM533297.CEL.gz GSM533298.CEL.gz A28102_at 7.593197 7.644181 7.649320 7.772923 AB000114_at 5.372787 5.555148 5.653253 5.850298 AB000115_at 6.146925 6.516065 6.856782 6.556847 AB000220_at 6.388915 7.206200 6.611537 6.265709 AB000381_s_at 4.983873 5.007165 4.979237 4.996343 AB000409_at 6.701313 7.172355 7.061211 7.046278 GSM533299.CEL.gz GSM533300.CEL.gz GSM533301.CEL.gz GSM533302.CEL.gz A28102_at 7.711471 7.600967 7.582791 7.878591 AB000114_at 5.645259 5.696322 5.669252 6.349654 AB000115_at 6.393122 6.335462 6.663389 7.203055 AB000220_at 7.042607 7.247957 7.316512 7.843391 AB000381_s_at 4.935860 5.153809 5.052956 4.975595 AB000409_at 7.195019 6.953443 7.246403 7.539877

head(design_gse21340)

control.FH control.noFH rep.control.FH T2D.FH

ADD REPLY
1
Entering edit mode
8.0 years ago

Have a look at

dim(gse21340eset)

and

dim(design_gse21340)

The function (apparently, not familiar with it myself) expects the number of rows in your design to match the number of columns in your data object.

ADD COMMENT

Login before adding your answer.

Traffic: 2396 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