Entering edit mode
8.6 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
yes no. of rows are not matching with no. of columns in objects and designs. could you please tell how to same these numbers?
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.
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.
there is a huge difference. you can see.
is there any error in command or file uploading section?
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
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)
How did you generate
gse21340eset
? Also what are the results ofhead(gse21340eset)
andhead(design_gse21340)
?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.pdfi think there is something in design matrix.
head(design_gse21340)
control.FH control.noFH rep.control.FH T2D.FH