Hello,
I'm trying to design matrix so I can create combinations and extract the DEGs. I've been looking all over the web and I know how to create this matrix, however, when I create group as below
Group <- factor(c("Advshoot", "Cone", "Gland", "Leaf", "Root", "Shoottip"))
Group <- relevel(Group, ref="Root")
design <- model.matrix(~0+Group)
colnames(design) <- levels(Group)
it has 6 tissues as I need it, while my y, library levels counts one of the tissues, Cone, as two
Levels: Advshoot Cone Cone Gland Leaf Root Shoottip
so it sums up as 7 tissue types instead of 6 and running this
v <- voom(y,design,plot = TRUE)
gives this error
Error in lmFit(y, design, block = block, correlation = correlation, weights = weights) :
row dimension of design doesn't match column dimension of data object
Appreciate your help.
Thanks,
Yes, I checked, it has 12 columns as for 12 samples, 2 for each tissue type:
Leaf.Rep1, Leaf.Rep2, Root.Rep1, Root.Rep2, Adv.shoot.Rep1, Adv.shoot.Rep2,
Cone.Rep1, Cone.Rep2, Gland.Rep1, Gland.Rep2, Shoot.tip.Rep1, Shoot.tip.Rep2.
But yet I don't understand why in the group does not match y and shows Cone as two?
It seems the difference between the two replicates for the tissue type, Cone, is so significant that it considers them two different tissues, since with dropping these two reps everything back to normal. I don't know this is actual reason or not but it worked.
No, that's not the reason. The problem was that you included an extra space after one of the "Cone" samples so that R treated
"Cone"
and"Cone "
(with a space) as different tissues.Gordon, thank you. Yes, that was the reason, check them all, everything is fine now.