estimatePatterns: Estimate distribution of methylation patterns

Description Usage Arguments Value Author(s) Examples

View source: R/estimatePatterns.R

Description

Estimate distribution of methylation patterns from a table of counts from a bisulphite sequencing experiment given a non-conversion rate and a sequencing error rate.

Usage

1
2
3
4
5
6
7
  estimatePatterns(patternCounts,
                   epsilon=0,
                   eta=0,
                   column=NULL,
                   fast=TRUE,
                   steps=20000,
                   reltol=1e-12)

Arguments

patternCounts

data frame with methylation patterns in first column and pattern counts in subsequent columns.

epsilon

non-converson rate, a value between 0 and 1.

eta

error rate, either a vector of numbers between 0 and 1 of length equal to the number of CpG sites or a single value between 0 and 1 for a single error rate across all sites.

column

a vector that specifies the indices of the columns of ‘patternCounts’ to process. Its entries are integer values from 1 to the number of pattern counts columns in ‘patternCounts’. If NULL, defaults to all columns.

fast

logical, if TRUE, fast version implemented (default).

steps

number of steps for the optimiser, passed to constrOptim. If NULL, defaults to 20000 steps.

reltol

relative tolerance for the optimiser, passed to constrOptim. If NULL, defaults to 1e-12.

Value

The function returns a list of data frames.

The data frames contain the following columns:

pattern

the list of input patterns (factor)

coverage

the number of reads for each pattern (integer)

observedDistribution

the observed frequencies of each pattern (numeric)

estimatedDistribution

the estimated frequencies (numeric)

spurious

indicates whether the patterns are real or spurious (logical)

Author(s)

Peijie Lin, Sylvain Foret, Conrad Burden

Examples

1
2
3
4
5
6
7
8
  data(patternsExample)
  estimatePatterns(patternsExample, 
                   epsilon=0.02, 
                   eta=0.01)
  estimatePatterns(patternsExample, 
                   epsilon=0.01, 
                   eta=c(0.015, 0.01, 0.01, 0.01, 0.015),
                   column=2)

MPFE documentation built on Nov. 1, 2018, 5:03 a.m.