How to create design matrix for confounder (here sunlight) in edgeR ?
1
0
Entering edit mode
6.2 years ago
Björn ▴ 110

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 • 1.9k views
ADD COMMENT
0
Entering edit mode
6.2 years ago
Benn 8.4k

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.

ADD COMMENT
0
Entering edit mode

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

ADD REPLY
0
Entering edit mode

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).

ADD REPLY

Login before adding your answer.

Traffic: 1773 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