Learn R Programming

MPFE (version 1.8.0)

estimatePatterns: Estimate distribution of methylation patterns

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

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)

Examples

Run this code
  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)

Run the code above in your browser using DataLab