read_met: Read methylation file

Description Usage Arguments Value Important Author(s) See Also Examples

View source: R/process_data.R

Description

read_met reads a file containing methylation data using the fread function. Since there are different technologies, e.g. array, bulk BS-Seq, scBS-Seq, and still there is no standard file format, different options are available, check the Important section below on the file format for each type you choose. If a file format is not availabe, you need to read the file and create a GRanges object, where the data are ordered by chromosome and genomic location.

Usage

1
2
3
4
5
6
7
8
9
read_met(
  file,
  type = "sc_seq",
  strand_info = FALSE,
  chr_discarded = NULL,
  min_bulk_cov = 4,
  max_bulk_cov = 1000,
  delimiter = "\t"
)

Arguments

file

File name.

type

Type of technology as character. Either "bulk_seq", "sc_seq" or "array". Check the Important section below for more details.

strand_info

Logical, whether or not the file contains strand information.

chr_discarded

Optional vector with chromosomes to be discarded.

min_bulk_cov

Minimum number of reads mapping to each CpG site. Used only for "bulk_seq" and CpGs with less reads will be discarded as noise.

max_bulk_cov

Maximum number of reads mapping to each CpG site. Used only for "bulk_seq" and CpGs with less reads will be discarded as noise.

delimiter

Delimiter format the columns are splitted. Default is tab.

Value

A GRanges object.

The GRanges object contains one or two additional metadata columns:

These columns can be accessed as follows: granges_obj$met

Important

Depending on technology type we assume different file formats.

By default columns are considered in tab delimited format.

Author(s)

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

See Also

read_anno, read_expr, create_region_object

Examples

1
2
3
4
5
6
# Obtain the path to files
file <- system.file("extdata", "dummy_met.bed", package = "BPRMeth")
met_dt <- read_met(file)

# Extract methylation level
met <- met_dt$met

BPRMeth documentation built on Nov. 8, 2020, 5:54 p.m.