Learn R Programming

wateRmelon (version 1.16.0)

pfilter: Basic data filtering for Illumina 450 methylation data

Description

The pfilter function filters data sets based on bead count and detection p-values. The user can set their own thresholds or use the default pfilter settings. pfilter will take data matrices of beta values, signal intensities and annotation data, but will also take methylumi (MethyLumiSet) or minfi (RGChannelSetExtended) objects. However it has come to our attention that data read in using the various packages and input methods will give subtly variable data output as they calculate detection p-value and beta values differently, and do/don?t give information about beadcount. The pfilter function does not correct for this, but simply uses the detection p-value and bead count provided by each package.

Usage

pfilter(mn, un, bn, da, pn, bc, perCount=NULL, pnthresh = NULL, perc = NULL, pthresh = NULL,logical.return=FALSE)

Arguments

mn
matrix of methylated signal intensities, each column representing a sample (default method), or an object for which a method is available e.g MethyLumiSet or RGChannelSetExtended. N.B. Bead count filtering will not work unless data read in as an RGGhannelSetExtended rather than an RGChannelSet.
un
matrix of unmethylated signal intensities, each column representing a sample (default method) or NULL when mn is a MethyLumiSet or RGChannelSetExtended object
bn
matrix of precalculated betas, each column representing a sample, or NULL when mn is a MethyLumiSet or RGChannelSetExtended object
da
annotation data frame, such as x@featureData@data #methylumi package, or NULL when mn is a MethyLumiSet or RGChannelSetExtended object

pn
matrix of detection p-values, each column representing a sample, a MethyLumiSet or RGChannelSetExtended object
bc
matrix of arbitrary values, each column representing a sample and eeach row representing a probe, in which "NA" represents beadcount
perCount
remove sites having this percentage of samples with a beadcount
pnthresh
cutoff for detection p-value, default set to 0.05
perc
remove samples having this percentage of sites with a detection p-value greater than pnthresh, default set to 1
pthresh
remove sites having this percentage of samples with a detection p-value greater than pnthresh, default set to 1
logical.return
If it is TRUE, FALSE or TRUE is returned to indicate success

Value

a filtered MethyLumiSet ora list of the filtered matrices:mn : methylated intensitiesun : unmethylated intensitiesbn : betasda : feature dataora MethylSet object containing a Logical Matrix named "Filter" within the assayData, which then can be used for down-stream subsetting.

Methods

signature(mn = "MethyLumiSet")
This is used for performing the pfilter method on MethyLumiSet objects produced by methylumiR.
signature(mn = "RGChannelSetExtended")
This is used for performing the pfilter method on RGChannelSetExtended objects produced by minfi.

References

[1] Pidsley R, Wong CCY, Volta M, Lunnon K, Mill J, Schalkwyk LC: A data-driven approach to preprocessing Illumina 450K methylation array data (submitted)

Examples

Run this code
# MethyLumiSet method
data(melon)
melon.pf <- pfilter(melon)

Run the code above in your browser using DataLab