Search
Question: DeSeq2- design experiment
0
11 months ago by
laksharikrish0 wrote:

hello,

I am working on DEseQ2 to find the differentially expressed when i compare the control (3 replicates) Vs. 2 treated samples (3 replicates each, and 6 in total for treated condition) . I am mainly interested in the genes those are differentially expressed when i compare the two treatments to the control.

But im not sure how to set up an experiment in Deseq2

cell      dex
control1               s1     control
control2               s2     control
control3               s3     control
Ec32.Eury05.T1   s4     Sus
Ec32.Eury05.T2   s5     Sus
Ec32.Eury05.T3   s6     Sus
Ec32.Eury96.T1   s7    Sus1

Ec32.Eury96.T2   s8    Sus1

Ec32.Eury96.T3   s9    Sus1

So far the commands i used were

coldata<-data.frame(row.names=colnames(Sum_rep.df),cell=paste0("s", 1:9), dex= c(rep('control', 3), rep('Sus',3), rep('Sus1',3)))

coldata$cell<-factor(coldata$cell,coldata\$dex)

dds <- DESeqDataSetFromMatrix(countData = round(Sum_rep.df), colData = coldata, design = ~ dex)

Could someone direct me , if its right?

Any help would be appreciated

written 11 months ago by laksharikrish0

Looking OK so far, but I always find it best to programmatically derive the labels from the string directly, in case for some reason you sort the Sum_rep.df differently in future, when your hard-wiring of the order of the samples would cause problems.  e.g. dex=gsub(".*(control|Eury05|Eury96).*", "\\1", colnames(Sum_rep.df))  and maybe you want rep=gsub(".*(.)", "\\1", colnames(Sum_rep.df)) to capture the batch-number, as those T1's etc look suspiciously like a batch effect, and you'd have a design of ~ batch + dex  ?

ok. i will take your comment in to consideration.

I was also wondering with the comparison,i have made the log2Fc for the deferentially expressed genes are calculated by comparing the control and Sus1. But i would like to have a comparison between (control Vs. Sus) and (control Vs. Sus1) in this experiment. Because im interested in the common genes being differential expressed during the susceptible responses.

Could you suggest if its possible to design this and implement in deseq2?

Yes, you can do that either via an LRT (test="LRT" when you call the DESeq function), which will give you genes that are different between any pair of conditions, or you can stick with a Wald test and specifically build contrasts to pull out the comparison you want and use those in the 'results' command.  If control is currently the baseline condition, then you can get the comparisons against that with a simple 'name=X' where X is the obvious choice out of resultsNames.  If you want sus vs sus1, you'll need the slightly more complex contrast=list(X, Y) format, where X and Y are the two terms in resultsNames that correspond to sus terms (the 'control' will cancel out).