Using a finalized LoopRanges loops object and two sets of elements, determines which elements are linked by loops through overlap of anchor regions

LinkedElements(loop_ranges, element_ranges_x, element_ranges_y,
  range_out_x = FALSE, range_out_y = FALSE, overlap_threshold = 1)

Arguments

loop_ranges

A single LoopRanges object that has been subset to one range through ConsensusLoops().

element_ranges_x

A subset ElementRanges class object. Subset appropriate ranges by using list indexing.

element_ranges_y

A subset ElementRanges class object. Subset appropriate ranges by using list indexing.

range_out_x

A boolean indicating if the output should be a subset element ranges object for element_ranges_x instead of the default dataframe. (default = FALSE)

range_out_y

A boolean indicating if the output should be a subset element ranges object for element_ranges_y instead of the default dataframe. (default = FALSE)

overlap_threshold

Single numerical input for significant base-pair overlap to be considered 'overlapping'. Default is 1 bp.

Value

Returns a dataframe indicating the unique element links present in the form of their first metadata columns. The element_ranges_x are always under column 1, and element_ranges_y are always under column 2.

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) # Load loops into LoopRanges object and determine consensus loops (keep all) ovary_loops <- system.file("extdata/loops", "ovary_hg19.bedpe", package = "LoopRig", mustWork = TRUE) pancreas_loops <- system.file("extdata/loops", "pancreas_hg19.bedpe", package = "LoopRig", mustWork = TRUE) loops <- LoopsToRanges(ovary_loops, pancreas_loops, custom_cols = 0) consensus_loops <- ConsensusLoops(loops, keep_all = TRUE) # Based on consensus loops, determine which enhancers and promoters # are connected based on loop anchors LinkedElements(consensus_loops, element_ranges[[1]], element_ranges[[2]])
#> Anchor_1 Anchor_2 #> 1 E3401 PLXNC1 #> 2 E9046 RERG #> 4 E337 OFCC1 #> 6 E40 OR51L1 #> 7 E1280 CD36 #> 8 E444 RBM33 #> 9 E2075 RBFOX2 #> 12 E7729 LARGE #> 17 E4198 IQCH #> 18 E983 SEMA6D #> 22 E3872 RGS3 #> 23 E4959 NR6A1 #> 24 E5250 PBX1 #> 25 E7399 SSBP3 #> 26 E6741 COLGALT2 #> 27 E3508 MDGA2 #> 30 E2160 CDYL2 #> 31 E8242 CRIM1 #> 32 E2564 RAPGEF4 #> 33 E2499 CTNNA2 #> 35 E5267 TNIK #> 36 E8992 EXOC4 #> 39 E247 SYNE2 #> 43 E9901 SGCD #> 45 E7592 TSPAN18 #> 58 E3762 KSR1 #> 77 E1325 RBMS1 #> 79 E1924 TNS1 #> 83 E3341 CLDN14 #> 86 E4289 RBPJ #> 87 E1014 ABLIM3 #> 88 E3608 UTRN #> 92 E3247 PPFIBP2 #> 109 E2680 MMP26