Get source code for rpkm() function in edgeR
1
0
Entering edit mode
@thibaultlorin-7570
Last seen 5.7 years ago
Switzerland

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.6k views
ADD COMMENT
4
Entering edit mode
@martin-morgan-1513
Last seen 20 days ago
United States

'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 COMMENT

Login before adding your answer.

Traffic: 433 users visited in the last hour
Help About
FAQ
Access RSS
API
Stats

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.

Powered by the version 2.3.6