differential expression RNASeq DESeq2
1
0
Entering edit mode
2.2 years ago
Rob ▴ 170

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 • 955 views
ADD COMMENT
4
Entering edit mode

It is generally expected that you read the tools manual first. Even in the "quick start" section there is an example on adding covariates to the design: https://bioconductor.org/packages/release/bioc/vignettes/DESeq2/inst/doc/DESeq2.html

ADD REPLY
3
Entering edit mode
2.2 years ago
nhaus ▴ 310

Simply add it in the design formula:

dds <- DESeqDataSetFromMatrix(countData = rawdata,
                              colData = metadata,
                              design = ~ treatment + Sex )
ADD COMMENT
0
Entering edit mode

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

ADD REPLY
2
Entering edit mode

Yes, you can add it the same way.

ADD REPLY
1
Entering edit mode

Thanks for responding nhaus

ADD REPLY

Login before adding your answer.

Traffic: 1604 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