Question: Does response on subset of data in DESeq
0
4 months ago by
swbarnes2330
swbarnes2330 wrote:

Lets say I have an experiment like this (assume every sample has replicates)

            treatment
control     control
Treatment1  Treatment1
Treatment2  Treatment2


If I wanted to compare Treatment 1 to control, I'd likely make the dds object with all the samples, and use contrast to specify "compare Treatment1 to control". Treatment2 samples would be used in library normalization and calculating dispersion, but ignored when it came to calculating the fold change, if I understand right.

I want to do something like that, but with a dose response. I want the treatment2 samples used for library normalization and dispersion calculations, but not used when actually calculating the dose response slope. I feel the table below is the best representation of what's going on that I can make...the treatment1 samples technically have 0 of treatment2, but if I give them values of 0 for treatment1 concentration, they'll look like untreated controls which they are not.

                treatment   treatment1.concentration    treatment2.concentration
control_no_drug control     0   0
control_no_drug control     0   0
control_no_drug control     0   0
Treatment1_0.1  Treatment1  0.1
Treatment1_0.5  Treatment1  0.5
Treatment1_1.0  Treatment1  1
Treatment2_0.1  Treatment2      0.1
Treatment2_0.5  Treatment2      0.5
Treatment2_1.0  Treatment2      1


But I can't run have blanks in the ColData.

The obvious workaround is to subset the data; drop all the treatment2 samples, and run DESeq on what's left, then drop the treatment1 samples to analyze treatment2. Is this the best solution?

deseq2 • 99 views
modified 4 months ago by Michael Love25k • written 4 months ago by swbarnes2330
Answer: Does response on subset of data in DESeq
2
4 months ago by
Michael Love25k
United States
Michael Love25k wrote:

You can use colData with treatment and concentration, and use this design: ~treatment + treatment:concentration.

I think the only catch is that model.matrix will create an empty column for the interaction of treatment = control x concentration, and you just need to manually remove that column, e.g.:

mm <- model.matrix(design(dds), colData(dds))
mm[,-4] # put in the numeric index of the column to remove
dds <- DESeq(dds, full=mm)
...