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!
why don't you do each experimental group separately and then subtract the genes which are common with the others?
That's a good idea, I hadn't thought of that. I guess I was thinking that since there was a good way to compare the interaction across two experimental groups as in:
There might be a way to do it for 3 or more, but your idea would certainly be a good alternative. Thanks!