Skip to contents

The first field is treated as the chromosome and kept as a normalized string (via canonChrom) so X/Y/MT survive; the remaining fields are genomic positions and are returned as integers.

Usage

regionToDf(ldRegionId, colnames = c("chrom", "start", "end"))

Arguments

ldRegionId

A string of region in the format of chrom_start_end.

colnames

Character vector of length 3 giving output column names for chromosome, start and end. Default c("chrom", "start", "end").

Value

A tibble with one row per input region and columns named by colnames: a normalized character chromosome plus integer start/end.

Examples

regionToDf(c("1_100_200", "2_300_400"))
#> # A tibble: 2 × 3
#>   chrom start   end
#>   <chr> <int> <int>
#> 1 1       100   200
#> 2 2       300   400