Last data update: 2014.03.03

R: Retrieves Gene length data
getlengthR Documentation

Retrieves Gene length data

Description

Gets the length of each gene in a vector.

Usage

getlength(genes, genome, id)

Arguments

genes

A vector or list of the genes for which length information is required.

genome

A string identifying the genome that genes refer to. For a list of supported organisms run supportedGenomes.

id

A string identifying the gene identifier used by genes. For a list of supported gene IDs run supportedGeneIDs.

Details

Length data is obtained from data obtained from the UCSC genome browser for each combination of genome and id. As fetching this data at runtime is time consuming, a local copy of the length information for common genomes and gene ID are included in the geneLenDataBase package. This function uses this package to fetch the required data.

The length of a gene is taken to be the median length of all its mature, mRNA, transcripts. It is always preferable to obtain length information directly for the gene ID used to summarize your count data, rather than converting IDs and then using the supplied databases. Even when two genes have a one-to-one mapping between different identifier conventions (which is often not the case), they frequently refer to slightly different regions of the genome with different lengths. It is therefore recommended that the user perform the full analysis in terms of only one gene ID, or manually obtain their own length data for the identifier used to bin reads by gene.

Value

Returns a vector of the gene lengths, in the same order as genes. If length data is unavailable for a particular gene NA is returned in that position. The returned vector is intended for use with the bias.data option of the nullp function.

Author(s)

Matthew D. Young myoung@wehi.edu.au

See Also

supportedGenomes, supportedGeneIDs, nullp, geneLenDataBase

Examples

genes <- c("ENSG00000124208", "ENSG00000182463", "ENSG00000124201", "ENSG00000124205", "ENSG00000124207")
getlength(genes,'hg19','ensGene')

Results


R version 3.3.1 (2016-06-21) -- "Bug in Your Hair"
Copyright (C) 2016 The R Foundation for Statistical Computing
Platform: x86_64-pc-linux-gnu (64-bit)

R is free software and comes with ABSOLUTELY NO WARRANTY.
You are welcome to redistribute it under certain conditions.
Type 'license()' or 'licence()' for distribution details.

R is a collaborative project with many contributors.
Type 'contributors()' for more information and
'citation()' on how to cite R or R packages in publications.

Type 'demo()' for some demos, 'help()' for on-line help, or
'help.start()' for an HTML browser interface to help.
Type 'q()' to quit R.

> library(goseq)
Loading required package: BiasedUrn
Loading required package: geneLenDataBase

> png(filename="/home/ddbj/snapshot/RGM3/R_BC/result/goseq/getlength.Rd_%03d_medium.png", width=480, height=480)
> ### Name: getlength
> ### Title: Retrieves Gene length data
> ### Aliases: getlength
> 
> ### ** Examples
> 
> genes <- c("ENSG00000124208", "ENSG00000182463", "ENSG00000124201", "ENSG00000124205", "ENSG00000124207")
> getlength(genes,'hg19','ensGene')
Loading hg19 length data...
[1] 1978.0 3133.0 2973.0 2593.0 3036.5
> 
> 
> 
> 
> 
> dev.off()
null device 
          1 
>