Function to calculate percent methylation (wrapper for calcMeth() function) for each identified conversion control
Usage
calcPercentConversion(fragments, peaks)
Arguments
fragments
List of MassArrayFragment objects
peaks
List of MassArrayPeak objects comprising spectral data to be used for conversion control calculations
Details
This function serves as a wrapper function for calcMeth(), such that percent methylation is calculated for all conversion controls within the input list of fragments.
Value
Returns a list of numerical values (from 0 to 1) corresponding to percent methylation for each conversion control, with 0
Note that each element within the returned list will represent conversion control(s) for a single sample, while each element may contain multiple values with each value corresponding to data obtained from a single conversion control fragment.
data(MassArray.example.data)
conversion.data <- calcPercentConversion(MassArray.example.data$fragments.T, MassArray.example.data$samples[[1]]$peaks)
mean(conversion.data)
# NOTE: conversion control data may already be contained within a MassArrayData object; these data can be accessed and visualized by the following (or alternative) commands
conversion.data <- unlist(lapply(lapply(MassArray.example.data$samples, slot, "quality.conversion"), median, na.rm=TRUE))
barplot(conversion.data)
Results
R version 3.3.1 (2016-06-21) -- "Bug in Your Hair"
Copyright (C) 2016 The R Foundation for Statistical Computing
Platform: x86_64-pc-linux-gnu (64-bit)
R is free software and comes with ABSOLUTELY NO WARRANTY.
You are welcome to redistribute it under certain conditions.
Type 'license()' or 'licence()' for distribution details.
R is a collaborative project with many contributors.
Type 'contributors()' for more information and
'citation()' on how to cite R or R packages in publications.
Type 'demo()' for some demos, 'help()' for on-line help, or
'help.start()' for an HTML browser interface to help.
Type 'q()' to quit R.
> library(MassArray)
> png(filename="/home/ddbj/snapshot/RGM3/R_BC/result/MassArray/calcPercentConversion.Rd_%03d_medium.png", width=480, height=480)
> ### Name: calcPercentConversion
> ### Title: Calculate percent conversion
> ### Aliases: calcPercentConversion
> ### Keywords: attribute arith
>
> ### ** Examples
>
> data(MassArray.example.data)
> conversion.data <- calcPercentConversion(MassArray.example.data$fragments.T, MassArray.example.data$samples[[1]]$peaks)
> mean(conversion.data)
[1] 0.005864446
>
> # NOTE: conversion control data may already be contained within a MassArrayData object; these data can be accessed and visualized by the following (or alternative) commands
> conversion.data <- unlist(lapply(lapply(MassArray.example.data$samples, slot, "quality.conversion"), median, na.rm=TRUE))
> barplot(conversion.data)
>
>
>
>
>
> dev.off()
null device
1
>