Error in DESeqDataSet(se, design = design, ignoreRank) : all variables in design formula must be columns in colData
1
0
Entering edit mode
mokunf • 0
@mokunf-14927
Last seen 4.5 years ago
 I'm having issues creating the coldata frame. Below is my script and error. countdata <-read.table("~/Desktop/Internship/Extracted CP.Auto genes from RNASeq batch_1.txt",header=TRUE, row.names = 1) countdata <- as.matrix(countdata) (condition <- factor(c(rep("AUTO", 69), rep("CP", 120)))) library("DESeq2") (coldata <- data.frame(row.names=colnames(countdata), condition)) After I input the last line, I get this error message: Error in data.frame(row.names = colnames(countdata), condition) :    row names supplied are of the wrong length Then, I tried running it without condition, which works. However, when I try to run the following code below, dds <- DESeqDataSetFromMatrix(countData = countdata, colData = coldata, design =~ condition) dds I get another error: Error in DESeqDataSet(se, design = design, ignoreRank) : all variables in design formula must be columns in colData
deseq2 R genomics • 4.8k views
0
Entering edit mode
@mikelove
Last seen 12 hours ago
United States

The error you see is from a check to see if the names you put in design are columns in colData. If it throws an error, it means there is a mismatch. Are you copy pasting exactly the code you used?

0
Entering edit mode

I just edited my question. I accidentally pasted the same error message twice. My question is correct now. Oh and yes, this is the code I used.

0
Entering edit mode

So the first error means that you didn't get to define coldata, and then the second error is probably because another coldata is coming in from previous in the session that doesn't have condition as a column. So back to the first error:

row names supplied are of the wrong length

Can you figure out what this is telling you?

0
Entering edit mode

Yes, I fixed that and it works now. I'm now only having the second error pop up.

0
Entering edit mode

You'll have to figure this one out on your end by looking closely at your code and the objects. Look at the colnames of coldata, and look at the proposed design. The computer says there is a mismatch, but you say they are identical, so sometimes you may want to look closely to see they are in fact the same.

0
Entering edit mode

Ok, I will go through it again. Thank you for your help!