Last data update: 2014.03.03

R: Methods for function 'bumphunter' in Package 'minfi'
bumphunter-methodsR Documentation

Methods for function bumphunter in Package minfi

Description

Estimate regions for which a genomic profile deviates from its baseline value. Originally implemented to detect differentially methylated genomic regions between two populations, but can be applied to any CpG-level coefficient of interest.

Usage

## S4 method for signature 'GenomicRatioSet'
bumphunter(object, design, cluster=NULL,
          coef=2,  cutoff=NULL, pickCutoff=FALSE, pickCutoffQ=0.99, 
          maxGap=500,  nullMethod=c("permutation","bootstrap"),
          smooth=FALSE, smoothFunction=locfitByCluster,
          useWeights=FALSE,   B=ncol(permutations), permutations=NULL,
          verbose=TRUE, type = c("Beta","M"), ...)

Arguments

object

An object of class GenomicRatioSet.

design

Design matrix with rows representing samples and columns representing covariates. Regression is applied to each row of mat.

cluster

The clusters of locations that are to be analyzed together. In the case of microarrays, the clusters are many times supplied by the manufacturer. If not available the function clusterMaker can be used to cluster nearby locations.

coef

An integer denoting the column of the design matrix containing the covariate of interest. The hunt for bumps will be only be done for the estimate of this coefficient.

cutoff

A numeric value. Values of the estimate of the genomic profile above the cutoff or below the negative of the cutoff will be used as candidate regions. It is possible to give two separate values (upper and lower bounds). If one value is given, the lower bound is minus the value.

pickCutoff

Should bumphunter attempt to pick a cutoff using the permutation distribution?

pickCutoffQ

The quantile used for picking the cutoff using the permutation distribution.

maxGap

If cluster is not provided this maximum location gap will be used to define cluster via the clusterMaker function.

nullMethod

Method used to generate null candidate regions, must be one of ‘boots trap’ or ‘permutation’ (defaults to ‘permutation’). However, if covariates in addition to the outcome of interest are included in the design matrix (ncol(design)>2), the ‘permutation’ approach is not recommended. See vignette and original paper for more information.

smooth

A logical value. If TRUE the estimated profile will be smoothed with the smoother defined by smoothFunction

smoothFunction

A function to be used for smoothing the estimate of the genomic profile. Two functions are provided by the package: loessByCluster and runmedByCluster.

useWeights

A logical value. If TRUE then the standard errors of the point-wise estimates of the profile function will be used as weights in the loess smoother loessByCluster. If the runmedByCluster smoother is used this argument is ignored.

B

An integer denoting the number of resamples to use when computing null distributions. This defaults to 0. If permutations is supplied that defines the number of permutations/bootstraps and B is ignored.

permutations

is a matrix with columns providing indexes to be used to scramble the data and create a null distribution when nullMethod is set to permutations. If the bootstrap approach is used this argument is ignored. If this matrix is not supplied and B>0 then these indexes are created using the function sample.

verbose

logical value. If TRUE, it writes out some messages indicating progress. If FALSE nothing should be printed.

type

Should bumphunting be performed on M-values ("M") or Beta values ("Beta")?

...

further arguments to be passed to the smoother functions.

Details

See help file for bumphunter method in the bumphunter package for for details.

Value

An object of class bumps with the following components:

tab

The table with candidate regions and annotation for these.

coef

The single loci coefficients.

fitted

The estimated genomic profile used to determine the regions.

pvaluesMarginal

marginal p-value for each genomic location.

null

The null distribution.

algorithm

details on the algorithm.

Author(s)

Rafael A. Irizarry, Martin J. Aryee and Kasper D. Hansen

References

AE Jaffe, P Murakami, H Lee, JT Leek, MD Fallin, AP Feinberg, and RA Irizarry. Bump hunting to identify differentially methylated regions in epigenetic epidemiology studies. International Journal of Epidemiology (2012) 41(1):200-209. doi:10.1093/ije/dyr238

See Also

bumphunter

Examples

if(require(minfiData)) {
  gmSet <- preprocessQuantile(MsetEx)
  design <- model.matrix(~ gmSet$status)
  bumps <- bumphunter(gmSet, design = design, B = 0,
                      type = "Beta", cutoff = 0.25)
}

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(minfi)
Loading required package: BiocGenerics
Loading required package: parallel

Attaching package: 'BiocGenerics'

The following objects are masked from 'package:parallel':

    clusterApply, clusterApplyLB, clusterCall, clusterEvalQ,
    clusterExport, clusterMap, parApply, parCapply, parLapply,
    parLapplyLB, parRapply, parSapply, parSapplyLB

The following objects are masked from 'package:stats':

    IQR, mad, xtabs

The following objects are masked from 'package:base':

    Filter, Find, Map, Position, Reduce, anyDuplicated, append,
    as.data.frame, cbind, colnames, do.call, duplicated, eval, evalq,
    get, grep, grepl, intersect, is.unsorted, lapply, lengths, mapply,
    match, mget, order, paste, pmax, pmax.int, pmin, pmin.int, rank,
    rbind, rownames, sapply, setdiff, sort, table, tapply, union,
    unique, unsplit

Loading required package: Biobase
Welcome to Bioconductor

    Vignettes contain introductory material; view with
    'browseVignettes()'. To cite Bioconductor, see
    'citation("Biobase")', and for packages 'citation("pkgname")'.

Loading required package: lattice
Loading required package: GenomicRanges
Loading required package: S4Vectors
Loading required package: stats4

Attaching package: 'S4Vectors'

The following objects are masked from 'package:base':

    colMeans, colSums, expand.grid, rowMeans, rowSums

Loading required package: IRanges
Loading required package: GenomeInfoDb
Loading required package: SummarizedExperiment
Loading required package: Biostrings
Loading required package: XVector
Loading required package: bumphunter
Loading required package: foreach
Loading required package: iterators
Loading required package: locfit
locfit 1.5-9.1 	 2013-03-22
Setting options('download.file.method.GEOquery'='auto')
Setting options('GEOquery.inmemory.gpl'=FALSE)
> png(filename="/home/ddbj/snapshot/RGM3/R_BC/result/minfi/bumphunter.Rd_%03d_medium.png", width=480, height=480)
> ### Name: bumphunter-methods
> ### Title: Methods for function 'bumphunter' in Package 'minfi'
> ### Aliases: bumphunter,GenomicRatioSet-method
> 
> ### ** Examples
> 
> if(require(minfiData)) {
+   gmSet <- preprocessQuantile(MsetEx)
+   design <- model.matrix(~ gmSet$status)
+   bumps <- bumphunter(gmSet, design = design, B = 0,
+                       type = "Beta", cutoff = 0.25)
+ }
Loading required package: minfiData
Loading required package: IlluminaHumanMethylation450kmanifest
Loading required package: IlluminaHumanMethylation450kanno.ilmn12.hg19
[preprocessQuantile] Mapping to genome.
[preprocessQuantile] Fixing outliers.
[preprocessQuantile] Quantile normalizing.
[bumphunterEngine] Using a single core (backend: doSEQ, version: 1.4.3).
[bumphunterEngine] Computing coefficients.
[bumphunterEngine] Finding regions.
[bumphunterEngine] Found 14090 bumps.
> 
> 
> 
> 
> 
> dev.off()
null device 
          1 
>