computeGeneLength {OUTRIDER} | R Documentation

## Extracting the gene length from annotations

### Description

Computes the length for each gene based on the given GTF file or annotation. Here the length of a gene is defind by the total number of bases covered by exons.

### Usage

    computeGeneLength(ods, gtfFile, format = "gtf", mapping = NULL, ...)

### Arguments

`ods` | An OutriderDataSet for which the gene length should be computed.
`gtfFile` | Can be a GTF file or an txDb object with annotation.
`format` | The format parameter from `makeTxDbFromGFF`
`mapping` | If set, it is used to map gene names between the GFT and the ods object. This should be a 2 column data.frame: 1. column GTF names and 2. column ods names.
`...` | further arguments to `makeTxDbFromGFF`

### Value

An OutriderDataSet containing a `basepairs` column with the calculated gene length. Accessable through `mcols(ods)['baisepairs']`

### Examples

    ods <- makeExampleOutriderDataSet(dataset="GTExSkinSmall")
    annotationFile <- system.file("extdata", "gencode.v19.genes.small.gtf.gz",
            package="OUTRIDER")
    ods <- computeGeneLength(ods, annotationFile)

    mcols(ods)['basepairs']
    fpkm(ods)[1:10,1:10]

[Package OUTRIDER version 1.12.0 Index]