normaliseNC: A function providing adjustment of cytosine...

Description Usage Arguments Details Value Author(s) References Examples

View source: R/utilityFunctions.R

Description

This function adjusts the observed cytosine methylated/unmethylated counts at each cytosine site based on the reported nonconversion rates for each samples.

Usage

1
normaliseNC(mD, nonconversion)

Arguments

mD

Either an alignmentMeth or segMeth object, or a lociData object (for which nonconversion must be explicitly supplied).

nonconversion

A vector defining nonconversion rates for each sample, required if a lociData object is supplied in ‘mD’ and ignored otherwise.

Details

This function operates by estimating the expected number of unconverted cytosines at each site and subtracting this from the reported methylated cytosines and adding to the reported unmethylated cytosines. It should not be used on data that will be analysed in a way that accounts for nonconversion; e.g., using the ‘bbNCDist’ densityFunction object.

Value

A modified version of the object supplied as ‘mD’.

Author(s)

Thomas J. Hardacastle

References

Hardcastle T.J. Discovery of methylation loci and analyses of differential methylation from replicated high-throughput sequencing data. bioRxiv (http://dx.doi.org/10.1101/021436)

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
datadir <- system.file("extdata", package = "segmentSeq")
files <- c("short_18B_C24_C24_trim.fastq_CG_methCalls.gz",
"short_Sample_17A_trimmed.fastq_CG_methCalls.gz",
"short_13_C24_col_trim.fastq_CG_methCalls.gz",
"short_Sample_28_trimmed.fastq_CG_methCalls.gz")

mD <- readMeths(files = files, dir = datadir,
libnames = c("A1", "A2", "B1", "B2"), replicates = c("A","A","B","B"),
nonconversion = c(0.004777, 0.005903, 0.016514, 0.006134))

mD <- normaliseNC(mD)

segmentSeq documentation built on Nov. 8, 2020, 5:18 p.m.