add_seq: Add sequence to GRanges

Description Usage Arguments Value Examples

View source: R/05_manipulate_ranges.R

Description

Add sequence to GRanges

Usage

1
add_seq(gr, bsgenome, verbose = FALSE, as.character = TRUE)

Arguments

gr

GRanges-class

bsgenome

BSgenome-class

verbose

TRUE or FALSE (default)

as.character

TRUE (default) or FALSE

Value

GRanges-class

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
# PE example
#-----------
    require(magrittr)
    bsgenome <- BSgenome.Hsapiens.UCSC.hg38::BSgenome.Hsapiens.UCSC.hg38  
    gr <- char_to_granges(c(PRNP = 'chr20:4699600:+',             # snp
                            HBB  = 'chr11:5227002:-',             # snp
                            HEXA = 'chr15:72346580-72346583:-',   # del
                            CFTR = 'chr7:117559593-117559595:+'), # ins
                          bsgenome)
   (gr %<>% add_seq(bsgenome))
   
# TFBS example
#-------------
    bsgenome <- BSgenome.Mmusculus.UCSC.mm10::BSgenome.Mmusculus.UCSC.mm10
    bedfile  <- system.file('extdata/SRF.bed', package='multicrispr')
    gr <- bed_to_granges(bedfile, 'mm10')
    (gr %<>% add_seq(bsgenome))

multicrispr documentation built on Nov. 8, 2020, 5:10 p.m.