Contrasts for comparing condition within tissue
2
0
Entering edit mode
7 weeks ago
Ben ▴ 20

I am fitting linear models with limma with coefficients: conditionA, conditionB, tissueA, tissueB, tissueC.

If I specified a contrast like c(-1,1,1,0,0), will that compare conditionB-conditionA in tissueA only? In a differential expression analysis, this would identify differentially expressed genes in conditionB vs conditionA specifically in tissue A - correct?

limma deseq2 edgeR contrasts • 543 views
ADD COMMENT
1
Entering edit mode
7 weeks ago
SamGG ▴ 70

No, and I can't really say what this contrast will perform.

If you want to have contrast conditionB-conditionA for samples from tissueA as if only samples from tissueA were kept, we have to build a factor combining the condition factor and the tissue factor, which will result in assigning samples to levels such as conditionB_tissueA, conditionA_tissueA, conditionB_tissueB, etc. for example. Then, we can build the desired contrast as conditionB_tissueA-conditionA_tissueA.

ADD COMMENT
0
Entering edit mode

Thank you Sam and swbarnes2 for your answers. That makes more sense now. Another question, if I then wanted to compare condition B vs condition A across all tissues, would I set my contrast to be 1 for all of the conditionB coefficients (regardless of tissue) and then -1 for all of the conditionA coefficients? e.g. conditionA_tissueA, conditionA_tissueB, conditionB_tissueA, conditionB_tissueB -> c(1, 1, -1, -1)

ADD REPLY
2
Entering edit mode

Yes. For edgeR, I think it would be easier/clearer to define a model matrix using the condition factor only, and then define a contrast conditionB-conditionA.

If you want to improve your design skills, you should read the following article, which I refer to regularly.

A guide to creating design matrices for gene expression experiments

ADD REPLY
0
Entering edit mode
7 weeks ago

I can only speak for DESeq2, but with that software, the usual way to compare A-B in tissue A only is to make a column of meta data that is condition_tissue, and then specify in the contrast that you want to compare conditionA_tissueA to conditionB_tissueA.

ADD COMMENT

Login before adding your answer.

Traffic: 1818 users visited in the last hour
Help About
FAQ
Access RSS
API
Stats

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.

Powered by the version 2.3.6