Question: How to create design matrix for confounder (here sunlight) in edgeR ?
0
16 months ago by
Björn40
Björn40 wrote:

The scenario is like this. A study population given "vitamin D supp" (yes/no variable) and followed up to measure outcome "skin cancer" (again yes/no). The design matrix (1) I used is

``````design<-model.matrix(~0+vitd, data)
colnames(design)
[1] "vitd"     "vitdn" "vitdy"
``````

The patients were also measured for exposure to sunlight "sun" (yes/no variable) To measure the influence of "sun" in design matrix (1), I used another matrix

``````design<-model.matrix(~vitd+sun, data)
colnames(design)
[1] "(Intercept)" "vitdy" "sunsunn"      "sunsuny"
``````

My questions

1. Are the design matrix correct to measure role of "vitamin D supp" ALONE and WITH "sunlight" separately.
2. Definitely the DE RNA with be different while using two designs. So, how to know which rna are due to vitamin D alone
3. How to know which RNA are due to "sun" alone

Thanks

edger rnaseq • 503 views
modified 16 months ago by Benn7.9k • written 16 months ago by Björn40
0
16 months ago by
Benn7.9k
Netherlands
Benn7.9k wrote:

If you are not interested in the interaction, you can follow 3.3.1 of the edgeR user's guide. In that section they have treatment and time, so in your case it would become VitD (y or n) and Sun (y or n). You can make four groups of that (vitD_y_Sun_y, vitD_n_Sun_y, vitD_y_Sun_n, and vitD_n_Sun_n), and design should be `design<-model.matrix(~0+group, data)`.

For contrast you make take `vitD_y_Sun_n - vitD_n_Sun_n` for the effect of vitD without Sun light, and `vitD_y_Sun_y - vitD_n_Sun_y` for effect of vitD with sun light. Etc.

Thanks for the comment. For effect of vitD with sunlight..is it `vitD_y_Sun_y - vitD_n_Sun_y` or `vitD_y_Sun_y - vitD_n_Sun_n`

One more question. I created heatmap using heatmap.2 for both contrasts which gives the same heatmap. Why is it ? I created `toptags` for both contrasts separately which gives different lists of miRNAs but the heatmap remains the same. Is there anything wrong. Thanks

If you want to have the effect of vit D in patients that all received sunlight `vitD_y_Sun_y - vitD_n_Sun_y` would be the right contrast. Please start a new question if you don't get the heatmap right, and show your code in that new question (not enough info now).