Learn R Programming

Genominator (version 1.26.0)

mergeWithAnnotation: Combine data with annotation

Description

This function creates a data frame containing the data and the corresponding annotation information for each data row included in the annotation.

Usage

mergeWithAnnotation(expData, annoData, what = "*", ignoreStrand = FALSE, splitBy = NULL, verbose = getOption("verbose"))

Arguments

expData
An object of class ExpData.
annoData
A data frame which must contain the columns chr, start, end and strand which specifies annotation regions of interest.
what
Which columns of expData to include.
ignoreStrand
Logical indicating whether strand should be ignored. If TRUE, data from either strand that falls into an annotation region is included.
splitBy
Field on which merged data frame should be split before returning.
verbose
Logical indicating whether details should be printed.

Value

If splitBy is NULL, returns a data frame containing the data from expData that fall into regions defined by annoData, and which includes the annotation information, with columns as specified by what. If splitBy is non-NULL, returns a list of data frames with an element for each unique value of splitBy field.

Details

Generally this function is good for creating a list of data split by some annotation feature, which can then be applied across.

See Also

See Genominator vignette for more information.

Examples

Run this code
ed <- ExpData(system.file(package = "Genominator", "sample.db"),
              tablename = "raw")
data("yeastAnno")
mergeWithAnnotation(ed, yeastAnno[1:5,])

Run the code above in your browser using DataLab