This is a test version of Biostars. For the public version, visit https://www.biostars.org.
differential expression RNASeq DESeq2

I am using DESeq2 for differential expression analysis. I want to account for treatment and Sex. I have the following code. how and where in the code should I add sex?

dds <- DESeqDataSetFromMatrix(countData = rawdata,
                              colData = metadata,
                              design = ~ treatment)

dds <- DESeq(dds)
res <- results(dds)
rna-seq

1 answer

Simply add it in the design formula:

dds <- DESeqDataSetFromMatrix(countData = rawdata,
                              colData = metadata,
                              design = ~ treatment + Sex )

Thank you nhaus Can also this be done for more than 2 covariates? such as: treatment, sex, stage of cancer?

Yes, you can add it the same way.

Log in to answer this question.