How to combine two DESeq2 objects (dds) for analysis
1
0
Entering edit mode
Luke • 0
@f024db5a
Last seen 11 months ago
New Zealand

Hi everyone,

I have two RNA-seq experiments that I have done separately with different tissues (tissue 1-4) and different conditions (treatment 1 and treatment 2).

Initially, I want to compare the tissue types within each experiment (eg, tissue 1 vs tissue 2, etc, all under treatment 1 or treatment 2).

But now I was thinking is it possible to compare the same tissue type between experiments (eg. treatment 1 vs treatment 2 of tissue 1 etc.).

I had a look at other people's posts, some were talking about combing and how to remove the batch effect, etc. But I want to know how to combine two RNA-seq data or DESeq objects (i have the dds from both expts). Is there a function in DESeq2 that can do that? Or shall i combine the normalized counts from both expts, then use the DataFromMatrix function?

thanks

DESeq2 • 2.1k views
ADD COMMENT
1
Entering edit mode

Hello Luke,

Since DESeq2 takes raw counts, and provided that you only have the DESeq objects, you can extract raw counts with

count_table = dds@assays@data@listData$counts

After making sure that both of your dataset have the same genes in the same order, you can then use cbind() to combine the two count_tables. For coldata, you can add a new variable "experiment" like this:

coldata1$experiment = 1
coldata2$experiment = 2
coldata = rbind(coldata1, coldata2)
coldata$experiment = factor(coldata$experiment)

Then you can test if experiment has any effect on gene expression with:

dds = DESeqDataSetFromMatrix(countData = count_table, 
                             colData = coldata, 
                             design = ~ tissues + condition + (all other covariates) + experiment)
dds = DESeq(dds)
res = results(dds)
ADD REPLY
1
Entering edit mode

Please get used to use dedicated setter and getter functions rather than accessing slots manually. The structure of a data object might change so code might break while getters and setters are preserved.

Counts should be ontained by counts(dds, normalized=TRUE/FALSE), then there are other getters like sizeFactors(), and pretty much everything as in a SummarizedExperiment as the DESeqDataSet format builds on top of that.

As for the question at hand, if the experimental design allows combination of data (so batch effect is not nested by experiment) then just cbind the data together and include the batch factor into the design.

ADD REPLY
0
Entering edit mode

thanks ATpoint

ADD REPLY
0
Entering edit mode

thanks Tzu

ADD REPLY
1
Entering edit mode
@mikelove
Last seen 11 hours ago
United States

You can use cbind and then incorporate more variable in the design, e.g. ~tissue + treatment or tissue + tissue:treatment. The choice of design should be made in consultation with a statistician or someone familiar with linear models in R.

ADD COMMENT

Login before adding your answer.

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