How to create design matrix in edgeR
1
0
Entering edit mode
3.2 years ago
Björn ▴ 50
# edgeR
# following are my paired samples (column Patient) with other three columns
Sample  Groups  Patient Groups1
a   baseline    a   B
b   baseline    b   B
c   baseline    c   B
d   treated     a   BF
e   treated     b   BF
f   treated     c   BF
g   baseline    d   B
h   baseline    e   B
i   baseline    f   B
j   treated     d   BF
k   treated     e   BF
l   treated     f   BF
m   baseline    g   C
n   baseline    h   C
o   baseline    i   C
p   treated     g   CF
q   treated     h   CF
r   treated     i   CF
s   control     NA  control
t   control     NA  control
u   control     NA  control


Given above is the experimental design of my dataset after running the command of edgeR up to :

lcpm <- cpm(y2, log=TRUE)
boxplot(lcpm, las=2, col=group$Sample, main="") title(main="B. Example: Normalised data",ylab="Log-cpm")  I created following design matrix to find out a) disease marker and b) treatment response marker miRNAs design<-model.matrix(~0+group$Groups1)  #based B, BF, C, CF, control
colnames(design)<-levels(group\$Groups1)
design
#DISEASE MARKER; DM=control-B-C  # substraction of B and C are diseae stage from control
#TREATMENT RESPONSE TR=NC-BF-CF  # substraction of BF and CF are diseae stage after treatment from control
#DM is disease marker which is comparision between patient B, C, and control (without treatment)
#TR is treatment response marker wihch is comparision between patients B after treatment, patients c after treatment and #control (without treatment)
contr.matrix<-makeContrasts(DM=control-B-C, TR=control-BF-CF, levels=colnames(design))


QUESTION: Is the data matrix created above is correct or not ?

The main idea behind is to find DE miRNAs in diseased and DE miRNAs after treatment. This will give those miRNAs that are DE due to treatment so that I can conclude the list of miRNAs that responded to treatment. Is this approach correct ? any suggestions will be highly appreciated ? how to create DE venn diagram using edgeR command

RNA-Seq edgeR design.matrix R bioconductor • 2.9k views
0
Entering edit mode

I've tidied up this question as best I can, but I'm not a miracle worker. This is a forum for scientists, please at least attempt to write with correct punctuation (e.g., start your sentences with capital letters) and ensure that the resulting post look intelligible. You'll get more rapid and better replies that way.

0
Entering edit mode
3.2 years ago

Those are unlikely to be the contrasts you want. For example, control - B - C is saying, "Test for a difference between the combined effect of B and C vs. the control...but reverse the signs such that B and C increasing something vs. control will have a negative change." At the very least you probably want B+C-control so that at least the sign of the fold-change makes sense. I suspect you actually want 0.5(B+C)-control, but without you going into more detail of how you'd like to define "disease marker" I don't think anyone can provide more help there. The same goes for your TR contrast.

0
Entering edit mode

Thank you for the reply. I am new to bioinformatics and biostars platform. In my data set, there are two groups. Diseased subjects at different stages B and C, and control. The patients were then treated (BF and CF). My approach is first to find DE miRNAs between diseased (B and C) and control. Second, find DE miRNAs after treatment (BF and CF) and control. From first approach, I will find out miRNAs which are arguably disease markers (DM). From second approach, I intend to find those miRNAs which responded to treatment (TR). I am not familiar with edgeR so learning by doing at the moment. The main aim is to find treatment response miRNAs which differentiates patients from healthy controls. The whole concept is given in the picture. I am curious to know if the concept is sensible ! Please note that the patients are paired (baseline and treated).

In short, I want to find miRNAs that are DE in patients compared to control and ten see how those (only those) miRNAs responded to treatment ! I hope I explained clearly which I tried to show in venn diagram below. ![Venn diagram of DE miRNAs][1] https://ibb.co/hGLkNR

Could you please let me know what is the role of 0.5 in 0.5(B+C)-control ? Is it 0.5 fold change ? Thanks