Entering edit mode
4.4 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?
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 fory$counts
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.
They (rownames) seem to be set in your original
count
variable; however, you then create a random counts matrix,counts
(?), which has no rownames.Thank you for everything you've done. This problem was all resolved.
I am deeply grateful to you for your kindness.
No problem, Aki.