positions_to_regions: Converts methylation counts for single genomic positions to...

Description Usage Arguments Format Author(s) See Also Examples

View source: R/BEAT.R

Description

Converts methylation counts of a data.frame of single genomic positions into a data.frame of counts for genomic regions.

Usage

1
positions_to_regions(params, outputPath = getwd())

Arguments

params

BEAT parameter object.

outputPath

Path to which output files will be written, the default is the current working directory.

Format

Necessary function arguments are passed via a BEAT parameter object, which includes working path, sample names, reference sample name, model parameters and region sizes.

params

Parameter object created by calling makeParams.

sample.positions.csv

For each sample referenced by the params argument sampleNames, a corresponding csv must be present in the working directory. The csv input must contain one row per genomic position for each CG site. Columns must be chr, pos, meth, unmeth (chromosome, position, methylated counts, unmethylated counts).

Author(s)

Kemal Akman <akmank@mpipz.mpg.de>

See Also

See also makeParams.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
# Local working directory
localpath <- system.file('extdata', package = 'BEAT')
# Names of samples, expected filenames are e.g. reference.positions.csv
sampNames <- c("reference", "sample")
# Empirical BS-conversion rates, e.g. estimated from non-CpG methylation
convrates <- c(0.8,0.5)
# Vector denoting reference vs. single-cell status of given samples
is.reference <- c(TRUE,FALSE)
params <- makeParams(localpath, sampNames, convrates, is.reference, pminus = 0.2, regionSize = 10000, minCounts = 5, verbose = TRUE, computeRegions = TRUE, computeMatrices = TRUE, writeEpicallMatrix = TRUE)
# Pool CG positions into regions
positions_to_regions(params)

BEAT documentation built on Nov. 8, 2020, 5:38 p.m.