For a given CpG island (CGI), function returns the list of CpGs within the island. Island shores and shelves can be included in the search and returned list can be sorted by the CpG coordinate. If working with Illumina Infinium HM450K, `cg_meta` and `cg_meta_cols` parameters should keep their default values.

CpG_in_CGI(
  cg_island,
  cg_meta = meNet::CpG_anno450K,
  cg_meta_cols = list(cg_id = "IlmnID", cg_chr = "CHR", cg_coord = "MAPINFO",
    island_name = "UCSC_CpG_Islands_Name", island_region = "Relation_to_UCSC_CpG_Island"),
  include_regions = c(),
  sort_by_coord = FALSE
)

Arguments

cg_island

Name of a CpG island.

cg_meta

Data frame which defines relationship between CpG sites and CpG islands. It has CpGs in the rows and their description in the columns. If CpG is part of an CGI, `cg_meta` gives the name of the island and the region of an island in which the CpG is found. By default, function uses `CpG_anno450K` data frame which contains Illumina Infinium HumanMethylation450 manifest file.

cg_meta_cols

Named list with `cg_meta` column names. The list must include: `cg_id` naming the column with unique CpG names, `island_name` naming the column with CGI names and `island_region` naming the column with the CGI region in which the CpG is located. Default value shouldn't be changed if `cg_meta` keeps it default value.

include_regions

Regions of CGI which should be searched for CpGs besides the island itself. Can take any subset of values `"S_Shelf"`, `"S_Shore"`, `"N_Shore"``, `"N_Shelf"`. By default, only the CpGs inside the island are reported.

sort_by_coord

If `TRUE`, returned list of CpGs will be ordered by their coordinates. In this case, `cg_meta` must contain two additional columns and `cg_meta_cols` must include two additional elements: `cg_chr` naming column with chromosome and `cg_coord` naming column with coordinate of CpG. Defaults to `FALSE`.

Value

A vector with CpG sites located within the given CpG island.