gr2dt: GRanges <-> data.table

Description Usage Arguments Value Examples

View source: R/02_utilities.R

Description

GRanges <-> data.table

Usage

1
2
3
gr2dt(gr)

dt2gr(dt, seqinfo)

Arguments

gr

GRanges-class

dt

data.table

seqinfo

Seqinfo-class

Value

data.table (gr2dt) or GRanges (dt2gr)

Examples

1
2
3
4
5
6
7
8
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)
(dt <- gr2dt(gr))
(gr <- dt2gr(dt, BSgenome::seqinfo(bsgenome)))

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