gr2dt {multicrispr} | R Documentation

## GRanges <-> data.table

### Description

GRanges <-> data.table

### Usage

    gr2dt(gr)

    dt2gr(dt, seqinfo)

### Arguments

`gr` | `GRanges-class`
`dt` | data.table
`seqinfo` | `Seqinfo-class`

### Value

data.table (gr2dt) or GRanges (dt2gr)

### Examples

    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)))

[Package multicrispr version 1.2.0 Index]