flank_fourways.Rd
Flank left and right, for both strands, and merge overlaps
flank_fourways(granges, leftstart = -200, leftend = -1, rightstart = 1, rightend = 200, verbose = TRUE)
granges | GenomicRanges::GRanges |
---|---|
leftstart | numeric(1): left flank start (from range start) |
leftend | numeric(1): left flank end (from range start) |
rightstart | numeric(1): right flank start (from range end) |
rightend | numeric(1): right flank end (from range end) |
verbose | logical(1): report? |
data.table(chr, start, end, strand)
require(magrittr) bedfile <- system.file('extdata/SRF_sites.bed', package = 'multicrispr') bsgenome <- BSgenome.Mmusculus.UCSC.mm10::Mmusculus granges <- read_bed(bedfile, bsgenome)#>#>#>#>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 genomegranges %>% flank_fourways()#>#>#>#>#>#>#> GRanges object with 7306 ranges and 0 metadata columns: #> seqnames ranges strand #> <Rle> <IRanges> <Rle> #> [1] chr1 4712427-4712626 + #> [2] chr1 4712644-4712843 + #> [3] chr1 5250011-5250210 + #> [4] chr1 5250228-5250450 + #> [5] chr1 5250468-5250667 + #> ... ... ... ... #> [7302] chrY 42512416-42512615 - #> [7303] chrY 79047975-79048174 - #> [7304] chrY 79048192-79048391 - #> [7305] chrY 89126293-89126492 - #> [7306] chrY 89126510-89126709 - #> ------- #> seqinfo: 66 sequences (1 circular) from mm10 genome