build_ah_annots: A helper function to build arbitrary annotatinos from...

Description Usage Arguments Value Examples

View source: R/build_annotations.R

Description

A helper function to build arbitrary annotatinos from AnnotationHub

Usage

1
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

1
2
3
4
5
6
7
8
# 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)

annotatr documentation built on Nov. 8, 2020, 8:16 p.m.