Learn R Programming

MassArray (version 1.24.0)

calcMeth: Calculate percent methylation

Description

Function to calculate percent methylation from a collection of peaks corresponding to a single fragment.

Usage

calcMeth(SNR.list, fragments = rep(1, length(SNR.list)), non.cg.fragments = numeric(0), method = c("weighted", "proportion"), prune.non.cg.peaks = TRUE, na.rm = FALSE)

Arguments

SNR.list
List of signal-to-noise ratios, sorted from low to high MWs, corresponding to the unmethylated and methylated peaks for a given set of fragments
fragments
List of all fragments contributing to each of the input peaks, automatically defaulting to a single fragment
non.cg.fragments
List of fragments (without CGs) contributing to any of the input peaks, automatically defaulting to numeric(0)
method
Specifies which algorithm to use when calculating percent methylation (either "weighted" or "proportion")
prune.non.cg.peaks
Boolean value determining whether or not to remove non-CG-containing fragments prior to analysis or whether to include them in the calculating model (note that setting this option to FALSE could result in a considerable increase in analytical time); option automatically defaults to TRUE
na.rm
Boolean value determing whether or not to return an error on input of any unspecified data (NA), automatically defaulting to FALSE

Value

  • Returns a numerical values corresponding to percent methylation, with 0

Details

Note that the current release of this function performs as expected for the large majority of cases. However, certain complex combinations of peak overlaps are not handled at this time. This may affect data for a minority of points, particularly those containing multiple overlaps with alternative fragments. Please ensure more in-depth review of such loci.

References

Coolen, M.W., et al. (2007) Genomic profiling of CpG methylation and allelic specificity using quantitative high-throughput mass spectrometry: critical evaluation and improvements, Nucleic Acids Research, 35(18), e119.

See Also

See Also MassArrayPeak

Examples

Run this code
data(MassArray.example.data)
frags <- MassArray.example.data$fragments.T[[6]]$"MW"
peaks <- findPeaks(frags, unlist(lapply(MassArray.example.data$samples[[1]]$peaks, slot, "MW.actual")))
SNRs <- unlist(lapply(MassArray.example.data$samples[[1]]$peaks[peaks], slot, "SNR"))
frag.list <- list(1:3, 1:3, 1:3, 1:3)
calcMeth(SNRs, fragments=frag.list, method="weighted")
calcMeth(SNRs, fragments=frag.list, method="proportion")

Run the code above in your browser using DataLab