Dear all,
I believe I have understood now how the grouping of variables work:
dds$group <- factor(paste0(dds$genotype, dds$condition))
design(dds) <- ~ group
dds <- DESeq(dds)
resultsNames(dds)
the condition effect for genotypeIII
results(dds, contrast=c("group", "IIIB", "IIIA"))
My orginal code was:
dds4 <- DESeqDataSetFromMatrix(countData = cts,
colData = colData,
design = ~ BATCH + AGE + SEX + CONDITION
So if I use above code will my experiment not be controlled for BATCH, AGE and SEX? Or means "design(dds) <- ~ group" that i am adding "group" to " ~ BATCH + AGE + SEX + CONDITION" ... making it " ~ BATCH + AGE + SEX + CONDITION + group"? But then "condition" would be twice kind of in my formula as "CONDITON" and as "group"?!
I am confused, thank you! Bine
Dear swbarnes,
Thank you very much for you reply. Yes I need to control for these factors, PCA plot clearly showed that.
Yes, you are right if I do only "design(dds) <- ~ group" the command design(dds4) gives me only this: ~group.
So I have done the following: dds$group <- factor(paste0(dds$Age, dds$Batch, dds$Sex,dds$genotype, dds$condition))
It takes a very long time to run, because it must be doing all comparisons between all these variables...
But is genotype and condidtion then still the variables of interest (for my differential expression) and I am just controlling for Age, Batch and Sex then?
Maybe I should instead do the following:
dds$group <- factor(paste0(dds$genotype, dds$condition)) design(dds) <- ~ BATCH + AGE + SEX + group ?
Thank you for any hint!