Question: Creating a matrix for edgeR/limma import
0
gravatar for Constantine
3.8 years ago by
Constantine210
USA
Constantine210 wrote:

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 • 1.6k views
ADD COMMENTlink modified 3.8 years ago by Devon Ryan86k • written 3.8 years ago by Constantine210
Do you mean a design matrix?
ADD REPLYlink written 3.8 years ago by Irsan6.8k

Exactly. Sorry for not making it clear

 

ADD REPLYlink modified 3.8 years ago • written 3.8 years ago by Constantine210
0
gravatar for Devon Ryan
3.8 years ago by
Devon Ryan86k
Freiburg, Germany
Devon Ryan86k wrote:
design <- model.matrix(~c(0,0,1,1))
ADD COMMENTlink modified 3.8 years ago • written 3.8 years ago by Devon Ryan86k

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 REPLYlink written 3.8 years ago by Constantine210
1

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

ADD REPLYlink written 3.8 years ago by Devon Ryan86k
Please log in to add an answer.

Help
Access

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