get_bed_overlaps: Get overlaps of data.frame rows and BED files.

Description Usage Arguments Value

View source: R/overlaps_get.R

Description

get_bed_overlaps finds overlaps between the rows of a data.frame and every BED file within a directory. If one row does not overlap anything in the BED files, it is still returned.

Usage

1
get_bed_overlaps(df, dir = ".", col_itemRgb = 0, verbose = F)

Arguments

df

Data.frame. Data.frame with at least these columns: CHROM, POS, ID.

dir

Character. String specifying the directory with BED files. This method assumes there is not header to the BED files that must be removed.

col_itemRgb

Numeric. Specifies the column of itemRgb values within a BED file. In a strict BED file, this would be column 9 (see https://genome.ucsc.edu/FAQ/FAQformat.html#format1). If col_itemRgb == 0, RGB values will not be appended to the output, as described below in the return documentation of this function.

verbose

Logical. If true, print extra output (e.g., on bed files being read).

Value

Data.frame. The input data.frame with additional bed* columns named for each BED file in the input directory (e.g., bed.<file_name1>). The value of each column is the 'name' entry of the BED file (column 4) corresponding to the genomic segment that overlaps the input data. If col_itemRgb != 0, then the output values will have the RGB values from the BED file appended to them using a '::' character (e.g, <bed_file.name_value> -> <bed_file.name_value>::<bed_file.RGB_value>).


letaylor/variantBedOverlap documentation built on Dec. 24, 2019, 11:21 a.m.