Convert a genomic coordinate string to a GRanges object
StringToGRanges(regions, sep = c("-", "-"), ...)
Vector of genomic region strings
Vector of separators to use for genomic string. First element is used to separate chromosome and coordinates, second separator is used to separate start and end coordinates.
Additional arguments passed to
makeGRangesFromDataFrame
Returns a GRanges object
regions <- c('chr1-1-10', 'chr2-12-3121')
StringToGRanges(regions = regions)
#> GRanges object with 2 ranges and 0 metadata columns:
#> seqnames ranges strand
#> <Rle> <IRanges> <Rle>
#> [1] chr1 1-10 *
#> [2] chr2 12-3121 *
#> -------
#> seqinfo: 2 sequences from an unspecified genome; no seqlengths