Subset loops based on loop and anchor size filters. Can be used to filter the loops in the LoopRanges object before or after calling ConsensusLoops

DropLoops(loop_ranges, type = NULL, size = NULL)

Arguments

loop_ranges

A LoopRanges class object

type

A string indicating the type of filtering when determining which loops to drop:

  • "anchor_size" - Drops loops based on given anchor sizes

  • "loop_size" - Drops loops based on end-to-end loop size

size

A numerical vector indicating size range to keep (e.g. c(start, end))

Value

A subsetted LoopRanges class object

Examples

# Load loops into LoopRanges object ovary_loops <- system.file("extdata/loops", "ovary_hg19.bedpe", package = "LoopRig", mustWork = TRUE) loops_ovary <- LoopsToRanges(ovary_loops, custom_cols = 0) # Subset loops based on total length between 100 to 100000 bp DropLoops(loops_ovary, type = "loop_size", size = c(100, 100000))
#> [[1]] #> GRangesList object of length 2: #> $Anchor 1 #> GRanges object with 1478 ranges and 0 metadata columns: #> seqnames ranges strand #> <Rle> <IRanges> <Rle> #> [1] chr5 29850107-29860107 * #> [2] chr5 158207008-158217008 * #> [3] chr5 158367008-158377008 * #> [4] chr5 121665695-121675695 * #> [5] chr5 77835823-77845823 * #> ... ... ... ... #> [1474] chr4 180481153-180491153 * #> [1475] chr4 119811155-119821155 * #> [1476] chr4 188531154-188541154 * #> [1477] chr4 171841151-171851151 * #> [1478] chr4 20001623-20011623 * #> #> ... #> <1 more element> #> ------- #> seqinfo: 23 sequences from an unspecified genome; no seqlengths #> #> attr(,"class") #> [1] "LoopRanges"
# Subset loops based on anchor size between 1000 to 25000 bp DropLoops(loops_ovary, type = "anchor_size", size = c(1000, 25000))
#> [[1]] #> GRangesList object of length 2: #> $Anchor 1 #> GRanges object with 5647 ranges and 0 metadata columns: #> seqnames ranges strand #> <Rle> <IRanges> <Rle> #> [1] chr5 14140109-14150109 * #> [2] chr5 29850107-29860107 * #> [3] chr5 158137008-158147008 * #> [4] chr5 158197008-158207008 * #> [5] chr5 158167008-158177008 * #> ... ... ... ... #> [5643] chr4 78621154-78631154 * #> [5644] chr4 33601622-33611622 * #> [5645] chr4 41452017-41462017 * #> [5646] chr4 99321151-99331151 * #> [5647] chr4 169501151-169511151 * #> #> ... #> <1 more element> #> ------- #> seqinfo: 23 sequences from an unspecified genome; no seqlengths #> #> attr(,"class") #> [1] "LoopRanges"