cpgCollapse: Collapse methylation values of adjacent CpGs into a summary...

View source: R/blocks.R

cpgCollapseR Documentation

Collapse methylation values of adjacent CpGs into a summary value.

Description

This function groups adjacent loci into clusters with a specified maximum gap between CpGs in the cluster, and a specified maximum cluster width. The loci within each cluster are summarized resulting in a single methylation estimate per cluster.

Usage

cpgCollapse(object, what = c("Beta", "M"), maxGap = 500,
            blockMaxGap = 2.5 * 10^5, maxClusterWidth = 1500,
            dataSummary = colMeans, na.rm = FALSE,
            returnBlockInfo = TRUE, islandAnno = NULL, verbose = TRUE,
            ...)

Arguments

object

An object of class [Genomic]MethylSet or [Genomic]RatioSet.

what

Should operation be performed on the M-scale or Beta-scale?

maxGap

Maximum gap between CpGs in a cluster

blockMaxGap

Maximum block gap

maxClusterWidth

Maximum cluster width

dataSummary

Function used to summarize methylation across CpGs in the cluster.

na.rm

Should NAs be removed when summarizing? Passed on to the dataSummary function.

returnBlockInfo

Should the block annotation table be returned in addition to the block table?

islandAnno

Which Island annotation should be used. NULL indicates the default. This argument is only useful if the annotatio object contains more than one island annotation.

verbose

Should the function be verbose?

...

Passed on to getMethSignal and getCN. Can be used to specify

Details

This function is used as the first step of block-finding. It groups adjacent loci into clusters with a default maximum gap of 500bp and a maximum cluster width of 1,500bp. The loci within each cluster are then summarized (using the mean by default) resulting in a single methylation estimate per cluster. Cluster estimates from open-sea probes are used in block-finding.

Value

If returnBlockInfo is FALSE: a GenomicRatioSet of collapsed CpG clusters.

If returnBlockInfo is TRUE:

object

A GenomicRatioSet of collapsed CpG clusters

blockInfo

A cluster annotation data frame

Author(s)

Rafael Irizarry

See Also

blockFinder


hansenlab/minfi documentation built on May 3, 2024, 3:49 p.m.