Skip to contents

Retrieves and sorts genomic location annotations for the specified methylation array platform and genome version. Performs liftOver if necessary. The function caches the results.

Usage

getSortedGenomicLocs(array = NULL, genome = NULL, locations_file = NULL)

Arguments

array

Character. Array platform type (supported: "450K", "EPIC", "EPICv2", "27K", "Mouse"), ignored when locations_file is provided.

genome

Character. Genome version (supported: "hg38", "hg19", "hs1", "mm10", "mm39"), ignored if locations_file is provided

locations_file

Character. Optional path to a precomputed locations file (RDS format). If provided, this file will be used directly (default: NULL)

Value

A data frame containing sorted genomic locations with rownames as site IDs and columns:

  • chr: Chromosome

  • start: Genomic position

  • start: Start position (same as start)

  • end: End position (start + 1)

Examples

locs <- data.frame(chr = c("chr1", "chr1"), start = c(100L, 200L))
rownames(locs) <- c("cg1", "cg2")
locations_file <- tempfile(fileext = ".rds")
saveRDS(locs, locations_file)

sorted_locs <- getSortedGenomicLocs(locations_file = locations_file)
head(sorted_locs)