This function takes a string of UCSC genome browser coordinates and returns them as a GRanges object.
ucsc_to_granges(coords)
A character vector of UCSC genome browser coordinates.
A GRanges object.
ucsc_coords <- c("chr1:1000-2000")
ucsc_to_granges(ucsc_coords)
#> GRanges object with 1 range and 0 metadata columns:
#> seqnames ranges strand
#> <Rle> <IRanges> <Rle>
#> [1] chr1 1000-2000 *
#> -------
#> seqinfo: 1 sequence from an unspecified genome; no seqlengths