as.granges.Rd
Convert data.table into GenomicRanges::GRanges
as.granges(x, bsgenome)
x | data.table |
---|---|
bsgenome | BSgenome, e.g. BSgenome.Mmusculus.UCSC.mm10::Mmusculus |
GenomicRanges::GRanges
require(magrittr)#>#> #>#>#> #>bedfile <- system.file('extdata/SRF_sites.bed', package = 'multicrispr') bsgenome <- BSgenome.Mmusculus.UCSC.mm10::Mmusculus granges <- read_bed(bedfile, bsgenome)#>#>#>#>granges$seqs <- seqs(granges) x <- granges %>% data.table::as.data.table() x %>% as.granges(bsgenome = bsgenome)#> GRanges object with 1974 ranges and 1 metadata column: #> seqnames ranges strand | seqs #> <Rle> <IRanges> <Rle> | <character> #> [1] chr1 4712627-4712643 - | AGACAATATAAGGGCAT #> [2] chr1 5250211-5250227 - | AGACAATATAAGGACAT #> [3] chr1 5250451-5250467 - | TGACAATATTTGGAATG #> [4] chr1 5256192-5256208 - | AGACAATATAAGGACAT #> [5] chr1 5985727-5985743 - | CCACCAAATATGGGCTT #> ... ... ... ... . ... #> [1970] chrY 6770311-6770327 + | GAGACAATATAAGGACA #> [1971] chrY 23130567-23130583 + | GAGACAATATAAGGACA #> [1972] chrY 42512399-42512415 - | TGGCCAAATATGTGGAA #> [1973] chrY 79048175-79048191 - | AGACAATATAAGGACAT #> [1974] chrY 89126493-89126509 - | TGCCCATACTAGGGAGA #> ------- #> seqinfo: 66 sequences (1 circular) from mm10 genome