I have three samples each with 3 biological replicates i.e. one control and other at dose 12ug/ml and 25ug/ml at 24hr

```
> library('DESeq2')
> directory<-"./data"
> sampleFiles <- grep("Htseq",list.files(directory),value=TRUE)
> sampleCondition<-c("treated","treated","treated","treated","treated","treated","untreated","untreated","untreated")
> sampleGroup <-c ("A","A","A","B","B","B","C","C","C")
> sampleTable<-data.frame(sampleName=sampleFiles, fileName=sampleFiles, condition=sampleCondition, group=sampleGroup)
> sampleTable

    sampleName    fileName    condition      group
1    24h_12ug_1.count    24h_12ug_1.count    treated    A
2    24h_12ug_2.count    24h_12ug_2.count    treated    A
3    24h_12ug_3.count    24h_12ug_3.count    treated    A
4    24h_25ug_1.count    24h_25ug_1.count    treated    B
5    24h_25ug_2.count    24h_25ug_2.count    treated    B
6    24h_25ug_3.count    24h_25ug_3.count    treated    B
7    24h_ctrl_1.count    24h_ctrl_1.count    untreated    C
8    24h_ctrl_2.count    24h_ctrl_2.count    untreated    C
9    24h_ctrl_3.count    24h_ctrl_3.count    untreated    C
```

What should be good design if I want to see the differential expressed genes between treated vs untreated as well between different groups?

    ddsHTSeq <- DESeqDataSetFromHTSeqCount(sampleTable=sampleTable, directory=directory, design=~group)

**OR**

    ddsHTSeq<-DESeqDataSetFromHTSeqCount(sampleTable=sampleTable, directory=directory, design=~condition)

What will be the difference between the two designs?

I tried the following design but it gave me error

```
ddsHTSeq<-DESeqDataSetFromHTSeqCount(sampleTable=sampleTable, directory=directory, design=~group + condition + condition:group)
Error in DESeqDataSet(se, design = design, ignoreRank) : the model matrix is not full rank, so the model cannot be fit as specified. one or more variables or interaction terms in the design formula are linear combinations of the others and must be removed
```

How will the design will change if I add three samples each with 3 biological replicates i.e. one control and other at dose 12ug/ml and 25ug/ml at 6hr
<p>Did you post this on SEQanswers too? I feel like I&#39;ve seen it before.</p>

<ol>
	<li>If you want to look at treated vs. untreated and between group comparisons then just use ~group and use the appropriate contrast for the treated vs. untreated comparison.</li>
	<li>The difference between ~group and ~condition is that in one case you&#39;re asking, &quot;What&#39;s the difference due to treatment type?&quot; while in the second case &quot;What&#39;s the difference due to treating at all...ignoring that there are multiple treatments being used?&quot; In reality, using ~condition will probably yield crappy results, since you have a batch effect that you&#39;re not compensating for.</li>
	<li>You got that error because you can&#39;t simultaneously determine the effect of group C and the untreated condition...since they&#39;re the same. Similarly, the interaction terms are identical to the group terms, so they can&#39;t be determined either.</li>
	<li>If you add more samples/conditions then the model will need to be changed according to the question(s) you want to ask. Given that you wanted inter-group comparisons before, I suspect you&#39;ll need to just add things as new groups and use appropriate contrasts for each question.</li>
</ol>
