build_annotations {annotatr} | R Documentation

## A function to build annotations from TxDb.* and AnnotationHub resources

### Description

Create a `GRanges` object consisting of all the desired `annotations`. Supported annotation codes are listed by `builtin_annotations()`. The basis for enhancer annotations are FANTOM5 data, the basis for CpG related annotations are CpG island tracks from `AnnotationHub`, and the basis for genic annotations are from the `TxDb.*` and `org.db` group of packages.

### Usage

    build_annotations(genome, annotations)

### Arguments

`genome` | The genome assembly.
`annotations` | A character vector of annotations to build. Valid annotation codes are listed with `builtin_annotations()`. The "basicgenes" shortcut builds the following regions: 1-5Kb upstream of TSSs, promoters, 5UTRs, exons, introns, and 3UTRs. The "cpgs" shortcut builds the following regions: CpG islands, shores, shelves, and interCGI regions. NOTE: Shortcuts need to be appended by the genome, e.g. `hg19_basicgenes`. Custom annotations whose names are of the form `[genome]_custom_[name]` should also be included. Custom annotations should be read in and converted to `GRanges` with `read_annotations()`. They can be for a `supported_genome()`, or for an unsupported genome.

### Value

A `GRanges` object of all the `annotations` combined. The `mcols` are `id, tx_id, gene_id, symbol, type`. The `id` column is a unique name, the `tx_id` column is either a UCSC knownGene transcript ID (genic annotations) or a Ensembl transcript ID (lncRNA annotations), the `gene_id` is the Entrez ID, the `symbol` is the gene symbol from the `org.*.eg.db` mapping from the Entrez ID, and the `type` is of the form `[genome]_[type]_[name]`.

### Examples

    # Example with hg19 gene promoters
    annots = c('hg19_genes_promoters')
    annots_gr = build_annotations(genome = 'hg19', annotations = annots)

    # See vignette for an example with custom annotation

[Package annotatr version 1.14.0 Index]