Question: How to create design matrix for confounder (here sunlight) in edgeR ?
gravatar for Björn
16 months ago by
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)
[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)
[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


edger rnaseq • 503 views
ADD COMMENTlink modified 16 months ago by Benn7.9k • written 16 months ago by Björn40
gravatar for Benn
16 months ago by
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.

ADD COMMENTlink written 16 months ago by Benn7.9k

Thanks for the comment. For effect of vitD with 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 REPLYlink written 16 months ago by Björn40

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 REPLYlink modified 16 months ago • written 16 months ago by Benn7.9k
Please log in to add an answer.


Use of this site constitutes acceptance of our User Agreement and Privacy Policy.
Powered by Biostar version 2.3.0
Traffic: 2059 users visited in the last hour