create_region_object {BPRMeth} | R Documentation

## Create genomic region data

### Description

`create_region_object` creates genomic regions (e.g. forms methylation regions data) using as input methylation and annotation data with genomic regions of interest.

### Usage

    create_region_object(met_dt, anno_dt, cov = 5, sd_thresh = 0.1,
      ignore_strand = TRUE, filter_empty_region = TRUE, fmin = -1,
      fmax = 1)

### Arguments

`met_dt` | A `GRanges` object with methylation data, whose format should be similar to `read_met` function.
`anno_dt` | A `GRanges` object with annotation data, whose format should be similar to `read_anno`.
`cov` | Integer defining the minimum coverage of CpGs that each region must contain.
`sd_thresh` | Optional numeric defining the minimum standard deviation of the methylation change in a region. This is used to filter regions with no methylation variability.
`ignore_strand` | Logical, whether or not to ignore strand information.
`filter_empty_region` | Logical, whether to discard genomic regions that have no CpG coverage or do not pass filtering options.
`fmin` | Minimum range value for location scaling. Under this version, it should be left to its default value -1.
`fmax` | Maximum range value for location scaling. Under this version, it should be left to its default value 1.

### Value

A `list` object containing the two elements:

- `met`: A list containing methylation region data, where each entry in the list is an L_{i} X D dimensional matrix, where L_{i} denotes the number of CpGs found in region `i`. The columns contain the following information:

  1. 1st column: Contains the locations of CpGs relative to centre. Note that the actual locations are scaled to the (fmin, fmax) region.

  2. 2nd column: If "bulk" data (i.e. binomial) it contains the total number of reads at each CpG location, otherwise the methylation level.

  3. 3rd column: If "bulk" data, the methylated reads at each CpG location, otherwise this D = 2 and this column is absent.

- `anno`: The annotation object.

Note: The lengths of `met` and `anno` should match.

### Author(s)

C.A.Kapourani C.A.Kapourani@ed.ac.uk

### See Also

`read_met`, `read_anno`

### Examples

    ## Not run:
    # Download the files and change the working directory to that location
    met_dt <- read_met("name_of_met_file")
    anno_dt <- read_anno("name_of_anno_file")

    obj <- create_region_object(met_dt, anno_dt)

    # Extract methylation regions
    met <- obj$met

    ## End(Not run)

[Package BPRMeth version 1.13.0 Index]