Question: Get source code for rpkm() function in edgeR
0
gravatar for thibault.lorin
4.6 years ago by
Switzerland
thibault.lorin10 wrote:

Dear Bioconductor users,

I am using the rpkm() function of edgeR and I was wondering how the rpkm value is calculated by this function.

I tried:

> library(edgeR)
> rpkm
function (x, ...) 
UseMethod("rpkm")
<environment: namespace:edgeR>

So I tried:

> UseMethod("rpkm")
Error in UseMethod("rpkm") : 'UseMethod' used in an inappropriate fashion

Would you know how I can get the source code for this function?

Thanks a lot!

 

 

edger rpkm source code • 1.4k views
ADD COMMENTlink modified 4.6 years ago by Martin Morgan ♦♦ 24k • written 4.6 years ago by thibault.lorin10
Answer: Get source code for rpkm() function in edgeR
4
gravatar for Martin Morgan
4.6 years ago by
Martin Morgan ♦♦ 24k
United States
Martin Morgan ♦♦ 24k wrote:

'UseMethod' means that rpkm is a so-called 'S3' generic. A generic has methods associated with it. See the methods with methods(rpkm), and then look at the specific method you're interested in, e.g.,

> methods(rpkm)
[1] rpkm.default rpkm.DGEList
see '?methods' for accessing help and source code
> rpkm.default
function (x, gene.length, lib.size = NULL, log = FALSE, prior.count = 0.25, 
    ...) 
{
    y <- cpm.default(x = x, lib.size = lib.size, log = log, prior.count = prior.count)
    gene.length.kb <- gene.length/1000
    if (log) 
        y - log2(gene.length.kb)
    else y/gene.length.kb
}
<environment: namespace:edgeR>

 

ADD COMMENTlink written 4.6 years ago by Martin Morgan ♦♦ 24k
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 16.09
Traffic: 290 users visited in the last hour