NameRegion: Name a region with several CpGs based on its genomic location

View source: R/util2_NameRegion.R

NameRegionR Documentation

Name a region with several CpGs based on its genomic location

Description

Name a region with several CpGs based on its genomic location

Usage

NameRegion(CpGsOrdered_df)

Arguments

CpGsOrdered_df

dataframe with columns for Probe IDs as character (cpg), chromosome number as character (chr), and genomic location as integer (pos)

Value

genome location of the CpGs formatted as "chrxx:xxxxxx-xxxxxx"

Examples

 # Consider four probe IDs:
 CpGs_char <- c("cg04677227", "cg07146435", "cg11632906", "cg20214853")
 
 # After querying these four probes against an EPIC array via the 
 #   OrderCpGsByLocation() function, we get the following data frame:
 CpGsOrdered_df <- data.frame(
   chr = c("chr10", "chr10", "chr10", "chr10"),
   pos = c(100028236L, 100028320L, 100028468L, 100028499L),
   cpg = c("cg20214853", "cg04677227", "cg11632906", "cg07146435"),
   stringsAsFactors = FALSE
 )

 # Now, we can name the region that contains these four probes:
 NameRegion(CpGsOrdered_df)


TransBioInfoLab/coMethDMR documentation built on Sept. 14, 2022, 7:09 p.m.