Hi all, I'm working on using DESeq2 to analyze a more complicated experiment than I've done before. I have six biological replicates of four conditions, and I want to identify differentially expressed genes between the four conditions.
I did not expect sex to have much of an impact, but when I created a PCA the samples were clearly segregating according to sex, so I would like to control for it.
Here's what my metadata looks like:
Sample1 ConditionA Male
Sample2 ConditionA Female
Sample3 ConditionA Male
Sample4 ConditionA Male
Sample5 ConditionA Female
Sample6 ConditionA Female
Sample7 ConditionB Male
Sample8 ConditionB Female
Sample9 ConditionB Male
Sample10 ConditionB Male
Sample11 ConditionB Female
Sample12 ConditionB Female
Sample13 ConditionC Male
Sample14 ConditionC Female
Sample15 ConditionC Male
Sample16 ConditionC Male
Sample17 ConditionC Female
Sample18 ConditionC Female
Sample19 ConditionD Male
Sample20 ConditionD Female
Sample21 ConditionD Male
Sample22 ConditionD Male
Sample23 ConditionD Female
Sample24 ConditionD Female
Here's what I've tried in DESeq, but it doesn't seem to do what I'm aiming for.
design <- formula(~sex + condition)
reduced <- formula(~1)
rsem.in <- DESeqDataSetFromMatrix(countData = ct, colData = sampleMetaData, design = design, tidy = T)
rsem.in <- rsem.in[ rowSums( counts( rsem.in)) >= 1, ]
rsem.de <- DESeq( rsem.in, test = "LRT", reduced = reduced)
rsem.de.res <- results( rsem.de, alpha = 0.05)
summary(rsem.de.res)
Any insight would be greatly appreciated!
rna-seq
deseq2
I'm aiming to find genes that are differentially expressed between conditions, not genes that are differentially expressed between sexes. I'd like to find the effect of the four conditions while controlling for sex. When I run it as is, the top genes with the lowest p-values seem to have those low p-values be driven by differences in sex rather than differences in condition.
If sex is not a factor, why include it in the design formula? Why not just
design = ~ condition?Because I can tell from PCAs that the samples are clustering largely due to sex, so I'm inclined to believe that sex is playing a role in gene expression here. I'm concerned that since it seems to be driving so much variation (it is PC2 in a PCA) I need to control for it in my design. Is that incorrect?
Your process is correct. If sex is PC2, then I'm afraid that doesn't allow for cross-sex comparison. You may have to work with ~condition per sex.
I'm not familiar with the LRT test or the usage of the reduced model, so someone with knowledge on that might be able to help you better.