Grouping DESEQ2 with additional variable
1
0
Entering edit mode
Bine ▴ 10
@bine-23912
Last seen 2 days ago
Spain

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

DESeq2 • 110 views
ADD COMMENT
1
Entering edit mode
swbarnes2 ▴ 780
@swbarnes2-14086
Last seen 14 hours ago
San Diego

So if I use above code will my experiment not be controlled for BATCH, AGE and SEX?

First of all are you sure that you need to control for those? Does, say, a PCA plot show that those are strong contributors to the variation?

If you group doesn't look like paste0(dds$Age, dds$Batch, dds$Sex), then no those elements won't be part of the design if the design is just dds <- ~group.

Or means "design(dds) <- ~ group" that i am adding "group" to " ~ BATCH + AGE + SEX + CONDITION"

If you type design(dds), does it have batch and age and sex in it? If it only says group, then it only has whatever group is.

ADD COMMENT
0
Entering edit mode

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!

ADD REPLY

Login before adding your answer.

Traffic: 430 users visited in the last hour
Help About
FAQ
Access RSS
API
Stats

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.

Powered by the version 2.3.6