Entering edit mode
5.2 years ago
1234anjalianjali1234
▴
50
I am doing DEG analysis between two sample (Normal vs Treated) without replicates using edgeR:
library(edgeR)
data = read.table("MYFILE-counts.txt", header=T, row.names=1, com='')
bcv <- 0.2
counts <- matrix( rnbinom(40,size=1/bcv^2,mu=10), 20,2)
it is giving error:
## Warning messages:
1: In data(rnbinom(40, size = 1/bcv^2, mu = 10), 20, 2) :
data set ‘rnbinom(40, size = 1/bcv^2, mu = 10)’ not found
2: In data(rnbinom(40, size = 1/bcv^2, mu = 10), 20, 2) :
data set ‘20’ not found
3: In data(rnbinom(40, size = 1/bcv^2, mu = 10), 20, 2) :
data set ‘2’ not found
I am not able to understand this error and need help to solve this. I know there is no significance of analysis without replicates, but i have no other choice.
Then i proceeded with:
counts <- data
y <- DGEList(counts=counts, group=1:2)
et <- exactTest(y, dispersion=bcv^2)
looking into the variable:
>y
An object of class "DGEList"
$counts
Normal.bam Treated.bam
Cluster-0.0 0 50
Cluster-1.0 0 25
Cluster-2.0 0 16
Cluster-2.1 0 8
Cluster-3.0 0 15
202654 more rows ...
$samples group lib.size norm.factors
Normal.bam 1 3.22e+07 1
Treated.bam 2 1.05e+08 1
why there is norm.factor of 1 in both sample?
>et
An object of class "DGEExact"
$table
logFC logCPM PValue
Cluster-0.0 8.03 -1.58 4.06e-05
Cluster-1.0 7.04 -2.39 2.13e-03
Cluster-2.0 6.40 -2.89 3.49e-02
Cluster-2.1 5.42 -3.58 7.51e-02
Cluster-3.0 6.31 -2.95 3.49e-02
202654 more rows ...
$comparison
[1] "1" "2"
$genes
NULL
Why there are NULL in $genes?
This works fine for me (no errors, no warnings):
Check the size of matrix:
I am guessing you have some hidden characters in the code, try to retype the commands, instead of copy-pasting from some document/website?
I have tried typing it myself, but again giving same error. as suggested by you, i have checked my counts dimention:
i have tried this also but nothing worked:
i have modified my question.
Why are you using
data
instead ofmatrix
?sorry it was by mistake. Even if i am using matrix instead of data, there is error:
Could you please explain the code, i think i am not able to set the parameters according to my dataset.
i tried:
this gives no error, but i need to understand, what this code is doing to my data and what parameter should be used like which value of
mu
should be taken.Thankyou
To avoid first warning, we need to supply correct dimensions, try this code, and adapt numbers for nRows, nCols as needed:
Regarding
mu
, read the manuals, tutorials.Hi 1234anjalianjali1234, I removed my comment, sorry I did not read your question properly, my bad.
Actually i need some more answers related to this question. Should i post a new question or modify this one only?