Question: Getting FPKM value from edgeR software
1
gravatar for seta
2.9 years ago by
seta1.2k
Sweden
seta1.2k wrote:

Hi all,

I have done differential expression analysis with edgeR and now I'm trying to extract FPKM value from this tool, but it gave me an error all the time. Could you please take a look at the code and help me to solve the problem.

 targets <- read.delim("targets.txt", stringsAsFactors=FALSE)
targets3
 Label Treatment  line time
1    CS   control sensitive    0
2   DS6      drug sensitive    6
3    CT   control  tolerant    0
4   DT6      drug tolerant    6
5  DT24     drug  tolerant   24
expressioncount <- read.delim("rawcount.txt", row.names=1)
colnames(expressioncount) <- substring(colnames(expressioncount),1,6)
dim(expressioncount)
[1] 78970      6
> head(expressioncount)
         length CS DS6 CT DT6 DT24
 c51581_g1_i1    462  0   2  1   1    0
 c19380_g1_i1    439  3   0  2   0    2
c4832_g1_i1     665  0   2  0   7   23
c25894_g1_i1    402  0   1  1   1    3
c37752_g4_i1    736  2   4  2   3    2
c557_g1_i1      434  7   0  4   0    0

y <- DGEList(expressioncount[,2:6])
keep <- rowSums(cpm(y) > 1) >= 1
y <- calcNormFactors(y)
y$samples
group lib.size norm.factors
CS       1 20146232    1.1727230
DS6      1 19308652    0.9188417
CT       1 19792940    1.2271948
DT6      1 19051509    0.9463686
DT12     1 17752012    0.7990795
RPKM <- rpkm(y)
**Error in rpkm.DGEList(y) : Gene lengths not found**

Please kindly share me your helpful comments and suggestions.

Thank you in advance

fpkm value error edger • 3.0k views
ADD COMMENTlink modified 2.2 years ago by Biostar ♦♦ 20 • written 2.9 years ago by seta1.2k
0
gravatar for Devon Ryan
2.9 years ago by
Devon Ryan92k
Freiburg, Germany
Devon Ryan92k wrote:

help(rpkm), which will tell you that you need to input lengths for each of the genes.

ADD COMMENTlink written 2.9 years ago by Devon Ryan92k

The gene length was included, please see head(expressioncount). Sorry, I have not enough experience with this software and the manual wasn't helpful on this issue. So, please help me to solve the problem, here.

ADD REPLYlink modified 2.9 years ago • written 2.9 years ago by seta1.2k
1

The lengths aren't in y, so rpkm can't see them. You want rpkm(y, gene.length=expressioncount$length).

ADD REPLYlink written 2.9 years ago by Devon Ryan92k

Thank you very much, Devon. It worked well.

ADD REPLYlink written 2.9 years ago by seta1.2k
0
gravatar for EagleEye
2.9 years ago by
EagleEye6.5k
Sweden
EagleEye6.5k wrote:

If you have count table with length column in the end (tab-separated), try this script.

Note:

1) Header should start with #

2) First column gene name followed by counts in other columns ans the last colum with length.

https://github.com/santhilalsubhash/rpkm_rnaseq_count/blob/master/README.md

Sorry that I could not able to help you using edgeR.

ADD COMMENTlink modified 2.9 years ago • written 2.9 years ago by EagleEye6.5k
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: 741 users visited in the last hour