Skip to contents

The function `varFilter` removes features exhibiting little variation across samples. Such non-specific filtering can be advantageous for downstream data analysis.

Usage

varFilter(eset, var.func=IQR, var.cutoff=0.5, filterByQuantile=TRUE, ...)

Arguments

eset

A `MethyLumiSet` or `MethyLumiM` object.

var.func

The function used as the per-feature filtering statistic.

var.cutoff

A numeric value indicating the cutoff value for variation. If `filterByQuantile` is `TRUE`, features whose value of `var.func` is less than the `var.cutoff`-quantile of all `var.func` values will be removed. If `FALSE`, features whose values are less than `var.cutoff` will be removed.

filterByQuantile

A logical indicating whether `var.cutoff` is to be interpreted as a quantile of all `var.func` values (the default), or as an absolute value.

...

Unused, but available for specializing methods.

Value

A list consisting of:

eset

The filtered `MethyLumiSet` or `MethyLumiM` object.

filter.log

Shows how many low-variance features were removed.

Details

This function is a counterpart of the functions `nsFilter` and `varFilter` available from the `genefilter` package. See R. Bourgon et al. (2010) and [genefilter::nsFilter()] for detail.

It is proven that non-specific filtering, for which the criterion does not depend on sample class, can increase the number of discoveries. Inappropriate choice of test statistics, however, might have an adverse effect. `limma`'s moderated \(t\)-statistic, for example, is based on an empirical Bayes approach which models the conjugate prior of gene-level variance with an inverse of \(\chi^2\) distribution scaled by observed global variance. As the variance-based filtering removes the set of genes with low variance, the scaled inverse \(\chi^2\) no longer provides a good fit to the data passing the filter, causing the `limma` algorithm to produce a posterior degree-of-freedom of infinity (Bourgon 2010). This leads to two consequences: (i) the gene-level variance estimate will be ignored, and (ii) the \(p\)-value will be overly optimistic (Bourgon 2010).

References

R. Bourgon, R. Gentleman, W. Huber, Independent filtering increases power for detecting differentially expressed genes, PNAS, vol. 107, no. 21, pp. 9546-9551, 2010.

See also

[genefilter::nsFilter()]

Author

Chao-Jen Wong cwon2@fhcrc.org

Examples

  data(mldat)
  ## keep top 75 percent
  filt <- varFilter(mldat, var.cutoff=0.25)
  filt$filter.log
#> $numLowVar
#> [1] 384
#> 
  dim(filt$eset)
#> Features  Samples 
#>     1152       10