Hello everyone, I use DEseq2 and Im working on R studio, I used the below commands for running the DEseq2:
library(DESeq2)
counts_data <- read.csv("/Users/maryam/Documents/comp1/allcountsss.csv")
colData <- read.table("/Users/maryam/Documents/comp1/Book1.csv",header = TRUE,sep = ",")
head(colData)
colData2 <- cbind(colData,as.factor(colData$condition))[,-2]
cbind(colData,as.factor(colData$condition))[,-2]
summary(colData2)
dds <- DESeqDataSetFromMatrix(countData = counts_data[,2:5], colData = colData2, design = ~ condition)
but I am getting this error:
Error in DESeqDataSet(se, design = design, ignoreRank) :
all variables in design formula must be columns in colData
I checked my design formula it is like this:
ensgeneID as.factor(colData$condition)
ESN0000.... control
- ENS0000... control
- ENS0000.... mix1
- ENS000..... mix2
I looked for solution on google but exactly can't find the problem, is there anyone to help me please?
thank you for reply. it contains but as.factor
Could you show the output of
colnames(colData2)
?ensgeneID as.factor(colData$condition) 1 ESN000000.. control 2 ESN000000... control
3 ESN00000... mix1
4 ESN00000... mix2
There is no variable named
condition
in this object, please check your code in order to provide a column `conditioning this data frame corresponding to your variable of interest