How to get DE genes without replicates using EdgeR
1
0
Entering edit mode
3.8 years ago
Aki ▴ 10

Hi,

I am trying to perform DEG analysis without replicates while referencing EdgeR User's Guide(page23). I have 3 replicates but I want to compare each sample (cont3 vs sample1).

> library(edgeR)
> packageVersion("edgeR")[1] ‘3.30.3’
> count <- read.table("3vs1.txt", 
+                     sep = "\t", header = T, row.names = 1)
> head(count)
                        cont3 sample1
FBgn0000003_7SLRNA:CR32864   98.5      89
FBgn0000008_a               812.0     745
FBgn0000014_abd-A            32.0      38
FBgn0000015_Abd-B             2.0       2
FBgn0000017_Abl            2365.0    2469
FBgn0000018_abo             328.0     387
> dim(count)
[1] 17579     2

Then, I assigned values to

bcv <- 0.2

counts <- matrix (rnbinom(40, size = 1/bcv^2, mu=10), 20, 2)

y <- DGEList (counts=counts, group=1:2)

et <- exactTest(y, dispersion=bcv^2)

> bcv <- 0.2
> counts <- matrix(rnbinom(35158, size=1/bcv^2, mu=10), 17579, 2)
> y <- DGEList (counts=counts, group=1:2)
> et <- exactTest(y, dispersion=bcv^2)
> y
An object of class "DGEList"
$counts
    Sample1 Sample2
1       7       6
2      11      18
3       7      15
4      14      12
5      18      10
17574 more rows ...
$samples
    group lib.size norm.factors
Sample1     1   175534            1
Sample2     2   174455            1
> et
An object of class "DGEExact"
$table
      logFC   logCPM    PValue
1 -0.2094534 5.601973 1.0000000
2  0.7129906 6.559412 0.3761800
3  1.0947540 6.215569 0.2117326
4 -0.2114558 6.421354 0.8745086
5 -0.8312491 6.514097 0.2891758
17574 more rows ...
$comparison
[1] "1" "2"
$genes
NULL

I couldn't understand why gene name disappeared and indicated number appeared. Are these codes OK? Could someone please help me?

R RNA-Seq • 2.5k views
ADD COMMENT
1
Entering edit mode
3.8 years ago
Ido Tamir 5.2k

in the 2. part you called differential expression on a matrix without gene names as row names filled with random numbers

ADD COMMENT
0
Entering edit mode

As per my colleague, Ido, your y$counts object has no gene names, so, these will not be transmitted to the results table. You need to go back a few steps and set the gene names as rownames for y$counts

ADD REPLY
0
Entering edit mode

Thank you for your advice!! I googled how set the gene names as rownames, but I couldn't find. I'll continue to try searching for that.

ADD REPLY
0
Entering edit mode

They (rownames) seem to be set in your original count variable; however, you then create a random counts matrix, counts (?), which has no rownames.

ADD REPLY
1
Entering edit mode

Thank you for everything you've done. This problem was all resolved.

bcv <- 0.2
counts <- matrix(rnbinom(35158, size=1/bcv^2, mu=10), 17579, 2)
rownames(counts) <- rownames(count)
y <- DGEList (counts=counts, group=1:2)
et <- exactTest(y, dispersion=bcv^2)

I am deeply grateful to you for your kindness.

ADD REPLY
0
Entering edit mode

No problem, Aki.

ADD REPLY

Login before adding your answer.

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