Hi all,
I have an RNAseq dataset I am analyzing of gene expression from patients with a variety of illnesses. The design matrix is generally as follows:

    
    > patient <- 1:12
    > illness <- c(rep("control",3),rep("viral",3),rep("bacterial",3),rep("bactrial_and_viral",3))
    > design <- model.matrix(~0+illness)
    > rownames(design) <- patient


I want to find genes which are DE only in the bacterial group (relative to control), genes which are DE only in the viral group (relative to control), and genes which are DE only in the combined bacterial+viral group (relative to control). I am having trouble deciding which contrasts are appropriate to do this. 

I know that if i just wanted to find genes which change in bacterial but not viral I could do:

    > makeContrasts(bacterial_only = (bacterial-control)-(viral-control), levels = design)

But I think this would not exclude genes which also change in the bacterial_and_viral condition. 

I cannot find the appropriate way to do the analogous comparison with more than 1 other experimental group. Could I do the following?

    > makeContrasts(bacterial_only = (bacterial-control) - ( (viral-control) + (bacterial_and_viral-control) )/2, levels = design)

I'd really appreciate any insight on how to find genes which change in **only** one experimental group relative to control. I'm also worried I might be overthinking this--could this be accomplished by simply:

    > makeContrasts (bacterial_only = bacterial-control, levels = design)

Does this find genes only DE in bacterial and not in other experimental groups?

Thanks for any insight you all can provide!

Brian
> I know that if i just wanted to find genes which change in bacterial but not viral I could do:
`makeContrasts(bacterial_only = (bacterial-control)-(viral-control), levels = design)`

That's not what the contrast does. The interaction contrast finds all genes for which the bacterial effect is significantly different to the viral effect. There's no assumption that a viral effect is absent. There might be strong effects in both bacteria and virus but in different directions. Or the effect could be just in bacteria. Or the effect could be just in virus. Or the effects in bacteria and virus could be in the same direction, but much bigger for one than the other.

You actually have only one control in this experiment, rather than separate controls for bacteria and virus. So the contrast
```
(bacterial-control)-(viral-control)
```
is exactly the same as
```
bacterial-viral
```
because the control cancels out. As you can see, the contrast just gives a differential expression test between bacterial and viral without regard to the control.