build_ah_annots {annotatr} | R Documentation

## A helper function to build arbitrary annotatinos from AnnotationHub

### Description

A helper function to build arbitrary annotatinos from AnnotationHub

### Usage

    build_ah_annots(genome, ah_codes, annotation_class)

### Arguments

`genome` | The genome assembly.
`ah_codes` | A named character vector giving the AnnotationHub accession number (e.g. AH23256), and whose name describes what the annotation is (e.g. Gm12878_H3K4me3).
`annotation_class` | A string to name the group of annotations in `ah_codes`

### Value

A `GRanges` object stored in `annotatr_cache`. To view an annotation built with this function, do `annotatr_cache$get(name)`. To add these annotations to a set of annotations, include `'[genome]_[annotation_class]_[name]'` in the call to `build_annotations()`. See example below.

### Examples

    # Create a named vector for the AnnotationHub accession codes with desired names
    h3k4me3_code = c('Gm12878' = 'AH23256')
    # Fetch ah_codes from AnnotationHub and create annotations annotatr understands
    build_ah_annots(genome = 'hg19', ah_codes = h3k4me3_code, annotation_class = 'H3K4me3')
    # The annotations as they appear in annotatr_cache
    annot_name = c('hg19_H3K4me3_Gm12878')
    # Build the annotations right before annotating any regions
    annotations = build_annotations(genome = 'hg19', annotations = annot_name)

[Package annotatr version 1.13.1 Index]