In my second approach I have used my actual count data, as described in the question. Could you please look into that. I know there is no point of the analysis without the replicates, but I have no other choice.
edgeR negative bionomial error in without replicate data?
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?
• 2,628 views
•
link
1 answer
It is pointless what you do without replicates. See here (among many threads) why that is.
• 0 views
•
link
• 0 views
•
link
Log in to answer this question.
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
datainstead 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
mushould 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?