computeGeneLength: Extracting the gene length from annotations

Description Usage Arguments Value Examples

View source: R/filterExpression.R

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

1
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

1
2
3
4
5
6
7
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]

gagneurlab/OUTRIDER documentation built on Oct. 24, 2020, 6:49 p.m.