Uses tab delimited element data in the form of BED4 or BED12 files to create GRanges element objects

ElementsToRanges(..., element_names = NULL, custom_cols = NULL,
  custom_mcols = NULL)

Arguments

...

Any number of tab delimited element data files in BED4 or BED12 format

element_names

A character vector of names for the element datasets (optional)

custom_cols

An integer indicating the number of extra columns in the BED file.

custom_mcols

An integer or vector of integers indicating which columns are used for metadata (optional)

Value

An ElementRanges class object: list of GRanges element data objects

Examples

# Load enhancer and promoter elements into an ElementRanges object enhancers <- system.file("extdata/elements", "enhancers.bed", package = "LoopRig", mustWork = TRUE) promoters <- system.file("extdata/elements", "promoters.bed", package = "LoopRig", mustWork = TRUE) element_ranges <- ElementsToRanges(enhancers, promoters, element_names = c("enhancers", "promoters"), custom_cols = 1, custom_mcols = 4) element_ranges
#> $enhancers #> GRanges object with 1000 ranges and 1 metadata column: #> seqnames ranges strand | mcols #> <Rle> <IRanges> <Rle> | <character> #> [1] chr2 48752479-48807772 * | E573 #> [2] chrX 9000916-9002368 * | E1383 #> [3] chr4 84406018-84406908 * | E6724 #> [4] chr15 90773255-90784140 * | E3155 #> [5] chr1 112525348-112535556 * | E8752 #> ... ... ... ... . ... #> [996] chr12 50781274-50836617 * | E9077 #> [997] chr6 150067458-150068014 * | E1642 #> [998] chr17 34263213-34274392 * | E6285 #> [999] chr3 192954838-192959007 * | E5603 #> [1000] chr1 204432559-204468852 * | E281 #> ------- #> seqinfo: 25 sequences from an unspecified genome; no seqlengths #> #> $promoters #> GRanges object with 1000 ranges and 1 metadata column: #> seqnames ranges strand | mcols #> <Rle> <IRanges> <Rle> | <character> #> [1] chr2 48752479-48807772 * | STON1-GTF2A1L #> [2] chrX 9000916-9002368 * | FAM9B #> [3] chr4 84406018-84406908 * | FAM175A #> [4] chr15 90773255-90784140 * | GDPGP1 #> [5] chr1 112525348-112535556 * | KCND3 #> ... ... ... ... . ... #> [996] chr12 50781274-50836617 * | LARP4 #> [997] chr6 150067458-150068014 * | NUP43 #> [998] chr17 34263213-34274392 * | LYZL6 #> [999] chr3 192954838-192959007 * | HRASLS #> [1000] chr1 204432559-204468852 * | PIK3C2B #> ------- #> seqinfo: 25 sequences from an unspecified genome; no seqlengths #> #> attr(,"class") #> [1] "ElementRanges"