annotate_regions {annotatr} | R Documentation |
Annotate genomic regions to selected genomic annotations while preserving the data associated with the genomic regions.
annotate_regions(regions, annotations, minoverlap = 1L, ignore.strand = TRUE, quiet = FALSE)
regions |
The GRanges object returned by |
annotations |
A character vector of annotations to build. Valid annotation codes are listed with |
minoverlap |
A scalar, positive integer, indicating the minimum required overlap of regions with annotations. |
ignore.strand |
Logical indicating whether strandedness should be respected in findOverlaps(). Default FALSE. |
quiet |
Print progress messages (FALSE) or not (TRUE). |
A GRanges
where the granges
are from the regions, and the mcols
include the mcols
from the regions and a column with the annotation GRanges
.
r_file = system.file('extdata', 'test_read_multiple_data_nohead.bed', package='annotatr') extraCols = c(pval = 'numeric', mu1 = 'integer', mu0 = 'integer', diff_exp = 'character') r = read_regions(con = r_file, extraCols = extraCols, rename_score = 'coverage') # Get premade CpG annotations data('annotations', package = 'annotatr') a = annotate_regions( regions = r, annotations = annotations, ignore.strand = TRUE)