Creating a matrix for edgeR/limma import
1
0
Entering edit mode
9.9 years ago
Constantine ▴ 290

Hey there

I'm trying to make a DE analysis of a few RNA-seq samples. I used the "Rsubread" package to get the featureCounts from my bam* files and later retrieved the DGElist

I want to use the DGElist for differential expression by either using edgeR or limma but I'm having problems creating a design matrix. Here's my DGElist data:

An object of class "DGEList"
$counts
                     control1.sorted.bam                   control2.sorted.bam                    sample1.sorted.bam
497097                      1                                                3                                               5
100503874                 3                                                5                                               2
100038431                 0                                                0                                               0
19888                        0                                                0                                               0
20671                        4                                                2                                               3
27395                    4534                                            4622                                          5092
          sample2.sorted.bam
497097                     3
100503874                5
100038431                0
19888                       0
20671                      2
27395                   4622

$samples
                                group           lib.size              norm.factors
control1.sorted.bam     1              26756231             1
control2.sorted.bam     1              13181727             1
sample1.sorted.bam     2              28977272            1
sample2.sorted.bam     2              29549367            1

$genes
     GeneID                Length
1    497097                3634
2 100503874              3259
3 100038431              1634
4     19888                  9747
5     20671                  3130
6     27395                  4203

Control1/2 as well as Sample1/2 are biological replicates. Any advice on how to create a design matrix would be much appreciated

Thanks

RNA-Seq R • 3.2k views
ADD COMMENT
0
Entering edit mode
Do you mean a design matrix?
ADD REPLY
0
Entering edit mode

Exactly. Sorry for not making it clear

ADD REPLY
0
Entering edit mode
9.9 years ago
design <- model.matrix(~c(0,0,1,1))
ADD COMMENT
0
Entering edit mode

Thanks. this is what I get:

$design
                    (Intercept) group2
control1.sorted.bam           1      0
control2.sorted.bam           1      0
sample1.sorted.bam            1      1
sample2.sorted.bam            1      1
attr(,"assign")
[1] 0 1
attr(,"contrasts")
attr(,"contrasts")$group
[1] "contr.treatment"

Would you reckon creating a contrast matrix or can I leave it like this?

ADD REPLY
1
Entering edit mode

There's no point in a contrast matrix, the group2 coefficient is already testing what you want.

ADD REPLY

Login before adding your answer.

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