Slop granges for both strands, merging overlaps

slop_fourways(granges, leftstart = -22, rightend = 22,
  verbose = TRUE)

Arguments

granges

GenomicRanges::GRanges

leftstart

numeric(1)

rightend

numeric(1)

verbose

logical(1)

Value

GenomicRanges::GRanges

Examples

require(magrittr) bedfile <- system.file('extdata/SRF_sites.bed', package = 'multicrispr') bsgenome <- BSgenome.Mmusculus.UCSC.mm10::Mmusculus granges <- read_bed(bedfile, bsgenome)
#> Read C:/Users/abhagwa/Documents/multicrispr/inst/extdata/SRF_sites.bed
#> 1974 ranges on 21 chromosomes
#> 17 NT wide
#> 0 - 36535760 NT apart
granges
#> GRanges object with 1974 ranges and 0 metadata columns: #> seqnames ranges strand #> <Rle> <IRanges> <Rle> #> [1] chr1 4712627-4712643 - #> [2] chr1 5250211-5250227 - #> [3] chr1 5250451-5250467 - #> [4] chr1 5256192-5256208 - #> [5] chr1 5985727-5985743 - #> ... ... ... ... #> [1970] chrY 6770311-6770327 + #> [1971] chrY 23130567-23130583 + #> [1972] chrY 42512399-42512415 - #> [1973] chrY 79048175-79048191 - #> [1974] chrY 89126493-89126509 - #> ------- #> seqinfo: 66 sequences (1 circular) from mm10 genome
granges %>% slop_fourways()
#> Slop fourways
#> 1974 slopped granges: [start-22, end+22]
#> 3948 after adding strand-complements
#> 3932 after merging overlaps
#> GRanges object with 3932 ranges and 0 metadata columns: #> seqnames ranges strand #> <Rle> <IRanges> <Rle> #> [1] chr1 4712605-4712665 + #> [2] chr1 5250189-5250249 + #> [3] chr1 5250429-5250489 + #> [4] chr1 5256170-5256230 + #> [5] chr1 5985705-5985765 + #> ... ... ... ... #> [3928] chrY 6770289-6770349 - #> [3929] chrY 23130545-23130605 - #> [3930] chrY 42512377-42512437 - #> [3931] chrY 79048153-79048213 - #> [3932] chrY 89126471-89126531 - #> ------- #> seqinfo: 66 sequences (1 circular) from mm10 genome